From a49c98d8d82174de3e2c5f1f978c30cee946cb8f Mon Sep 17 00:00:00 2001 From: Simon McVittie Date: Tue, 21 Sep 2021 14:42:29 +0100 Subject: [PATCH] tests: Don't continue if setup commands fail Because POSIX sh was, with hindsight, not a particularly well-designed programming language, if we don't 'set -e', then we'll respond to failure of a setup command such as cd by carrying on regardless. Signed-off-by: Simon McVittie Part-of: --- cogl/tests/conform/mutter-cogl.test.in | 2 +- src/tests/mutter-all.test.in | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/cogl/tests/conform/mutter-cogl.test.in b/cogl/tests/conform/mutter-cogl.test.in index a58446927..0546d15af 100644 --- a/cogl/tests/conform/mutter-cogl.test.in +++ b/cogl/tests/conform/mutter-cogl.test.in @@ -3,4 +3,4 @@ Type=session # Can't use TestEnvironment for COGL_TEST_VERBOSE until there's a solution # for https://gitlab.gnome.org/GNOME/gnome-desktop-testing/-/issues/1, # and anyway we'd still need to use the shell to 'cd' -Exec=sh -c "export COGL_TEST_VERBOSE=1; cd @libexecdir@/installed-tests/mutter-@apiversion@/cogl/conform; xvfb-run -a -s '+iglx -noreset' ./run-tests.sh ./config.env ./test-conformance ./unit-tests" +Exec=sh -ec "export COGL_TEST_VERBOSE=1; cd @libexecdir@/installed-tests/mutter-@apiversion@/cogl/conform; xvfb-run -a -s '+iglx -noreset' ./run-tests.sh ./config.env ./test-conformance ./unit-tests" diff --git a/src/tests/mutter-all.test.in b/src/tests/mutter-all.test.in index df47c63d9..f99dc29da 100644 --- a/src/tests/mutter-all.test.in +++ b/src/tests/mutter-all.test.in @@ -4,6 +4,6 @@ Description=All Mutter tests # a solution for # https://gitlab.gnome.org/GNOME/gnome-desktop-testing/-/issues/1, # and anyway that wouldn't be sufficient to handle XDG_RUNTIME_DIR -Exec=sh -c 'env GSETTINGS_BACKEND=memory XDG_RUNTIME_DIR="$(mktemp -d -t mutter-@apiversion@-all-tests-XXXXXX)" @libexecdir@/installed-tests/mutter-@apiversion@/meta-dbus-runner.py xvfb-run -a -s "+iglx -noreset" -- @libexecdir@/installed-tests/mutter-@apiversion@/mutter-test-runner --all' +Exec=sh -ec 'env GSETTINGS_BACKEND=memory XDG_RUNTIME_DIR="$(mktemp -d -t mutter-@apiversion@-all-tests-XXXXXX)" @libexecdir@/installed-tests/mutter-@apiversion@/meta-dbus-runner.py xvfb-run -a -s "+iglx -noreset" -- @libexecdir@/installed-tests/mutter-@apiversion@/mutter-test-runner --all' Type=session Output=TAP