Skip to content

Commit

Permalink
tests/run-perfbench.py: Use SKIP consistently, and increase print width.
Browse files Browse the repository at this point in the history
A script will print "SKIP" if it wants to be skipped, so the test runner
must also use uppercase SKIP.

Signed-off-by: Damien George <damien@micropython.org>
  • Loading branch information
dpgeorge committed Feb 11, 2022
1 parent a434705 commit e8bc4a3
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions tests/run-perfbench.py
Expand Up @@ -100,7 +100,7 @@ def run_benchmarks(target, param_n, param_m, n_average, test_list):
and test_file.find("viper_") != -1
)
if skip:
print("skip")
print("SKIP")
continue

# Create test script
Expand Down Expand Up @@ -171,7 +171,7 @@ def parse_output(filename):
m = int(m.split("=")[1])
data = []
for l in f:
if l.find(": ") != -1 and l.find(": skip") == -1 and l.find("CRASH: ") == -1:
if l.find(": ") != -1 and l.find(": SKIP") == -1 and l.find("CRASH: ") == -1:
name, values = l.strip().split(": ")
values = tuple(float(v) for v in values.split())
data.append((name,) + values)
Expand All @@ -193,7 +193,7 @@ def compute_diff(file1, file2, diff_score):
else:
hdr = "N={} M={} vs N={} M={}".format(n1, m1, n2, m2)
print(
"{:24} {:>10} -> {:>10} {:>10} {:>7}% (error%)".format(
"{:26} {:>10} -> {:>10} {:>10} {:>7}% (error%)".format(
hdr, file1, file2, "diff", "diff"
)
)
Expand All @@ -214,7 +214,7 @@ def compute_diff(file1, file2, diff_score):
percent = 100 * av_diff / av1
percent_sd = 100 * sd_diff / av1
print(
"{:24} {:10.2f} -> {:10.2f} : {:+10.2f} = {:+7.3f}% (+/-{:.2f}%)".format(
"{:26} {:10.2f} -> {:10.2f} : {:+10.2f} = {:+7.3f}% (+/-{:.2f}%)".format(
name, av1, av2, av_diff, percent, percent_sd
)
)
Expand Down

0 comments on commit e8bc4a3

Please sign in to comment.