Skip to content

Commit 5cf0238

Browse files
committed
feat: [tests] Add SHOW_TEST_OUTPUT to run_tests
When SHOW_TEST_OUTPUT environment variable exists then show full test output.
1 parent cde958d commit 5cf0238

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

scripts/run_tests.py

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,10 +61,19 @@ def main():
6161

6262
# run each cpp bin file
6363
for cmd in cpp_bins:
64+
msg = cmd
6465
result = subprocess.check_output([cmd])
6566
result = result.decode("utf-8").rstrip()
66-
result = result.partition('\n')[0] if len(result) else ""
67-
print(cmd + " --> " + result)
67+
68+
if "SHOW_TEST_OUTPUT" in os.environ:
69+
indent = " " * 2
70+
result = "\n".join([indent + l for l in result.splitlines()])
71+
msg += ":\n" + result + "\n"
72+
else:
73+
result = result.partition('\n')[0] if len(result) else ""
74+
msg += " --> " + result
75+
76+
print(msg)
6877
cpp_ts.parse_ts(result)
6978

7079
print("")

0 commit comments

Comments
 (0)