-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathsmartpulseLog.py
More file actions
48 lines (40 loc) · 1.23 KB
/
smartpulseLog.py
File metadata and controls
48 lines (40 loc) · 1.23 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
import sys
import re
f = open(sys.argv[1], 'r')
lines = f.readlines()
provedPattern = re.compile('Verified \d+ out of \d+ properties')
solPattern = re.compile('(\S+)\.sol')
propPattern = re.compile("Property (\S+) (\S+) -- (\S*)\s*s")
timePattern = re.compile("[0-9\.]+")
times = open('times.csv', 'w')
statuses = open('statuses.csv', 'w')
timeLine = ""
statusLine = ""
for i in range(0, len(lines)):
line = lines[i]
m = solPattern.match(line)
if(m):
timeLine += m.group(1)
statusLine += m.group(1)
m = propPattern.match(line)
if(m):
if(m.group(2) == "verified"):
statusLine += ",v"
timeLine += "," + m.group(3)
elif(m.group(2) == "counterexample"):
statusLine += ",c"
timeLine += "," + m.group(3)
elif(m.group(2) == "timed-out"):
statusLine += ",t"
timeLine += ",timeout"
elif(m.group(2) == "exception"):
statusLine += ",e"
timeLine += ",error"
else:
statusLine += ",u"
timeLine += ",unknown"
if(provedPattern.match(line)):
times.write(timeLine + '\n')
statuses.write(statusLine + '\n')
statusLine = ""
timeLine = ""