From: "Stephen M. Webb" <[email protected]> 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: Stephen M. Webb <[email protected]> --- test/process-test.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/test/process-test.cpp b/test/process-test.cpp index 3446fe1..0c788fa 100644 --- a/test/process-test.cpp +++ b/test/process-test.cpp @@ -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" */ -- 1.7.10.4 _______________________________________________ [email protected]: X.Org development Archives: http://lists.x.org/archives/xorg-devel Info: http://lists.x.org/mailman/listinfo/xorg-devel
