Add `skip_on_os` to test.json

pull/8973/head
Jon Turney 3 years ago committed by Daniel Mensinger
parent 7126fbaf81
commit a2e44296c9
  1. 6
      data/test.schema.json
  2. 8
      docs/markdown/Contributing.md
  3. 11
      run_project_tests.py

@ -147,6 +147,12 @@
"items": {
"type": "string"
}
},
"skip_on_os": {
"type": "array",
"items": {
"type": "string"
}
}
}
}

@ -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

@ -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)

Loading…
Cancel
Save