Add after_failure script to show failed test log

This commit is contained in:
kinichiro 2021-05-15 01:25:18 +09:00
parent 66e8b10e53
commit dcad94bbc0
2 changed files with 21 additions and 0 deletions

View File

@ -62,3 +62,6 @@ matrix:
script: script:
"./scripts/travis" "./scripts/travis"
after_failure:
"./scripts/travis_failure"

18
scripts/travis_failure Executable file
View File

@ -0,0 +1,18 @@
#!/bin/sh
CWD=`pwd`
testsdir=`ls -d libressl-*/_build/sub/tests`
if [ -d "$testsdir" ] ; then
echo "##### test logs in $testsdir"
cd $testsdir
for i in `ls *.trs` ; do
grep ':test-result: PASS' $i > /dev/null
if [ $? -eq 1 ] ; then
log=`echo $i | sed 's/\.trs$/\.log/'`
echo "***** $log"
cat $log
fi
done
cd $CWD
fi