Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • X xdg-utils
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 172
    • Issues 172
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 43
    • Merge requests 43
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Container Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • xdg
  • xdg-utils
  • Merge requests
  • !2

test-lib.sh: run: eat xdg-open's exit code

  • Review changes

  • Download
  • Email patches
  • Plain diff
Merged Richard Tollerton requested to merge rtollert/xdg-utils:dev/rtollert/run-errexit into master Jan 10, 2019
  • Overview 2
  • Commits 1
  • Pipelines 0
  • Changes 1

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

Assignee
Assign to
Reviewers
Request review from
Time tracking
Source branch: dev/rtollert/run-errexit