]> granicus.if.org Git - clang/commitdiff
Add --vg-arg option to clang test runner.
authorDaniel Dunbar <daniel@zuster.org>
Fri, 4 Sep 2009 02:53:50 +0000 (02:53 +0000)
committerDaniel Dunbar <daniel@zuster.org>
Fri, 4 Sep 2009 02:53:50 +0000 (02:53 +0000)
 - Passes additional argument through to valgrind.

Also, don't run valgrind with --leak-check=no by default.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@80981 91177308-0d34-0410-b5e6-96231b3b80d8

utils/test/MultiTestRunner.py
utils/test/TestRunner.py
utils/test/TestingConfig.py

index c94f114e3cb18d7818a05f6f42b31dbe777bbc5f..6e15f1cd8f3aac484d1e67635055a1e021e345b7 100755 (executable)
@@ -257,6 +257,9 @@ def main():
     group.add_option("", "--vg", dest="useValgrind",
                      help="Run tests under valgrind",
                      action="store_true", default=False)
+    group.add_option("", "--vg-arg", dest="valgrindArgs",
+                     help="Specify an extra argument for valgrind",
+                     type=str, action="append", default=[])
     group.add_option("", "--time-tests", dest="timeTests",
                      help="Track elapsed wall time for each test",
                      action="store_true", default=False)
@@ -320,6 +323,7 @@ def main():
     cfg.clang = opts.clang
     cfg.clangcc = opts.clangcc
     cfg.useValgrind = opts.useValgrind
+    cfg.valgrindArgs = opts.valgrindArgs
     cfg.useExternalShell = opts.useExternalShell
 
     # FIXME: It could be worth loading these in parallel with testing.
index 3c0c8072c21b5bf2975cddd384c16a520caeb7cc..2fdede0c0d44f1a2fdfbee9c38d55beae9a8c54b 100755 (executable)
@@ -149,9 +149,10 @@ def executeScript(cfg, script, commands, cwd):
         if cfg.useValgrind:
             # FIXME: Running valgrind on sh is overkill. We probably could just
             # run on clang with no real loss.
-            command = ['valgrind', '-q',
-                       '--tool=memcheck', '--leak-check=no', '--trace-children=yes',
-                       '--error-exitcode=123'] + command
+            valgrindArgs = ['valgrind', '-q',
+                            '--tool=memcheck', '--trace-children=yes',
+                            '--error-exitcode=123'] + cfg.valgrindArgs
+            command = valgrindArgs + command
 
     p = subprocess.Popen(command, cwd=cwd,
                          stdin=subprocess.PIPE,
index a43bd76560083355c5c4aca7dfa4fa645119b733..b611d78e14daafcb08191e10455a4bd9c0c1ff65 100644 (file)
@@ -20,6 +20,7 @@ class TestingConfig:
         self.root = None
         self.useValgrind = None
         self.useExternalShell = None
+        self.valgrindArgs = []
 
         # FIXME: These need to move into a substitutions mechanism.
         self.clang = None