diff --git a/utils/lit/lit/TestFormats.py b/utils/lit/lit/TestFormats.py index d87a467559c..6ab3f9c4626 100644 --- a/utils/lit/lit/TestFormats.py +++ b/utils/lit/lit/TestFormats.py @@ -72,6 +72,14 @@ class GoogleTest(object): testName = os.path.join(namePrefix, testName) cmd = [testPath, '--gtest_filter=' + testName] + if litConfig.useValgrind: + valgrindArgs = ['valgrind', '-q', + '--tool=memcheck', '--trace-children=yes', + '--error-exitcode=123'] + valgrindArgs.extend(litConfig.valgrindArgs) + + cmd = valgrindArgs + cmd + out, err, exitCode = TestRunner.executeCommand( cmd, env=test.config.environment)