Can put external programs to test suite exe wrappers directly.

pull/1254/head
Jussi Pakkanen 8 years ago
parent 74f15263b6
commit b3d51abff2
  1. 16
      mesonbuild/interpreter.py
  2. 2
      mesontest.py
  3. 4
      test cases/unit/2 testsetups/meson.build

@ -2150,7 +2150,21 @@ requirements use the version keyword argument instead.''')
if re.fullmatch('[_a-zA-Z][_0-9a-zA-Z]*', setup_name) is None:
raise InterpreterException('Setup name may only contain alphanumeric characters.')
try:
exe_wrapper = mesonlib.stringlistify(kwargs['exe_wrapper'])
inp = kwargs.get('exe_wrapper', [])
if not isinstance(inp, list):
inp = [inp]
exe_wrapper = []
for i in inp:
if hasattr(i, 'held_object'):
i = i.held_object
if isinstance(i, str):
exe_wrapper.append(i)
elif isinstance(i, dependencies.ExternalProgram):
if not i.found():
raise InterpreterException('Tried to use non-found external executable.')
exe_wrapper += i.get_command()
else:
raise InterpreterException('Exe wrapper can only contain strings or external binaries.')
except KeyError:
exe_wrapper = None
gdb = kwargs.get('gdb', False)

@ -336,7 +336,7 @@ class TestHarness:
else:
wrap = self.options.wrapper
assert(isinstance(wrap, list))
namebase = wrap[0]
namebase = os.path.split(wrap[0])[1]
logfilename = logfile_base + '-' + namebase.replace(' ', '_') + '.txt'
jsonlogfilename = logfile_base + '-' + namebase.replace(' ', '_') + '.json'
tests = self.get_tests()

@ -1,13 +1,13 @@
project('testsetups', 'c')
vg = find_program('valgrind', required : false)
vg = find_program('valgrind')
# This is only set when running under Valgrind test setup.
env = environment()
env.set('TEST_ENV', '1')
add_test_setup('valgrind',
exe_wrapper : ['valgrind', '--error-exitcode=1', '--leak-check=full'],
exe_wrapper : [vg, '--error-exitcode=1', '--leak-check=full'],
timeout_multiplier : 100,
env : env)

Loading…
Cancel
Save