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."""
9 lines = sys.stdin.readlines()
11 # Init the running totals
22 if (re.search(r'^--- Running', line)):
24 # '--- Summary: f/t/c: ...', where f = # failures, t = # test points,
26 if (re.search(r'^--- Summary:', line)):
27 (summary, data, rest) = re.split(r':', line)
28 (nfailures, ntests, ncases) = re.split(r'/', data)
29 failures = failures + string.atof(nfailures)
30 tests = tests + string.atof(ntests)
31 cases = cases + string.atof(ncases)
32 if (string.atof(nfailures)):
35 # '--- Simulator: b/t: ...', where b = # bytes, t = # ticks
36 if (re.search(r'^--- Simulator:', line)):
37 (simulator, data, rest) = re.split(r':', line)
38 (nbytes, nticks) = re.split(r'/', data)
39 bytes = bytes + string.atof(nbytes)
40 ticks = ticks + string.atof(nticks)
42 print "%.0f failures, %.0f tests, %.0f test cases, %.0f bytes, %.0f ticks" % (failures, tests, cases, bytes, ticks)