aboutsummaryrefslogtreecommitdiff
path: root/run_single_test.py
diff options
context:
space:
mode:
Diffstat (limited to 'run_single_test.py')
-rwxr-xr-xrun_single_test.py20
1 files changed, 18 insertions, 2 deletions
diff --git a/run_single_test.py b/run_single_test.py
index 031c306..24ffd41 100755
--- a/run_single_test.py
+++ b/run_single_test.py
@@ -13,7 +13,7 @@ import pathlib
import typing as T
from mesonbuild import mlog
-from run_project_tests import TestDef, load_test_json, run_test, BuildStep
+from run_project_tests import TestDef, load_test_json, run_test, BuildStep, test_emits_skip_msg
from run_project_tests import setup_commands, detect_system_compiler, print_tool_versions
if T.TYPE_CHECKING:
@@ -59,7 +59,21 @@ def main() -> None:
results = [run_test(t, t.args, should_fail(t.path), args.use_tmpdir) for t in tests]
failed = False
for test, result in zip(tests, results):
- if (result is None) or ('MESON_SKIP_TEST' in result.stdo):
+ if result is None:
+ is_skipped = True
+ skip_reason = 'not run because preconditions were not met'
+ else:
+ for l in result.stdo.splitlines():
+ if test_emits_skip_msg(l):
+ is_skipped = True
+ offset = l.index('MESON_SKIP_TEST') + 16
+ skip_reason = l[offset:].strip()
+ break
+ else:
+ is_skipped = False
+ skip_reason = ''
+
+ if is_skipped:
msg = mlog.yellow('SKIP:')
elif result.msg:
msg = mlog.red('FAIL:')
@@ -67,6 +81,8 @@ def main() -> None:
else:
msg = mlog.green('PASS:')
mlog.log(msg, *test.display_name())
+ if skip_reason:
+ mlog.log(mlog.bold('Reason:'), skip_reason)
if result is not None and result.msg and 'MESON_SKIP_TEST' not in result.stdo:
mlog.log('reason:', result.msg)
if result.step is BuildStep.configure: