test: always set CK_FORK=no under valgrind

Set this in the code rather than the environment variable to make it easier to
run valgrind manually.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
This commit is contained in:
Peter Hutterer 2019-05-27 14:21:53 +10:00
parent 64df646658
commit d2cce8298d
2 changed files with 1 additions and 4 deletions

View file

@ -889,8 +889,6 @@ if get_option('tests')
valgrind = find_program('valgrind', required : false)
if valgrind.found()
valgrind_env = environment()
valgrind_env.set('CK_FORK', 'no')
valgrind_suppressions_file = join_paths(dir_src_test, 'valgrind.suppressions')
add_test_setup('valgrind',
exe_wrapper : [ valgrind,
@ -898,7 +896,6 @@ if get_option('tests')
'--gen-suppressions=all',
'--error-exitcode=3',
'--suppressions=' + valgrind_suppressions_file ],
env : valgrind_env,
timeout_multiplier : 100)
else
message('valgrind not found, disabling valgrind test suite')

View file

@ -4184,7 +4184,7 @@ main(int argc, char **argv)
int rc;
in_debugger = is_debugger_attached();
if (in_debugger)
if (in_debugger || RUNNING_ON_VALGRIND)
setenv("CK_FORK", "no", 0);
mode = litest_parse_argv(argc, argv);