Commit f22af098 authored by Evan Hunt's avatar Evan Hunt

Merge branch '113-minor-testsummary.sh-improvements' into 'master'

Minor testsummary.sh improvements (handling colored output, failure summary)

Closes #113

See merge request !80
parents 58ad17bd 38940619
Pipeline #427 passed with stages
in 11 minutes and 10 seconds
...@@ -35,14 +35,25 @@ while getopts "n" flag; do ...@@ -35,14 +35,25 @@ while getopts "n" flag; do
esac esac
done done
cat */test.output > systests.output 2> /dev/null if [ `ls */test.output 2> /dev/null | wc -l` -eq 0 ]; then
if [ $keepfile -eq 0 ]; then echowarn "I:No 'test.output' files were found."
rm -f */test.output echowarn "I:Printing summary from pre-existing 'systests.output'."
else
cat */test.output > systests.output
if [ $keepfile -eq 0 ]; then
rm -f */test.output
fi
fi fi
status=0 status=0
echo "I:System test result summary:" echoinfo "I:System test result summary:"
grep '^R:' systests.output | cut -d':' -f3 | sort | uniq -c | sed -e 's/^/I:/' echoinfo "`grep 'R:[a-z0-9_-][a-z0-9_-]*:[A-Z][A-Z]*' systests.output | cut -d':' -f3 | sort | uniq -c | sed -e 's/^/I:/'`"
grep '^R:[^:]*:FAIL' systests.output > /dev/null && status=1
FAILED_TESTS=`grep 'R:[a-z0-9_-][a-z0-9_-]*:FAIL' systests.output | cut -d':' -f2 | sort | sed -e 's/^/I: /'`
if [ -n "${FAILED_TESTS}" ]; then
echoinfo "I:The following system tests failed:"
echoinfo "${FAILED_TESTS}"
status=1
fi
exit $status exit $status
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment