Skip to content

Commit 12d254f

Browse files
committed
Improve logging of test operations and results
1 parent 9804aca commit 12d254f

File tree

3 files changed

+13
-3
lines changed

3 files changed

+13
-3
lines changed

.vscode/settings.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
11
{
2-
"ada.projectFile": "gnat/lsp_server.gpr"
2+
"ada.projectFile": "gnat/lsp_server.gpr",
3+
"python.analysis.extraPaths": [
4+
"testsuite"
5+
]
36
}

testsuite/drivers/__init__.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,12 @@ def run_and_log(self, cmd, **kwargs):
8989
'status': process.status,
9090
'output': Log(process.out)})
9191

92+
cwd = kwargs.get("cwd", os.getcwd())
93+
self.result.log += f"Run: cd {cwd}; {process.command_line_image()}\n"
94+
self.result.log += f"Status code: {process.status}\n"
95+
self.result.log += "Output:\n"
96+
self.result.log += process.out
97+
9298
if self.result.out is None:
9399
self.result.out = process.out
94100
else:

testsuite/run-tests

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
#!/usr/bin/env python
22
import testsuite
33
import os
4-
import yaml
54
import sys
65

76
if __name__ == '__main__':
@@ -16,7 +15,9 @@ if __name__ == '__main__':
1615
if status not in ('PASS', 'XFAIL'):
1716
all_ok = False
1817
print("--- {} : {} ---".format(k, status))
19-
print(entry.load().out)
18+
test_result = entry.load()
19+
print(f"Output:\n{test_result.out}")
20+
print(f"Log:\n{test_result.log}")
2021

2122
if all_ok:
2223
print("SUCCESS")

0 commit comments

Comments
 (0)