From 8af8eec77012b2b084215fac6908a9ee978bb21d Mon Sep 17 00:00:00 2001 From: Florian Fischer Date: Wed, 28 Aug 2019 17:39:24 +0200 Subject: don't summarize empty sets --- summarize.py | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) (limited to 'summarize.py') diff --git a/summarize.py b/summarize.py index 109c399..e467648 100755 --- a/summarize.py +++ b/summarize.py @@ -30,11 +30,18 @@ from src.util import print_status, print_debug, print_error from src.util import print_license_and_exit -def specific_summary(bench, allocators): - """Summarize bench in PWD for allocators""" +def specific_summary(bench, sum_dir, allocators): + """Summarize bench in sum_dir for allocators""" old_allocs = bench.results["allocators"] allocs_in_set = {k: v for k, v in old_allocs.items() if k in allocators} + if not allocs_in_set: + return + + # create and change to sum_dir + os.mkdir(sum_dir) + os.chdir(sum_dir) + bench.results["allocators"] = allocs_in_set # set colors @@ -55,6 +62,7 @@ def specific_summary(bench, allocators): bench.summary() bench.results["allocators"] = old_allocs + os.chdir("..") def bench_sum(bench): @@ -77,10 +85,7 @@ def bench_sum(bench): os.chdir("..") for set_name in sets: - os.mkdir(set_name) - os.chdir(set_name) - specific_summary(bench, sets[set_name]) - os.chdir("..") + specific_summary(bench, set_name, sets[set_name]) os.chdir("..") -- cgit v1.2.3