scripts: Re-adopted result prefixes

Now that I'm looking into some higher-level scripts, being able to merge
results without first renaming everything is useful.

This gives most scripts an implicit prefix for field fields, but _not_
by fields, allowing easy merging of results from different scripts:

  $ ./scripts/stack.py lfs.ci -o-
  function,stack_frame,stack_limit
  lfs_alloc,288,1328
  lfs_alloc_discard,8,8
  lfs_alloc_findfree,16,32
  ...

At least now these have better support in scripts with the addition of
the --prefix flag (this was tricky for csv.py), which allows explicit
control over field field prefixes:

  $ ./scripts/stack.py lfs.ci -o- --prefix=
  function,frame,limit
  lfs_alloc,288,1328
  lfs_alloc_discard,8,8
  lfs_alloc_findfree,16,32
  ...

  $ ./scripts/stack.py lfs.ci -o- --prefix=wonky_
  function,wonky_frame,wonky_limit
  lfs_alloc,288,1328
  lfs_alloc_discard,8,8
  lfs_alloc_findfree,16,32
  ...
This commit is contained in:
Christopher Haster
2025-03-01 18:06:19 -06:00
parent aae03be54b
commit 9e22167a31
11 changed files with 545 additions and 332 deletions

View File

@@ -1099,8 +1099,8 @@ def run_stage(name, runner, test_ids, stdout_, trace_, output_, **args):
'suite': suite,
'case': case,
**defines,
'passed': '1/1',
'time': '%.6f' % (
'test_passed': '1/1',
'test_time': '%.6f' % (
time.time() - last_time)})
elif op == 'skipped':
locals.seen_perms += 1
@@ -1161,7 +1161,7 @@ def run_stage(name, runner, test_ids, stdout_, trace_, output_, **args):
output_.writerow({
'suite': suite,
'case': case,
'passed': '0/1',
'test_passed': '0/1',
**defines})
# race condition for multiple failures?
@@ -1297,7 +1297,8 @@ def run(runner, test_ids=[], **args):
if args.get('output'):
output = TestOutput(args['output'],
['suite', 'case'],
['passed', 'time'])
# defines go here
['test_passed', 'test_time'])
# measure runtime
start = time.time()