add cat-testlogs.sh

Change-Id: I2d145cb9ca636ba42194f797b5f4d59437cea131
This commit is contained in:
Neels Hofmeyr 2016-09-27 01:34:20 +02:00
parent c8f48b469c
commit 79480b6f81
1 changed files with 22 additions and 0 deletions

22
scripts/cat-testlogs.sh Executable file
View File

@ -0,0 +1,22 @@
#!/bin/sh
#
# Intended for use in jenkins build jobs, like this:
# export PATH="$PATH:/usr/local/src/buildserver-commons"
# $MAKE check || cat-testlogs.sh
#
# In the jenkins console output, show the actual failures by printing the test
# logs to the console output. This way we can see how exactly the test failed
# even if a job is older and no workspace is available.
set +x
find . -path "*/testsuite.dir/*/testsuite.log" | while read testlog; do
echo
echo
echo
echo ======================== "$testlog"
echo
cat $testlog
done
# this will be called after a test failure, so make sure to return an error
exit 1