Include project name in a test object.

pull/2311/head
Hemmo Nieminen 7 years ago
parent abcaf7c222
commit 4611097654
  1. 11
      mesonbuild/backend/backends.py
  2. 11
      mesonbuild/interpreter.py

@ -65,9 +65,10 @@ class ExecutableSerialisation:
self.capture = capture
class TestSerialisation:
def __init__(self, name, suite, fname, is_cross_built, exe_wrapper, is_parallel, cmd_args, env,
should_fail, timeout, workdir, extra_paths):
def __init__(self, name, project, suite, fname, is_cross_built, exe_wrapper, is_parallel,
cmd_args, env, should_fail, timeout, workdir, extra_paths):
self.name = name
self.project_name = project
self.suite = suite
self.fname = fname
self.is_cross_built = is_cross_built
@ -603,9 +604,9 @@ class Backend:
cmd_args.append(self.get_target_filename(a))
else:
raise MesonException('Bad object in test command.')
ts = TestSerialisation(t.get_name(), t.suite, cmd, is_cross, exe_wrapper,
t.is_parallel, cmd_args, t.env, t.should_fail,
t.timeout, t.workdir, extra_paths)
ts = TestSerialisation(t.get_name(), t.project_name, t.suite, cmd, is_cross,
exe_wrapper, t.is_parallel, cmd_args, t.env,
t.should_fail, t.timeout, t.workdir, extra_paths)
arr.append(ts)
pickle.dump(arr, datafile)

@ -653,10 +653,11 @@ class RunTargetHolder(InterpreterObject, ObjectHolder):
return r.format(self.__class__.__name__, h.get_id(), h.command)
class Test(InterpreterObject):
def __init__(self, name, suite, exe, is_parallel, cmd_args, env, should_fail, timeout, workdir):
def __init__(self, name, project, suite, exe, is_parallel, cmd_args, env, should_fail, timeout, workdir):
InterpreterObject.__init__(self)
self.name = name
self.suite = suite
self.project_name = project
self.exe = exe
self.is_parallel = is_parallel
self.cmd_args = cmd_args
@ -2586,14 +2587,12 @@ root and issuing %s.
if not isinstance(timeout, int):
raise InterpreterException('Timeout must be an integer.')
suite = []
prj = self.subproject if self.is_subproject() else self.build.project_name
for s in mesonlib.stringlistify(kwargs.get('suite', '')):
if len(s) > 0:
s = ':' + s
if self.is_subproject():
suite.append(self.subproject.replace(' ', '_').replace(':', '_') + s)
else:
suite.append(self.build.project_name.replace(' ', '_').replace(':', '_') + s)
t = Test(args[0], suite, exe.held_object, par, cmd_args, env, should_fail, timeout, workdir)
suite.append(prj.replace(' ', '_').replace(':', '_') + s)
t = Test(args[0], prj, suite, exe.held_object, par, cmd_args, env, should_fail, timeout, workdir)
if is_base_test:
self.build.tests.append(t)
mlog.debug('Adding test "', mlog.bold(args[0]), '".', sep='')

Loading…
Cancel
Save