diff options
Diffstat (limited to 'mesonbuild/interpreter.py')
-rw-r--r-- | mesonbuild/interpreter.py | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/mesonbuild/interpreter.py b/mesonbuild/interpreter.py index 5f69e22..03910b2 100644 --- a/mesonbuild/interpreter.py +++ b/mesonbuild/interpreter.py @@ -900,7 +900,8 @@ class Test(InterpreterObject): def __init__(self, name: str, project: str, suite: List[str], exe: build.Executable, depends: List[Union[build.CustomTarget, build.BuildTarget]], is_parallel: bool, cmd_args: List[str], env: build.EnvironmentVariables, - should_fail: bool, timeout: int, workdir: Optional[str], protocol: str): + should_fail: bool, timeout: int, workdir: Optional[str], protocol: str, + priority: int): InterpreterObject.__init__(self) self.name = name self.suite = suite @@ -914,6 +915,7 @@ class Test(InterpreterObject): self.timeout = timeout self.workdir = workdir self.protocol = protocol + self.priority = priority def get_exe(self): return self.exe @@ -2044,7 +2046,7 @@ permitted_kwargs = {'add_global_arguments': {'language', 'native'}, 'subdir': {'if_found'}, 'subproject': {'version', 'default_options', 'required'}, 'test': {'args', 'depends', 'env', 'is_parallel', 'should_fail', 'timeout', 'workdir', - 'suite', 'protocol'}, + 'suite', 'protocol', 'priority'}, 'vcs_tag': {'input', 'output', 'fallback', 'command', 'replace_string'}, } @@ -3383,6 +3385,7 @@ This will become a hard error in the future.''' % kwargs['input'], location=self self.add_test(node, args, kwargs, False) @FeatureNewKwargs('test', '0.46.0', ['depends']) + @FeatureNewKwargs('test', '0.52.0', ['priority']) @permittedKwargs(permitted_kwargs['test']) def func_test(self, node, args, kwargs): self.add_test(node, args, kwargs, True) @@ -3453,8 +3456,11 @@ This will become a hard error in the future.''' % kwargs['input'], location=self for dep in depends: if not isinstance(dep, (build.CustomTarget, build.BuildTarget)): raise InterpreterException('Depends items must be build targets.') + priority = kwargs.get('priority', 0) + if not isinstance(priority, int): + raise InterpreterException('Keyword argument priority must be an integer.') t = Test(args[0], prj, suite, exe.held_object, depends, par, cmd_args, - env, should_fail, timeout, workdir, protocol) + env, should_fail, timeout, workdir, protocol, priority) if is_base_test: self.build.tests.append(t) mlog.debug('Adding test', mlog.bold(args[0], True)) |