Commit 2bc9c835 authored by Stephen M. Webb's avatar Stephen M. Webb Committed by Peter Hutterer
Browse files

accommodate valgrind being a wrapper script



Some systems provide valgrind as a shell script wrapper that calls
through to the real valgrind binary.  The xorg-gtest test suite
fails on those platforms because it causes the process args to
mismatch.
Signed-off-by: default avatarStephen M. Webb <stephen.webb@canonical.com>
Signed-off-by: Peter Hutterer's avatarPeter Hutterer <peter.hutterer@who-t.net>
parent 649f4f66
......@@ -355,6 +355,15 @@ TEST_P(ProcessValgrindArgsWrapper, ValgrindWrapperWithArgs)
} while(strstr(buff, program_invocation_short_name));
const char * arg = buff + strlen(buff) + 1;
/* accommodate the case that valgrind has a shell script wrapper */
if (0 == strcmp(buff, "/bin/sh")) {
if (0 == strcmp(arg, "-e")) {
arg += strlen(arg) + 1;
}
arg += strlen(arg) + 1;
}
std::vector<std::string>::const_iterator it = valgrind_args.begin();
it++; /* first one is "valgrind" */
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment