diff options
author | Dylan Baker <dylan@pnwbakers.com> | 2022-12-02 11:47:11 -0800 |
---|---|---|
committer | Eli Schwartz <eschwartz93@gmail.com> | 2022-12-05 15:20:09 -0500 |
commit | 010f525cc5d632b2d7da5cf9b80a1b758841ba71 (patch) | |
tree | bf53f9ea1a6e967c11de49f5afc08f60c2b44555 /mesonbuild/interpreter/interpreter.py | |
parent | 99dfc988ebe79ff5461fc01a246916becf0c9c5c (diff) | |
download | meson-010f525cc5d632b2d7da5cf9b80a1b758841ba71.zip meson-010f525cc5d632b2d7da5cf9b80a1b758841ba71.tar.gz meson-010f525cc5d632b2d7da5cf9b80a1b758841ba71.tar.bz2 |
interpreter: move TEST_KW from interpreter.py to type_checking.py
Since it's also used in the rust module, it should be in a common place.
Also rename from `TEST_KWARGS` to `TEST_KWS`, which is more in line with
the `*_KW` naming scheme used in the type_checking module.
Diffstat (limited to 'mesonbuild/interpreter/interpreter.py')
-rw-r--r-- | mesonbuild/interpreter/interpreter.py | 24 |
1 files changed, 3 insertions, 21 deletions
diff --git a/mesonbuild/interpreter/interpreter.py b/mesonbuild/interpreter/interpreter.py index 1228caa..552f51c 100644 --- a/mesonbuild/interpreter/interpreter.py +++ b/mesonbuild/interpreter/interpreter.py @@ -83,6 +83,7 @@ from .type_checking import ( REQUIRED_KW, SOURCES_KW, VARIABLES_KW, + TEST_KWS, NoneType, in_set_validator, env_convertor_with_method @@ -223,25 +224,6 @@ known_build_target_kwargs = ( {'target_type'} ) -TEST_KWARGS: T.List[KwargInfo] = [ - KwargInfo('args', ContainerTypeInfo(list, (str, mesonlib.File, build.BuildTarget, build.CustomTarget, build.CustomTargetIndex)), - listify=True, default=[]), - KwargInfo('should_fail', bool, default=False), - KwargInfo('timeout', int, default=30), - KwargInfo('workdir', (str, NoneType), default=None, - validator=lambda x: 'must be an absolute path' if not os.path.isabs(x) else None), - KwargInfo('protocol', str, - default='exitcode', - validator=in_set_validator({'exitcode', 'tap', 'gtest', 'rust'}), - since_values={'gtest': '0.55.0', 'rust': '0.57.0'}), - KwargInfo('priority', int, default=0, since='0.52.0'), - # TODO: env needs reworks of the way the environment variable holder itself works probably - ENV_KW, - DEPENDS_KW.evolve(since='0.46.0'), - KwargInfo('suite', ContainerTypeInfo(list, str), listify=True, default=['']), # yes, a list of empty string - KwargInfo('verbose', bool, default=False, since='0.62.0'), -] - class InterpreterRuleRelaxation(Enum): ''' Defines specific relaxations of the Meson rules. @@ -2050,14 +2032,14 @@ class Interpreter(InterpreterBase, HoldableObject): return gen @typed_pos_args('benchmark', str, (build.Executable, build.Jar, ExternalProgram, mesonlib.File)) - @typed_kwargs('benchmark', *TEST_KWARGS) + @typed_kwargs('benchmark', *TEST_KWS) def func_benchmark(self, node: mparser.BaseNode, args: T.Tuple[str, T.Union[build.Executable, build.Jar, ExternalProgram, mesonlib.File]], kwargs: 'kwtypes.FuncBenchmark') -> None: self.add_test(node, args, kwargs, False) @typed_pos_args('test', str, (build.Executable, build.Jar, ExternalProgram, mesonlib.File)) - @typed_kwargs('test', *TEST_KWARGS, KwargInfo('is_parallel', bool, default=True)) + @typed_kwargs('test', *TEST_KWS, KwargInfo('is_parallel', bool, default=True)) def func_test(self, node: mparser.BaseNode, args: T.Tuple[str, T.Union[build.Executable, build.Jar, ExternalProgram, mesonlib.File]], kwargs: 'kwtypes.FuncTest') -> None: |