Travis: use exit code 1 for failures, not errors (#1887)

Using exit code != 1 (e.g. 2 as with "make") appears to cause Travis to
consider the build job as an error ("!"), instead of a failure ("X").

Example build: https://travis-ci.org/awesomeWM/awesome/builds/248484247

    !: https://travis-ci.org/awesomeWM/awesome/jobs/248484252
        Test finished successfully
        There were 3 errors!
        make[4]: *** [CMakeFiles/check-integration] Error 1
        make[3]: *** [CMakeFiles/check-integration.dir/all] Error 2
        make[2]: *** [CMakeFiles/check-integration.dir/rule] Error 2
        make[1]: *** [check-integration] Error 2
        make: *** [check-integration] Error 2
        ++return

    X: https://travis-ci.org/awesomeWM/awesome/jobs/248484250
        Test finished successfully
        There were 3 errors!
This commit is contained in:
Daniel Hahler 2017-07-01 14:15:12 +02:00 committed by GitHub
parent cbb8fd7ac4
commit 1cdd7ef869
1 changed files with 8 additions and 9 deletions

View File

@ -142,7 +142,7 @@ install:
travis_run_in_fold() {
travis_fold_start "$1"
shift
"$@" || return
"$@" || return 1
travis_fold_end
return 0
}
@ -189,15 +189,14 @@ script:
&& cmake $CMAKE_ARGS ..)
do_codecov samples
(make check-unit-coverage \
&& do_codecov unittests \
&& tests/run.sh \
&& do_codecov functionaltests \
&& gcov $(find -name '*.o') \
&& do_codecov_gcov c_code)
ret=$?
make check-unit-coverage
do_codecov unittests
tests/run.sh
do_codecov functionaltests
gcov $(find -name '*.o')
do_codecov_gcov c_code
travis_fold_end
[ "$ret" = 0 ]
else
travis_run_in_fold "make.check-unit" make check-unit
travis_run_in_fold "make.check-integration" make check-integration