diff options
| author | Eli Schwartz <eschwartz93@gmail.com> | 2025-11-17 23:55:20 -0500 |
|---|---|---|
| committer | Eli Schwartz <eschwartz93@gmail.com> | 2025-11-17 23:58:21 -0500 |
| commit | 48c5c0a84792131da8f8d2a07c4cc8982811c1b0 (patch) | |
| tree | 9cac6f3f81a4a4e1d21ea3ccf99335f692199c8b /unittests/allplatformstests.py | |
| parent | 498e5a6b9f90c2c8cb39fc86817a848c50348a38 (diff) | |
| download | meson-48c5c0a84792131da8f8d2a07c4cc8982811c1b0.tar.gz | |
mtest: add convenience key to testlog.json for "is a failure"
This info is also available from the "result" entry, but requires
mapping result types to "would cause a failure, but isn't literally
FAIL". It comes in handy for the meson testsuite, too.
Diffstat (limited to 'unittests/allplatformstests.py')
| -rw-r--r-- | unittests/allplatformstests.py | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/unittests/allplatformstests.py b/unittests/allplatformstests.py index 557fe2a52..2dc3eacf0 100644 --- a/unittests/allplatformstests.py +++ b/unittests/allplatformstests.py @@ -895,7 +895,13 @@ class AllPlatformTests(BasePlatformTests): self._run(command) self.assertEqual(0, failure_count, 'Expected %d tests to fail.' % failure_count) except subprocess.CalledProcessError as e: - self.assertEqual(e.returncode, failure_count) + actual_fails = 0 + with open(os.path.join(self.logdir, 'testlog.json'), encoding='utf-8') as f: + for line in f: + res = json.loads(line) + if res['is_fail']: + actual_fails += 1 + self.assertEqual(actual_fails, failure_count) def test_suite_selection(self): testdir = os.path.join(self.unit_test_dir, '4 suite selection') |
