Skip to content

Commit

Permalink
Make TravisCI show failed if a test fails
Browse files Browse the repository at this point in the history
Failed tests were not exiting the travis shell with
an error. Add a final step to make this happen.
  • Loading branch information
andreww committed Jan 7, 2018
1 parent 5e8ec14 commit 63b3eef
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ env:
# Using configure and make, run the tests.
- >
BUILD_SCRIPT="FC='gfortran -fno-backtrace' ./configure &&
make -j 2 && make -j 2 check"
make -j 2 && make -j 2 check && ./testcheck.sh"
# Using cmake - just build, tests not working yet.
- >
Expand Down
14 changes: 14 additions & 0 deletions testcheck.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#!/bin/sh -e

# Script to parse the output generated by make checkr.,
# Exits with non-zero return code if any tests failed.
# This can be used inside of a CI environment.

for numerr in `grep RESULT check.out | grep Failed: | cut -d " " -f 4`
do
if [ "$numerr" -ne "0" ]
then
echo "At least one test failed. Examine check.out for details"
exit 1
fi
done

0 comments on commit 63b3eef

Please sign in to comment.