travis: move build script to a separate script and improve debugging for failed tests

This commit is contained in:
Thomas Haller 2016-01-22 10:47:07 +01:00
parent 0c7fa89439
commit 34050e9c0b
2 changed files with 30 additions and 1 deletions

View File

@ -7,4 +7,4 @@ before_install:
- sudo apt-add-repository 'deb http://archive.ubuntu.com/ubuntu trusty-backports main restricted universe multiverse'
- sudo apt-get update
- sudo apt-get install libnl-3-dev libndp-dev automake
script: "sh autogen.sh --with-systemd-logind=no --enable-more-warnings=no && make -j6 && make -k check"
script: "./contrib/travis/travis-run.sh"

29
contrib/travis/travis-run.sh Executable file
View File

@ -0,0 +1,29 @@
#!/bin/bash
set -ev
print_test_logs() {
echo ">>>> PRINT TEST LOGS $1 (start)"
find -regex '.*/tests/[^/]+.log$' -exec sh -c 'echo ">>>>> LOGFILE $1"; cat "$1"' '--' '{}' ';'
echo ">>>> PRINT TEST LOGS $1 (done)"
}
sh ./autogen.sh \
--with-systemd-logind=no \
--enable-more-warnings=no
make -j6
if ! make check -k ; then
print_test_logs "first-test"
echo ">>>> RUN SECOND TEST (start)"
NMTST_DEBUG=TRACE,no-expect-messages make check -k || :
echo ">>>> RUN SECOND TEST (done)"
print_test_logs "second-test"
exit 57
fi