~vcs-imports/xdg-utils/master

Viewing all changes in revision 752.

  • Committer: Richard Tollerton
  • Date: 2019-01-12 00:43:09 UTC
  • Revision ID: git-v1:af7b34a6d3b77b7c9565fa7b396c7da676aa2fec
test-lib.sh: run: eat xdg-open's exit code

It was observed that t-xdg-open.sh exits after only a fraction of the tests have
been run, e.g.

ASSERTION FAILED: expected command to be run: gio open http://www.freedesktop.org/
ASSERTION FAILED: expected command to be run: gio open http://www.freedesktop.org/
  - opens a URL with gvfs-open if gio open is missing in GNOME 3, GNOME 2, and Cinnamon
gio: http://www.freedesktop.org/: Operation not supported
make: *** [Makefile:21: t-xdg-open.sh] Error 4

Given that some tests are failing on my machine (likely because of the
peculiarities of my archlinux install), the root cause is `set -e`. The nonzero
exit code returned by xdg-open gets returned by run(), which is also returned by
e.g. test_open_url(), which causes the script to exit immediately.

All test passes/failures at present are being defined by explicit assertions,
not by exit codes, and it seems at least plausible that some xdg-open calls are
meant to fail. So rather than report the nonzero error code, just ignore it, and
trust that the assertions determine the results.

Signed-off-by: Richard Tollerton <rich.tollerton@ni.com>

expand all expand all

Show diffs side-by-side

added added

removed removed

Lines of Context: