This repository was archived by the owner on Jul 13, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 24
Expand file tree
/
Copy pathsummarize.py
More file actions
executable file
·70 lines (65 loc) · 1.51 KB
/
summarize.py
File metadata and controls
executable file
·70 lines (65 loc) · 1.51 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
#!/usr/bin/python2.4
import os
import re
import sys
tmpdir = sys.argv[1]
print tmpdir
# Parse java output.
java_log = open(os.path.join(tmpdir, "java.log"), "r")
test_re = re.compile("===== ([^ ]+) ====")
exc_re = re.compile("Exception occured during transformation")
disable_re = re.compile("EXCL (.*)")
results = {}
tests = []
results_tsan = {}
disable_str = ""
disabled = 0
test = ""
for line in java_log:
match_exc = False
m = test_re.search(line)
if m:
test = m.group(1)
tests.append(test)
results[test] = True
results_tsan[test] = False
else:
match_exc = exc_re.search(line)
if test != "" and match_exc:
results[test] = False
if disable_re.search(line):
disable_str += line
disabled += 1
java_log.close()
# Parse offline ThreadSanitizer output.
tsan_log = open(os.path.join(tmpdir, "tsan.log"), "r")
warning_re = re.compile("WARNING:")
test = ""
for line in tsan_log:
m = test_re.search(line)
if m:
test = m.group(1)
results_tsan[test] = True
if warning_re.search(line):
results[test] = False
tsan_log.close()
# Produce test report.
passed = 0
failed = 0
for test in tests:
if results_tsan[test]:
if results[test]:
res = "PASS"
passed += 1
else:
res = "FAIL"
failed += 1
print "%s %s" % (res, test)
else:
print "TSAN didn't handle test %s" % (test)
sys.exit(1)
print disable_str
print "----"
print "passed: %d, failed: %d, excluded: %d, total: %d" % \
(passed, failed, disabled, passed + failed + disabled)
sys.exit(failed)