The current regular expression used for extracting system test results
from systests.output, "^R:", is anchored at the start of a line, which
prevents colored system test output from being properly processed. As
just "R:" would arguably be too general, extend the pattern a bit to
ensure it will only match lines containing system test results.
status=0
echo "I:System test result summary:"
-grep '^R:' systests.output | cut -d':' -f3 | sort | uniq -c | sed -e 's/^/I:/'
-grep '^R:[^:]*:FAIL' systests.output > /dev/null && status=1
+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:[a-z0-9_-][a-z0-9_-]*:FAIL' systests.output > /dev/null && status=1
exit $status