forked from Imagelibrary/littlefs
scripts: Adopted -c/--compare in make summary-diff
This showcases the sort of high-level result printing where -c/--compare
is useful:
$ make summary-diff
code data stack structs
BEFORE 57057 0 3056 1476
AFTER 68864 (+20.7%) 0 (+0.0%) 3744 (+22.5%) 1520 (+3.0%)
There was one hiccup though: how to hide the name of the first field.
It may seem minor, but the missing field name really does help
readability when you're staring at a wall of CLI output.
It's a bit of a hack, but this can now be controlled with -Y/--summary,
which has the sole purpose of disabling the first field name if mixed
with -c/--compare.
-c/--compare is already a weird case for the summary row anyways...
This commit is contained in:
@@ -537,7 +537,7 @@ def table(Result, results, diff_results=None, *,
|
||||
return entry
|
||||
|
||||
# entries
|
||||
if not summary:
|
||||
if not summary or compare:
|
||||
for name in names:
|
||||
r = table.get(name)
|
||||
if diff_results is None:
|
||||
@@ -547,7 +547,7 @@ def table(Result, results, diff_results=None, *,
|
||||
lines.append(table_entry(name, r, diff_r))
|
||||
|
||||
# total, unless we're comparing
|
||||
if summary or not (compare is not None and diff_results is None):
|
||||
if not (compare is not None and diff_results is None):
|
||||
r = next(iter(fold(Result, results, by=[])), None)
|
||||
if diff_results is None:
|
||||
diff_r = None
|
||||
|
||||
Reference in New Issue
Block a user