-
Notifications
You must be signed in to change notification settings - Fork 0
/
crashesat_timed.py
36 lines (28 loc) · 1.03 KB
/
crashesat_timed.py
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
#!/usr/bin/env python
import os
import timedRun
def filecontains(f, s):
for line in f:
if line.find(s) != -1:
return True
return False
def interesting(args, tempPrefix):
timeout = int(args[0])
desiredCrashSignature = args[1]
runinfo = timedRun.timed_run(args[2:], timeout, tempPrefix)
timeString = " (%.3f seconds)" % runinfo.elapsedtime
crashLogName = tempPrefix + "-crash"
if runinfo.sta == timedRun.CRASHED:
if os.path.exists(crashLogName):
if filecontains(file(crashLogName), desiredCrashSignature):
print "[CrashesAt] It crashed in " + desiredCrashSignature + " :)" + timeString
return True
else:
print "[CrashesAt] It crashed somewhere else!" + timeString
return False
else:
print "[CrashesAt] It appeared to crash, but no crash log was found?" + timeString
return False
else:
print "[CrashesAt] It didn't crash." + timeString
return False