mirror of
https://github.com/u-boot/u-boot.git
synced 2025-04-26 07:17:10 +00:00
test/py: pytest.mark.notbuildconfigspec()
We already can let a Python test depend on a build option being set via @pytest.mark.buildconfigspec(). It may be necessary to let a test depend on a build option *not* being set. So let's introduce @pytest.mark.notbuildconfigspec for this purpose. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
This commit is contained in:
parent
f95b8a4b5f
commit
10feb30c70
2 changed files with 10 additions and 5 deletions
|
@ -310,6 +310,7 @@ instances of:
|
||||||
|
|
||||||
- `buildconfig.get(...`
|
- `buildconfig.get(...`
|
||||||
- `@pytest.mark.buildconfigspec(...`
|
- `@pytest.mark.buildconfigspec(...`
|
||||||
|
- `@pytest.mark.notbuildconfigspec(...`
|
||||||
|
|
||||||
### Complete invocation example
|
### Complete invocation example
|
||||||
|
|
||||||
|
|
|
@ -460,11 +460,15 @@ def setup_buildconfigspec(item):
|
||||||
"""
|
"""
|
||||||
|
|
||||||
mark = item.get_marker('buildconfigspec')
|
mark = item.get_marker('buildconfigspec')
|
||||||
if not mark:
|
if mark:
|
||||||
return
|
for option in mark.args:
|
||||||
for option in mark.args:
|
if not ubconfig.buildconfig.get('config_' + option.lower(), None):
|
||||||
if not ubconfig.buildconfig.get('config_' + option.lower(), None):
|
pytest.skip('.config feature "%s" not enabled' % option.lower())
|
||||||
pytest.skip('.config feature "%s" not enabled' % option.lower())
|
notmark = item.get_marker('notbuildconfigspec')
|
||||||
|
if notmark:
|
||||||
|
for option in notmark.args:
|
||||||
|
if ubconfig.buildconfig.get('config_' + option.lower(), None):
|
||||||
|
pytest.skip('.config feature "%s" enabled' % option.lower())
|
||||||
|
|
||||||
def tool_is_in_path(tool):
|
def tool_is_in_path(tool):
|
||||||
for path in os.environ["PATH"].split(os.pathsep):
|
for path in os.environ["PATH"].split(os.pathsep):
|
||||||
|
|
Loading…
Add table
Reference in a new issue