wrap exit commands when used in .travis.yml

This commit is contained in:
Chris Beck 2014-07-05 13:52:05 -04:00
parent 2fbe31ed8e
commit 30276db7d3
2 changed files with 4 additions and 2 deletions

View file

@ -31,12 +31,12 @@ install:
- if [ "$CHECK_UTF8" = true ]; then time sudo apt-get install -qq moreutils; fi
script:
- if [ "$CHECK_UTF8" = true ]; then time ./utils/travis/check_utf8.sh; fi
- time if grep -qorHbm1 "^`echo -ne '\xef\xbb\xbf'`" po/ src/ data/ ; then echo "Error, Found a UTF8 BOM:\n"; grep -orHbm1 "^`echo -ne '\xef\xbb\xbf'`" po/ src/ data/ ; exit 1; fi
- time if grep -qorHbm1 "^`echo -ne '\xef\xbb\xbf'`" po/ src/ data/ ; then echo "Error, Found a UTF8 BOM:\n"; grep -orHbm1 "^`echo -ne '\xef\xbb\xbf'`" po/ src/ data/ ; ./utils/travis/exit_wrapper.sh 1; fi
# UTF8 checks are the previous two lines. the second one checks po src data for UTF8 bom, this takes a few seconds.
- scons cxxtool=$CXX --debug=time build=release extra_flags_release="$EXTRA_FLAGS_RELEASE" strict=$STRICT_COMPILATION $TARGETS
- "export DISPLAY=:99.0"
- "sh -e /etc/init.d/xvfb start"
- if [[ "$CPP_TESTS" = true ]]; then time ./test; export TEST_ERROR_CODE=$?; exit $TEST_ERROR_CODE; fi
- if [[ "$CPP_TESTS" = true ]]; then time ./test; export TEST_ERROR_CODE=$?; ./utils/travis/exit_wrapper.sh $TEST_ERROR_CODE; fi
- echo $TEST_ERROR_CODE
- if [[ "$WML_TESTS" = true ]]; then time ./run_wml_tests -v -t "$WML_TEST_TIME"; fi
after_failure:

2
utils/travis/exit_wrapper.sh Executable file
View file

@ -0,0 +1,2 @@
#!/bin/bash
exit $1