diff --git a/.travis.yml b/.travis.yml index 7cd10984..e1a9bb50 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,3 +1,5 @@ language: c sudo: required script: bash -eux .travis-ci.sh +env: + - TRAVIS=true \ No newline at end of file diff --git a/test/run-tests.sh b/test/run-tests.sh index b8db32be..9b5f5655 100755 --- a/test/run-tests.sh +++ b/test/run-tests.sh @@ -21,8 +21,25 @@ fi bin/words 'rem acu tetigisti' | diff -q -- - test/expected.txt TEMP=$(tempfile) -if ! ( bin/words < test/aeneid_bk4.txt | \ - diff -u -- - test/aeneid_bk4.expected > $TEMP ); then + +run-tests () { + set +u + if [ "$TRAVIS" = "true" ]; then + set -u + TEMP2=$(tempfile) + bin/words < test/aeneid_bk4.txt | tee $TEMP2 + diff -u -- - test/aeneid_bk4.txt.expected < $TEMP2 > $TEMP + rv=$? + rm -f -- $TEMP2 || true + return $rv + else + set -u + bin/words < test/aeneid_bk4.txt | \ + diff -u -- - test/aeneid_bk4.expected > $TEMP + fi +} + +if ! ( run-tests ); then rv=$? if [ -s "$TEMP" ]; then cat $TEMP