Skip to content

Commit ae54b40

Browse files
troglobitrical
authored andcommitted
Move metadata (filename + args) to a dedicated table in the report
Note, this commit also adjusts the font size of all table text and inline code. Usually this is nothing users notice, in fact, a mono spaced font that is one point smaller than that surrounding text harmonize better. Signed-off-by: Joachim Wiberg <[email protected]>
1 parent 3b0a267 commit ae54b40

File tree

2 files changed

+30
-12
lines changed

2 files changed

+30
-12
lines changed

9pm.py

Lines changed: 22 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
import re
1212
import atexit
1313
import hashlib
14-
import textwrap
1514
from datetime import datetime
1615

1716
TEST_CNT=0
@@ -66,17 +65,7 @@ def execute(args, test, output_log):
6665
test_skip = False
6766
err = False
6867

69-
cmd = path = os.path.relpath(test['case'], ROOT_PATH)
70-
if args:
71-
cmd = f"{path} {' '.join(args)}"
72-
73-
prefix = "Starting: "
74-
wrapped = textwrap.fill(f"{prefix}{cmd}", width=100,
75-
subsequent_indent=" " * (len(prefix) +
76-
len(path) + 1),
77-
break_long_words=False,
78-
break_on_hyphens=False)
79-
output_log.write(f"{wrapped}\n\n")
68+
# Test metadata is now handled in the report generation, not in the log
8069

8170
while True:
8271
line = proc.stdout.readline().decode('utf-8')
@@ -411,6 +400,27 @@ def write_report_output(file, data, depth, is_first=True):
411400
if 'test-spec' in test:
412401
file.write("include::{}[lines=2..-1]\n" . format(test['test-spec']))
413402

403+
# Add test information table
404+
file.write("\n==== Test Information\n")
405+
file.write('[cols="1h,3"]\n')
406+
file.write("|===\n")
407+
file.write(f"| ID | `{test['uniq_id']}`\n")
408+
file.write(f"| Name | `{test['name']}`\n")
409+
410+
# Add test file path (relative to project root)
411+
if 'case' in test:
412+
rel_path = os.path.relpath(test['case'], ROOT_PATH)
413+
file.write(f"| File | `{rel_path}`\n")
414+
415+
# Add arguments if present
416+
if 'options' in test and test['options']:
417+
args_str = ', '.join(test['options'])
418+
file.write(f"| Arguments | `{args_str}`\n")
419+
else:
420+
file.write("| Arguments | `None`\n")
421+
422+
file.write("|===\n")
423+
414424
file.write("\n==== Output\n")
415425
file.write("----\n")
416426
file.write(f"include::{test['outfile']}[]\n")

report/theme.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,11 @@ code:
2121
background-color: #ffffff
2222
border-color: #ffffff
2323

24+
codespan:
25+
font-size: 9
26+
background-color: #ffffff
27+
font-color: #000000
28+
2429
heading:
2530
font-size: 14
2631
font-style: bold
@@ -38,6 +43,9 @@ role:
3843
font-color: #eab308
3944
font-style: bold
4045

46+
table:
47+
font-size: 9
48+
4149
link:
4250
font-color: #2563eb
4351
text-decoration: underline

0 commit comments

Comments
 (0)