From 099ea7176dd92785d274f86c8cf723d86ac14a0d Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Thu, 9 Jul 2020 14:08:44 +0200 Subject: [PATCH] Properly stop Travis CI build after a test failure Using "pushd tests && test-command && popd" loses the exit code of the test command, as it's not taken into account by "set -e" when the command is part of a "&&" list. Fix this by simply splitting such lists in their individual commands. --- build/tools/travis-ci.sh | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/build/tools/travis-ci.sh b/build/tools/travis-ci.sh index 2fc69fc6a8..db4bbe6057 100755 --- a/build/tools/travis-ci.sh +++ b/build/tools/travis-ci.sh @@ -115,7 +115,9 @@ case $wxTOOLSET in echo 'travis_fold:start:testing' echo 'Testing...' - pushd tests && ./test && popd + pushd tests + ./test + popd echo 'travis_fold:end:testing' if [ "$wxSKIP_GUI" = 1 ]; then @@ -126,7 +128,9 @@ case $wxTOOLSET in if [ "$wxUSE_XVFB" = 1 ]; then echo 'travis_fold:start:testing_gui' echo 'Testing GUI using Xvfb...' - pushd tests && xvfb-run -a -s '-screen 0 1600x1200x24' ./test_gui && popd + pushd tests + xvfb-run -a -s '-screen 0 1600x1200x24' ./test_gui + popd echo 'travis_fold:end:testing_gui' fi