Skip to content

Commit c935b83

Browse files
committed
Print table header and generate tex file
1 parent de8a43d commit c935b83

1 file changed

Lines changed: 19 additions & 0 deletions

File tree

benchmarks/test.py

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,21 @@
2222
wdcli = "../WARDuino-symbolic/build-emu/wdcli"
2323

2424
def analyse_state_space():
25+
f = open("table.tex", "w")
26+
print("\\documentclass[12pt]{article}", file=f)
27+
print("\\usepackage{siunitx}", file=f)
28+
print("\\sisetup{", file=f)
29+
print("scientific-notation = true,", file=f)
30+
print("round-mode = figures,", file=f)
31+
print("round-precision = 4,", file=f)
32+
print("retain-zero-exponent = true", file=f)
33+
print("}", file=f)
34+
print("\\begin{document}", file=f)
35+
print("\\begin{tabular}{l S[table-format=1.1] r r r}", file=f)
36+
print("Program & {States} & Paths & Max opts & Time (s) \\\\", file = f)
37+
print("\\hline", file = f)
38+
39+
print("Program & States & Paths & Max opts & Time (s) \\\\")
2540
for program in programs:
2641
print(f"Running {program[0]}", end="", flush=True)
2742
command = wdcli + " " + program[0] + f" --no-socket --no-debug --mode concolic --max-instructions {program[1]} --max-symbolic-variables {program[2]} --max-iterations {program[3]}"
@@ -31,5 +46,9 @@ def analyse_state_space():
3146
process = subprocess.run([command], shell=True, check=True, capture_output=True, text=True)
3247
output_lines = process.stdout.strip().split('\n')
3348
print(f"\r{program[0].replace("/upload.wasm", "")} & {output_lines[-1]}")
49+
print(f"{program[0].replace("/upload.wasm", "")} & {output_lines[-1]}", file = f)
50+
print("\\end{tabular}", file=f)
51+
print("\\end{document}", file=f)
52+
f.close()
3453

3554
analyse_state_space()

0 commit comments

Comments
 (0)