Skip to content

Commit 5ebb449

Browse files
committed
Include relative path to test: "Starting test foo (path/to/bar.sh)"
Add helpful relative path to test output for test developers in addition to the human (mgmt) friendly text. Also, use f-string for "Skip test" => shorter and mroe readable code. Running suite Suite Skip Starting test suite_skip.tcl (unit_tests/harness/suite_skip.tcl) 2025-09-14 06:29:47 1..1 2025-09-14 06:29:47 ok 1 # skip suite Required argument "require-value-foo" != "foo" Starting test suite_skip.tcl (unit_tests/harness/suite_skip.tcl) Skip test suite_skip.tcl (suite skip) Test skip is masked in suite Signed-off-by: Joachim Wiberg <[email protected]>
1 parent 366d32e commit 5ebb449

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

9pm.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -151,10 +151,12 @@ def run_test(args, test):
151151
if 'options' in test:
152152
opts.extend(test['options'])
153153

154-
print(pcolor.blue + "\nStarting test", test['name'] + pcolor.reset)
154+
name = test['name']
155+
path = os.path.relpath(test['case'], ROOT_PATH)
156+
print(f"\n{pcolor.blue}Starting test {name} ({path}){pcolor.reset}")
155157

156158
if test['result'] == "skip":
157-
print("{}Skip test {} (suite skip){}" . format(pcolor.yellow, test['name'], pcolor.reset))
159+
print(f"{pcolor.yellow}Skip test {name} (suite skip){pcolor.reset}")
158160
# Delete outfile as this test won't have any output
159161
if 'outfile' in test:
160162
del test['outfile']

0 commit comments

Comments
 (0)