aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--data/test.schema.json6
-rw-r--r--docs/markdown/Contributing.md8
-rwxr-xr-xrun_project_tests.py11
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)