Removed Valgrind from core.

pull/730/head
Jussi Pakkanen 9 years ago
parent a5a4c85eca
commit 951262d759
  1. 5
      mesonbuild/backend/backends.py
  2. 15
      mesonbuild/backend/ninjabackend.py
  3. 2
      mesonbuild/coredata.py
  4. 6
      mesonbuild/environment.py
  5. 13
      mesonbuild/interpreter.py
  6. 5
      mesonbuild/scripts/meson_test.py
  7. 2
      mesontest.py

@ -50,7 +50,7 @@ class ExecutableSerialisation():
class TestSerialisation:
def __init__(self, name, suite, fname, is_cross, exe_wrapper, is_parallel, cmd_args, env,
should_fail, valgrind_args, timeout, workdir, extra_paths):
should_fail, timeout, workdir, extra_paths):
self.name = name
self.suite = suite
self.fname = fname
@ -60,7 +60,6 @@ class TestSerialisation:
self.cmd_args = cmd_args
self.env = env
self.should_fail = should_fail
self.valgrind_args = valgrind_args
self.timeout = timeout
self.workdir = workdir
self.extra_paths = extra_paths
@ -443,7 +442,7 @@ class Backend():
a = os.path.join(self.environment.get_build_dir(), a.rel_to_builddir(self.build_to_src))
cmd_args.append(a)
ts = TestSerialisation(t.get_name(), t.suite, fname, is_cross, exe_wrapper,
t.is_parallel, cmd_args, t.env, t.should_fail, t.valgrind_args,
t.is_parallel, cmd_args, t.env, t.should_fail,
t.timeout, t.workdir, extra_paths)
arr.append(ts)
pickle.dump(arr, datafile)

@ -142,7 +142,6 @@ class NinjaBackend(backends.Backend):
self.ninja_filename = 'build.ninja'
self.fortran_deps = {}
self.all_outputs = {}
self.valgrind = environment.find_valgrind()
def detect_vs_dep_prefix(self, tempfilename):
'''VS writes its dependency in a locale dependent format.
@ -728,13 +727,6 @@ int dummy;
elem.add_item('pool', 'console')
elem.write(outfile)
if self.valgrind:
velem = NinjaBuildElement(self.all_outputs, 'test-valgrind:' + s, 'CUSTOM_COMMAND', ['all', 'PHONY'])
velem.add_item('COMMAND', cmd + ['--wrapper=' + self.valgrind, '--suite=' + s])
velem.add_item('DESC', 'Running test suite %s under Valgrind.' % visible_name)
velem.add_item('pool', 'console')
velem.write(outfile)
def generate_tests(self, outfile):
(test_data, benchmark_data) = self.serialise_tests()
script_root = self.environment.get_script_dir()
@ -751,13 +743,6 @@ int dummy;
elem.write(outfile)
self.write_test_suite_targets(cmd, outfile)
if self.valgrind:
velem = NinjaBuildElement(self.all_outputs, 'test-valgrind', 'CUSTOM_COMMAND', ['all', 'PHONY'])
velem.add_item('COMMAND', cmd + ['--wrapper=' + self.valgrind])
velem.add_item('DESC', 'Running test suite under Valgrind.')
velem.add_item('pool', 'console')
velem.write(outfile)
# And then benchmarks.
cmd = [sys.executable, self.environment.get_build_command(), '--internal', 'benchmark', benchmark_data]
elem = NinjaBuildElement(self.all_outputs, 'benchmark', 'CUSTOM_COMMAND', ['all', 'PHONY'])

@ -241,8 +241,6 @@ forbidden_target_names = {'clean': None,
'all': None,
'test': None,
'test:': None,
'test-valgrind': None,
'test-valgrind:': None,
'benchmark': None,
'install': None,
'build.ninja': None,

@ -39,12 +39,6 @@ def find_coverage_tools():
genhtml_exe = None
return (gcovr_exe, lcov_exe, genhtml_exe)
def find_valgrind():
valgrind_exe = 'valgrind'
if not mesonlib.exe_exists([valgrind_exe, '--version']):
valgrind_exe = None
return valgrind_exe
def detect_ninja():
for n in ['ninja', 'ninja-build']:
try:

@ -614,7 +614,7 @@ class RunTargetHolder(InterpreterObject):
self.held_object = build.RunTarget(name, command, args, dependencies, subdir)
class Test(InterpreterObject):
def __init__(self, name, suite, exe, is_parallel, cmd_args, env, should_fail, valgrind_args, timeout, workdir):
def __init__(self, name, suite, exe, is_parallel, cmd_args, env, should_fail, timeout, workdir):
InterpreterObject.__init__(self)
self.name = name
self.suite = suite
@ -623,7 +623,6 @@ class Test(InterpreterObject):
self.cmd_args = cmd_args
self.env = env
self.should_fail = should_fail
self.valgrind_args = valgrind_args
self.timeout = timeout
self.workdir = workdir
@ -2128,12 +2127,8 @@ requirements use the version keyword argument instead.''')
if ' ' in k:
raise InterpreterException('Env var key must not have spaces in it.')
env[k] = val
valgrind_args = kwargs.get('valgrind_args', [])
if not isinstance(valgrind_args, list):
valgrind_args = [valgrind_args]
for a in valgrind_args:
if not isinstance(a, str):
raise InterpreterException('Valgrind_arg not a string.')
if not isinstance(envlist, list):
envlist = [envlist]
should_fail = kwargs.get('should_fail', False)
if not isinstance(should_fail, bool):
raise InterpreterException('Keyword argument should_fail must be a boolean.')
@ -2156,7 +2151,7 @@ requirements use the version keyword argument instead.''')
s = '.' + s
newsuite.append(self.subproject.replace(' ', '_').replace('.', '_') + s)
suite = newsuite
t = Test(args[0], suite, args[1].held_object, par, cmd_args, env, should_fail, valgrind_args, timeout, workdir)
t = Test(args[0], suite, args[1].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='')

@ -123,10 +123,7 @@ def run_single_test(wrap, test):
stde = None
returncode = -1
else:
if len(wrap) > 0 and 'valgrind' in wrap[0]:
cmd = wrap + test.valgrind_args + cmd + test.cmd_args
else:
cmd = wrap + cmd + test.cmd_args
cmd = wrap + cmd + test.cmd_args
starttime = time.time()
child_env = os.environ.copy()
if isinstance(test.env, build.EnvironmentVariables):

@ -17,7 +17,7 @@
# A tool to run tests in many different ways.
import subprocess, sys, os, argparse
import pickle, statistics, json
import pickle
from mesonbuild.scripts import meson_test
parser = argparse.ArgumentParser()

Loading…
Cancel
Save