2017-12-18 21:23:31 +00:00
|
|
|
import re
|
|
|
|
import json
|
2017-12-28 17:28:48 +00:00
|
|
|
import fnmatch
|
2018-04-01 15:02:00 +00:00
|
|
|
import sys
|
2017-12-18 21:23:31 +00:00
|
|
|
|
|
|
|
config = json.load(open('config.json'))
|
|
|
|
test_error_set = set(config['TestErrorMap'].keys())
|
2017-12-28 17:28:48 +00:00
|
|
|
obsolete_disabled_tests = set()
|
2017-12-18 21:23:31 +00:00
|
|
|
|
|
|
|
all_tests = set()
|
|
|
|
failing_tests = set()
|
|
|
|
unimpl_tests = set()
|
2017-12-28 17:28:48 +00:00
|
|
|
disabled_tests = set()
|
2017-12-18 21:23:31 +00:00
|
|
|
passed_tests = set()
|
|
|
|
|
2018-04-01 15:02:00 +00:00
|
|
|
for line in sys.stdin:
|
2017-12-28 17:28:48 +00:00
|
|
|
m = re.match('^(PASSED|UNIMPLEMENTED|FAILED|DISABLED) \((.*)\)$', line.strip())
|
2017-12-18 21:23:31 +00:00
|
|
|
if m:
|
|
|
|
status, name = m.groups()
|
|
|
|
if name in test_error_set:
|
|
|
|
test_error_set.remove(name)
|
|
|
|
all_tests.add(name)
|
|
|
|
if status == 'FAILED':
|
|
|
|
failing_tests.add(name)
|
|
|
|
elif status == 'UNIMPLEMENTED':
|
|
|
|
unimpl_tests.add(name)
|
2017-12-28 17:28:48 +00:00
|
|
|
elif status == 'DISABLED':
|
|
|
|
disabled_tests.add(name)
|
2017-12-18 21:23:31 +00:00
|
|
|
elif status == 'PASSED':
|
|
|
|
passed_tests.add(name)
|
|
|
|
|
2017-12-28 17:28:48 +00:00
|
|
|
if disabled_tests:
|
|
|
|
for disabled_glob in sorted(config['DisabledTests'].keys()):
|
|
|
|
tests_matching_glob = fnmatch.filter(disabled_tests, disabled_glob)
|
|
|
|
if not tests_matching_glob:
|
|
|
|
print 'DisabledTests glob', disabled_glob, 'matches no tests'
|
|
|
|
else:
|
|
|
|
print '(DisabledTests unchecked)'
|
|
|
|
|
2017-12-18 21:23:31 +00:00
|
|
|
print len(all_tests), 'total tests'
|
|
|
|
print len(passed_tests), 'passed'
|
|
|
|
print len(failing_tests), 'tests failing'
|
|
|
|
print len(unimpl_tests), 'tests not supported'
|
|
|
|
|
|
|
|
if test_error_set:
|
|
|
|
print 'unknown TestErrorMap keys', test_error_set
|
|
|
|
|