diff options
author | Jussi Pakkanen <jpakkane@gmail.com> | 2019-03-03 14:02:16 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-03-03 14:02:16 +0200 |
commit | 1997ac2478c600336e89b2deb5e75ae02bef0fd3 (patch) | |
tree | e13d42ae10a47a0358cfc3765d9717c488872536 /mesonbuild/interpreter.py | |
parent | 5a22bb79016c5e7fe386c9cf035c8c3517e883f8 (diff) | |
parent | 91f847d308b57adec89245308b60ae063026b456 (diff) | |
download | meson-1997ac2478c600336e89b2deb5e75ae02bef0fd3.zip meson-1997ac2478c600336e89b2deb5e75ae02bef0fd3.tar.gz meson-1997ac2478c600336e89b2deb5e75ae02bef0fd3.tar.bz2 |
Merge pull request #4958 from bonzini/tap
Add initial TAP test support
Diffstat (limited to 'mesonbuild/interpreter.py')
-rw-r--r-- | mesonbuild/interpreter.py | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/mesonbuild/interpreter.py b/mesonbuild/interpreter.py index 5f19bc5..8bde727 100644 --- a/mesonbuild/interpreter.py +++ b/mesonbuild/interpreter.py @@ -850,7 +850,7 @@ class RunTargetHolder(InterpreterObject, ObjectHolder): class Test(InterpreterObject): def __init__(self, name, project, suite, exe, depends, is_parallel, - cmd_args, env, should_fail, timeout, workdir): + cmd_args, env, should_fail, timeout, workdir, protocol): InterpreterObject.__init__(self) self.name = name self.suite = suite @@ -863,6 +863,7 @@ class Test(InterpreterObject): self.should_fail = should_fail self.timeout = timeout self.workdir = workdir + self.protocol = protocol def get_exe(self): return self.exe @@ -1973,7 +1974,8 @@ permitted_kwargs = {'add_global_arguments': {'language', 'native'}, 'library': known_library_kwargs, 'subdir': {'if_found'}, 'subproject': {'version', 'default_options', 'required'}, - 'test': {'args', 'depends', 'env', 'is_parallel', 'should_fail', 'timeout', 'workdir', 'suite'}, + 'test': {'args', 'depends', 'env', 'is_parallel', 'should_fail', 'timeout', 'workdir', + 'suite', 'protocol'}, 'vcs_tag': {'input', 'output', 'fallback', 'command', 'replace_string'}, } @@ -3269,6 +3271,9 @@ This will become a hard error in the future.''' % kwargs['input'], location=self workdir = None if not isinstance(timeout, int): raise InterpreterException('Timeout must be an integer.') + protocol = kwargs.get('protocol', 'exitcode') + if protocol not in ('exitcode', 'tap'): + raise InterpreterException('Protocol must be "exitcode" or "tap".') suite = [] prj = self.subproject if self.is_subproject() else self.build.project_name for s in mesonlib.stringlistify(kwargs.get('suite', '')): @@ -3280,7 +3285,7 @@ This will become a hard error in the future.''' % kwargs['input'], location=self if not isinstance(dep, (build.CustomTarget, build.BuildTarget)): raise InterpreterException('Depends items must be build targets.') t = Test(args[0], prj, suite, exe.held_object, depends, par, cmd_args, - env, should_fail, timeout, workdir) + env, should_fail, timeout, workdir, protocol) if is_base_test: self.build.tests.append(t) mlog.debug('Adding test', mlog.bold(args[0], True)) |