travis: redirect unittest output to file in all builds

On error, print the last 500 lines of output then exit 1.

Shoud allow us to see why a build fail on the debug tests,
when the error was burried in an output file we weren't
making visible.
pull/3263/head
Jason Ish 8 years ago committed by Victor Julien
parent 053022931c
commit 1115eb52eb

@ -168,17 +168,21 @@ script:
--with-libnspr-includes=/usr/local/opt/nspr/include/nspr \ --with-libnspr-includes=/usr/local/opt/nspr/include/nspr \
--with-libnspr-libraries=/usr/local/opt/nspr/lib --with-libnspr-libraries=/usr/local/opt/nspr/lib
fi fi
# With debug enabled too much output is generated for Travis, so
# redirect stderr to a file.
- | - |
# Linux container builds have 2 cores, make use of them. # Linux container builds have 2 cores, make use of them.
if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then
j="-j 2" j="-j 2"
fi fi
if [[ "$ENABLE_DEBUG" == "yes" ]]; then make ${j}
make ${j} check 2> stderr.log - |
else # Like "make check", but fail on first error. We redirect the output
make ${j} check # so Travis doesn't fail the build with a too much output error.
mkdir -p ./qa/log
./src/suricata -u -l ./qa/log --fatal-unittests > unittests.log 2>&1
if [[ $? -ne 0 ]]; then
echo "Unit tests failed, last 500 lines of output are:"
tail -n 500 unittests.log
exit 1
fi fi
- | - |
if [[ "$DO_DISTCHECK" == "yes" ]]; then if [[ "$DO_DISTCHECK" == "yes" ]]; then

Loading…
Cancel
Save