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.
This commit is contained in:
Vadim Zeitlin 2020-07-09 14:08:44 +02:00
parent 4c0288435b
commit 099ea7176d

View File

@ -115,7 +115,9 @@ case $wxTOOLSET in
echo 'travis_fold:start:testing' echo 'travis_fold:start:testing'
echo 'Testing...' echo 'Testing...'
pushd tests && ./test && popd pushd tests
./test
popd
echo 'travis_fold:end:testing' echo 'travis_fold:end:testing'
if [ "$wxSKIP_GUI" = 1 ]; then if [ "$wxSKIP_GUI" = 1 ]; then
@ -126,7 +128,9 @@ case $wxTOOLSET in
if [ "$wxUSE_XVFB" = 1 ]; then if [ "$wxUSE_XVFB" = 1 ]; then
echo 'travis_fold:start:testing_gui' echo 'travis_fold:start:testing_gui'
echo 'Testing GUI using Xvfb...' 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' echo 'travis_fold:end:testing_gui'
fi fi