tests/run-perfbench.py: Use SKIP consistently, and increase print width.

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>
This commit is contained in:
Damien George 2022-02-11 22:19:38 +11:00
parent a434705700
commit e8bc4a3a5b
1 changed files with 4 additions and 4 deletions

View File

@ -100,7 +100,7 @@ def run_benchmarks(target, param_n, param_m, n_average, test_list):
and test_file.find("viper_") != -1 and test_file.find("viper_") != -1
) )
if skip: if skip:
print("skip") print("SKIP")
continue continue
# Create test script # Create test script
@ -171,7 +171,7 @@ def parse_output(filename):
m = int(m.split("=")[1]) m = int(m.split("=")[1])
data = [] data = []
for l in f: 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(": ") name, values = l.strip().split(": ")
values = tuple(float(v) for v in values.split()) values = tuple(float(v) for v in values.split())
data.append((name,) + values) data.append((name,) + values)
@ -193,7 +193,7 @@ def compute_diff(file1, file2, diff_score):
else: else:
hdr = "N={} M={} vs N={} M={}".format(n1, m1, n2, m2) hdr = "N={} M={} vs N={} M={}".format(n1, m1, n2, m2)
print( print(
"{:24} {:>10} -> {:>10} {:>10} {:>7}% (error%)".format( "{:26} {:>10} -> {:>10} {:>10} {:>7}% (error%)".format(
hdr, file1, file2, "diff", "diff" hdr, file1, file2, "diff", "diff"
) )
) )
@ -214,7 +214,7 @@ def compute_diff(file1, file2, diff_score):
percent = 100 * av_diff / av1 percent = 100 * av_diff / av1
percent_sd = 100 * sd_diff / av1 percent_sd = 100 * sd_diff / av1
print( 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 name, av1, av2, av_diff, percent, percent_sd
) )
) )