diff options
author | Jon Turney <jon.turney@dronecode.org.uk> | 2021-06-21 15:16:51 +0100 |
---|---|---|
committer | Daniel Mensinger <daniel@mensinger-ka.de> | 2021-07-07 20:08:12 +0200 |
commit | a2e44296c9cf36ff1269ccfb427b90b5a848ee7d (patch) | |
tree | a2c5305da5f6ea31a658db997880919f70506c38 | |
parent | 7126fbaf81b4b77da36a6e0995f234bd293db663 (diff) | |
download | meson-a2e44296c9cf36ff1269ccfb427b90b5a848ee7d.zip meson-a2e44296c9cf36ff1269ccfb427b90b5a848ee7d.tar.gz meson-a2e44296c9cf36ff1269ccfb427b90b5a848ee7d.tar.bz2 |
Add `skip_on_os` to test.json
-rw-r--r-- | data/test.schema.json | 6 | ||||
-rw-r--r-- | docs/markdown/Contributing.md | 8 | ||||
-rwxr-xr-x | run_project_tests.py | 11 |
3 files changed, 25 insertions, 0 deletions
diff --git a/data/test.schema.json b/data/test.schema.json index fc84d86..1bcefea 100644 --- a/data/test.schema.json +++ b/data/test.schema.json @@ -147,6 +147,12 @@ "items": { "type": "string" } + }, + "skip_on_os": { + "type": "array", + "items": { + "type": "string" + } } } } diff --git a/docs/markdown/Contributing.md b/docs/markdown/Contributing.md index 77981d7..474f880 100644 --- a/docs/markdown/Contributing.md +++ b/docs/markdown/Contributing.md @@ -390,6 +390,14 @@ for whatever reason). The test is failed if it skips or runs unexpectedly. +#### skip_on_os + +The `skip_on_os` key can be used to specify a list of OS names (or their +negations, prefixed with a `!`). If at least one item in the `skip_on_os` list +is matched, the test is expected to be skipped. + +The test is failed if it skips or runs unexpectedly. + ### Skipping integration tests Meson uses several continuous integration testing systems that have diff --git a/run_project_tests.py b/run_project_tests.py index 73e85fa..ec356c4 100755 --- a/run_project_tests.py +++ b/run_project_tests.py @@ -779,6 +779,17 @@ def load_test_json(t: TestDef, stdout_mandatory: bool) -> T.List[TestDef]: else: skip_expected = False + # Test is expected to skip if os matches + if 'skip_on_os' in test_def: + mesonenv = environment.Environment(None, None, get_fake_options('/')) + for skip_os in test_def['skip_on_os']: + if skip_os.startswith('!'): + if mesonenv.machines.host.system != skip_os[1:]: + skip_expected = True + else: + if mesonenv.machines.host.system == skip_os: + skip_expected = True + # Skip the matrix code and just update the existing test if 'matrix' not in test_def: t.env.update(env) |