Skip to content

Commit 63b3eef

Browse files
committed
Make TravisCI show failed if a test fails
Failed tests were not exiting the travis shell with an error. Add a final step to make this happen.
1 parent 5e8ec14 commit 63b3eef

File tree

2 files changed

+15
-1
lines changed

2 files changed

+15
-1
lines changed

.travis.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ env:
2222
# Using configure and make, run the tests.
2323
- >
2424
BUILD_SCRIPT="FC='gfortran -fno-backtrace' ./configure &&
25-
make -j 2 && make -j 2 check"
25+
make -j 2 && make -j 2 check && ./testcheck.sh"
2626
2727
# Using cmake - just build, tests not working yet.
2828
- >

testcheck.sh

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
#!/bin/sh -e
2+
3+
# Script to parse the output generated by make checkr.,
4+
# Exits with non-zero return code if any tests failed.
5+
# This can be used inside of a CI environment.
6+
7+
for numerr in `grep RESULT check.out | grep Failed: | cut -d " " -f 4`
8+
do
9+
if [ "$numerr" -ne "0" ]
10+
then
11+
echo "At least one test failed. Examine check.out for details"
12+
exit 1
13+
fi
14+
done

0 commit comments

Comments
 (0)