|
|
@ -697,12 +697,14 @@ class RunTargetHolder(InterpreterObject, ObjectHolder): |
|
|
|
return r.format(self.__class__.__name__, h.get_id(), h.command) |
|
|
|
return r.format(self.__class__.__name__, h.get_id(), h.command) |
|
|
|
|
|
|
|
|
|
|
|
class Test(InterpreterObject): |
|
|
|
class Test(InterpreterObject): |
|
|
|
def __init__(self, name, project, suite, exe, is_parallel, cmd_args, env, should_fail, timeout, workdir): |
|
|
|
def __init__(self, name, project, suite, exe, depends, is_parallel, |
|
|
|
|
|
|
|
cmd_args, env, should_fail, timeout, workdir): |
|
|
|
InterpreterObject.__init__(self) |
|
|
|
InterpreterObject.__init__(self) |
|
|
|
self.name = name |
|
|
|
self.name = name |
|
|
|
self.suite = suite |
|
|
|
self.suite = suite |
|
|
|
self.project_name = project |
|
|
|
self.project_name = project |
|
|
|
self.exe = exe |
|
|
|
self.exe = exe |
|
|
|
|
|
|
|
self.depends = depends |
|
|
|
self.is_parallel = is_parallel |
|
|
|
self.is_parallel = is_parallel |
|
|
|
self.cmd_args = cmd_args |
|
|
|
self.cmd_args = cmd_args |
|
|
|
self.env = env |
|
|
|
self.env = env |
|
|
@ -1555,7 +1557,7 @@ permitted_kwargs = {'add_global_arguments': {'language'}, |
|
|
|
'library': known_library_kwargs, |
|
|
|
'library': known_library_kwargs, |
|
|
|
'subdir': {'if_found'}, |
|
|
|
'subdir': {'if_found'}, |
|
|
|
'subproject': {'version', 'default_options'}, |
|
|
|
'subproject': {'version', 'default_options'}, |
|
|
|
'test': {'args', 'env', 'is_parallel', 'should_fail', 'timeout', 'workdir', 'suite'}, |
|
|
|
'test': {'args', 'depends', 'env', 'is_parallel', 'should_fail', 'timeout', 'workdir', 'suite'}, |
|
|
|
'vcs_tag': {'input', 'output', 'fallback', 'command', 'replace_string'}, |
|
|
|
'vcs_tag': {'input', 'output', 'fallback', 'command', 'replace_string'}, |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -2734,7 +2736,7 @@ root and issuing %s. |
|
|
|
if 'command' not in kwargs: |
|
|
|
if 'command' not in kwargs: |
|
|
|
raise InterpreterException('Missing "command" keyword argument') |
|
|
|
raise InterpreterException('Missing "command" keyword argument') |
|
|
|
all_args = extract_as_list(kwargs, 'command') |
|
|
|
all_args = extract_as_list(kwargs, 'command') |
|
|
|
deps = extract_as_list(kwargs, 'depends') |
|
|
|
deps = extract_as_list(kwargs, 'depends', unholder=True) |
|
|
|
else: |
|
|
|
else: |
|
|
|
raise InterpreterException('Run_target needs at least one positional argument.') |
|
|
|
raise InterpreterException('Run_target needs at least one positional argument.') |
|
|
|
|
|
|
|
|
|
|
@ -2749,10 +2751,6 @@ root and issuing %s. |
|
|
|
raise InterpreterException('First argument must be a string.') |
|
|
|
raise InterpreterException('First argument must be a string.') |
|
|
|
cleaned_deps = [] |
|
|
|
cleaned_deps = [] |
|
|
|
for d in deps: |
|
|
|
for d in deps: |
|
|
|
try: |
|
|
|
|
|
|
|
d = d.held_object |
|
|
|
|
|
|
|
except AttributeError: |
|
|
|
|
|
|
|
pass |
|
|
|
|
|
|
|
if not isinstance(d, (build.BuildTarget, build.CustomTarget)): |
|
|
|
if not isinstance(d, (build.BuildTarget, build.CustomTarget)): |
|
|
|
raise InterpreterException('Depends items must be build targets.') |
|
|
|
raise InterpreterException('Depends items must be build targets.') |
|
|
|
cleaned_deps.append(d) |
|
|
|
cleaned_deps.append(d) |
|
|
@ -2835,7 +2833,12 @@ root and issuing %s. |
|
|
|
if len(s) > 0: |
|
|
|
if len(s) > 0: |
|
|
|
s = ':' + s |
|
|
|
s = ':' + s |
|
|
|
suite.append(prj.replace(' ', '_').replace(':', '_') + s) |
|
|
|
suite.append(prj.replace(' ', '_').replace(':', '_') + s) |
|
|
|
t = Test(args[0], prj, suite, exe.held_object, par, cmd_args, env, should_fail, timeout, workdir) |
|
|
|
depends = extract_as_list(kwargs, 'depends', unholder=True) |
|
|
|
|
|
|
|
for dep in depends: |
|
|
|
|
|
|
|
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) |
|
|
|
if is_base_test: |
|
|
|
if is_base_test: |
|
|
|
self.build.tests.append(t) |
|
|
|
self.build.tests.append(t) |
|
|
|
mlog.debug('Adding test "', mlog.bold(args[0]), '".', sep='') |
|
|
|
mlog.debug('Adding test "', mlog.bold(args[0]), '".', sep='') |
|
|
@ -3152,11 +3155,9 @@ different subdirectory. |
|
|
|
if ":" not in setup_name: |
|
|
|
if ":" not in setup_name: |
|
|
|
setup_name = (self.subproject if self.subproject else self.build.project_name) + ":" + setup_name |
|
|
|
setup_name = (self.subproject if self.subproject else self.build.project_name) + ":" + setup_name |
|
|
|
try: |
|
|
|
try: |
|
|
|
inp = extract_as_list(kwargs, 'exe_wrapper') |
|
|
|
inp = extract_as_list(kwargs, 'exe_wrapper', unholder=True) |
|
|
|
exe_wrapper = [] |
|
|
|
exe_wrapper = [] |
|
|
|
for i in inp: |
|
|
|
for i in inp: |
|
|
|
if hasattr(i, 'held_object'): |
|
|
|
|
|
|
|
i = i.held_object |
|
|
|
|
|
|
|
if isinstance(i, str): |
|
|
|
if isinstance(i, str): |
|
|
|
exe_wrapper.append(i) |
|
|
|
exe_wrapper.append(i) |
|
|
|
elif isinstance(i, dependencies.ExternalProgram): |
|
|
|
elif isinstance(i, dependencies.ExternalProgram): |
|
|
|