forked from pretis/flexpret
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrun-tests.py
executable file
·80 lines (72 loc) · 3.66 KB
/
run-tests.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
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
71
72
73
74
75
76
77
78
79
#!/usr/bin/env python
import subprocess
import sys
import re
baseDir = "."
# Construct command for a test.
def testCmd(loc, cycles, t, f, i, d, smul, stats, exc, gt, du, ee):
return ["make", "run",
"PROG_DIR=" + loc,
"MAX_CYCLES=" + str(cycles),
"THREADS=" + str(t),
"FLEX=" + str(f).lower(),
"ISPM_KBYTES=" + str(i),
"DSPM_KBYTES=" + str(d),
"MUL_STAGES=" + str(smul),
"STATS=" + str(stats).lower(),
"EXCEPTIONS=" + str(exc).lower(),
"GET_TIME=" + str(gt).lower(),
"DELAY_UNTIL=" + str(du).lower(),
"EXCEPTION_ON_EXPIRE=" + str(ee).lower(),
"PROG_CONFIG=emulator",
"TARGET=emulator",
"DEBUG=false"]
# Add tests.
tests = []
cycles = 100000
# Regression
# Baseline
tests.append(testCmd("asm-sodor", cycles, 1, False, 16, 16, 1, False, False, False, False, False))
tests.append(testCmd("asm-sodor", cycles, 4, False, 16, 16, 1, False, False, False, False, False))
tests.append(testCmd("asm-sodor", cycles, 8, False, 16, 16, 1, False, False, False, False, False))
tests.append(testCmd("asm-sodor", cycles, 1, False, 16, 16, 2, False, False, False, False, False))
tests.append(testCmd("asm-sodor", cycles, 4, False, 16, 16, 2, False, False, False, False, False))
tests.append(testCmd("asm-sodor", cycles, 8, False, 16, 16, 2, False, False, False, False, False))
# FlexPRET
tests.append(testCmd("asm-sodor", cycles, 4, True, 16, 16, 1, False, False, False, False, False))
tests.append(testCmd("asm-sodor", cycles, 8, True, 16, 16, 1, False, False, False, False, False))
tests.append(testCmd("asm-sodor", cycles, 4, True, 16, 16, 2, False, False, False, False, False))
tests.append(testCmd("asm-sodor", cycles, 8, True, 16, 16, 2, False, False, False, False, False))
# FlexPRET w/ gt-du
tests.append(testCmd("asm-sodor", cycles, 4, True, 16, 16, 1, False, False, True, True, False))
tests.append(testCmd("asm-sodor", cycles, 8, True, 16, 16, 1, False, False, True, True, False))
tests.append(testCmd("asm-sodor", cycles, 4, True, 16, 16, 2, False, False, True, True, False))
tests.append(testCmd("asm-sodor", cycles, 8, True, 16, 16, 2, False, False, True, True, False))
# FlexpRET w/ gt-ee
tests.append(testCmd("asm-sodor", cycles, 4, True, 16, 16, 1, False, True, True, False, True))
tests.append(testCmd("asm-sodor", cycles, 8, True, 16, 16, 1, False, True, True, False, True))
tests.append(testCmd("asm-sodor", cycles, 4, True, 16, 16, 2, False, True, True, False, True))
tests.append(testCmd("asm-sodor", cycles, 8, True, 16, 16, 2, False, True, True, False, True))
# FlexPRET w/ gt-du-ee
tests.append(testCmd("asm-sodor", cycles, 4, True, 16, 16, 1, False, True, True, True, True))
tests.append(testCmd("asm-sodor", cycles, 8, True, 16, 16, 1, False, True, True, True, True))
tests.append(testCmd("asm-sodor", cycles, 4, True, 16, 16, 2, False, True, True, True, True))
tests.append(testCmd("asm-sodor", cycles, 8, True, 16, 16, 2, False, True, True, True, True))
# Keep track of failed tests.
failedTests = []
# Execute all tests.
for test in tests:
print "********** RUNNING TEST: " + " ".join(test) + " **********"
proc = subprocess.Popen(test, cwd=baseDir, stdout=subprocess.PIPE)
for line in iter(proc.stdout.readline,""):
sys.stdout.write(line)
if re.search("\[ FAILED \]", line):
failedTests.append(line)
proc.wait()
# Print results.
if failedTests:
print "********** FAILED TESTS **********"
for failedTest in failedTests:
sys.stdout.write(failedTest)
else:
print "********** ALL TESTS PASSED **********"