* support/regression/Makefile: inter-port-clean adjusted for mcs51
[fw/sdcc] / support / regression / collate-results.py
1 import sys, re
2 import string
3
4 """Simple script that scans all of the test suite results text fed in
5 through stdin and summarises the total number of failures, test
6 points, and test cases."""
7
8 # Read in everything
9 lines = sys.stdin.readlines()
10
11 # Init the running totals
12 failures = 0
13 cases = 0
14 tests = 0
15
16 for line in lines:
17     # '--- Summary: f/t/c ...', where f = # failures, t = # test points,
18     # c = # test cases.
19     if (re.search(r'^--- Summary:', line)):
20         (summary, data, rest) = re.split(r':', line)
21         (nfailures, ntests, ncases) = re.split(r'/', data)
22         failures = failures + string.atof(nfailures)
23         tests = tests + string.atof(ntests)
24         cases = cases + string.atof(ncases)
25
26 print "%.0f failures, %.0f tests, %.0f test cases" % (failures, tests, cases)