Skip to content

Commit

Permalink
make travis show output
Browse files Browse the repository at this point in the history
  • Loading branch information
mk270 committed Mar 14, 2016
1 parent 32482b0 commit 85360b4
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 2 deletions.
2 changes: 2 additions & 0 deletions .travis.yml
@@ -1,3 +1,5 @@
language: c
sudo: required
script: bash -eux .travis-ci.sh
env:
- TRAVIS=true
21 changes: 19 additions & 2 deletions test/run-tests.sh
Expand Up @@ -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
Expand Down

0 comments on commit 85360b4

Please sign in to comment.