[cfe-commits] r77424 - in /cfe/trunk/utils/test: MultiTestRunner.py TestRunner.py

Daniel Dunbar daniel at zuster.org
Tue Jul 28 19:57:25 PDT 2009


Author: ddunbar
Date: Tue Jul 28 21:57:25 2009
New Revision: 77424

URL: http://llvm.org/viewvc/llvm-project?rev=77424&view=rev
Log:
MultiTestRunner: Reenable --vg option.
 - Simplified from before and using --error-exitcode so failures show up as
   failures.

Modified:
    cfe/trunk/utils/test/MultiTestRunner.py
    cfe/trunk/utils/test/TestRunner.py

Modified: cfe/trunk/utils/test/MultiTestRunner.py
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/utils/test/MultiTestRunner.py?rev=77424&r1=77423&r2=77424&view=diff

==============================================================================
--- cfe/trunk/utils/test/MultiTestRunner.py (original)
+++ cfe/trunk/utils/test/MultiTestRunner.py Tue Jul 28 21:57:25 2009
@@ -9,6 +9,10 @@
  - Use a timeout / ulimit
  - Detect signaled failures (abort)
  - Better support for finding tests
+
+ - Support "disabling" tests? The advantage of making this distinct from XFAIL
+   is it makes it more obvious that it is a temporary measure (and MTR can put
+   in a separate category).
 """
 
 # TOD
@@ -157,7 +161,8 @@
             else:
                 startTime = time.time()
                 code, output = TestRunner.runOneTest(path, base, 
-                                                     opts.clang, opts.clangcc)
+                                                     opts.clang, opts.clangcc,
+                                                     opts.useValgrind)
                 elapsed = time.time() - startTime
         except KeyboardInterrupt:
             # This is a sad hack. Unfortunately subprocess goes
@@ -242,9 +247,6 @@
 
     if not args:
         parser.error('No inputs specified')
-    if opts.useValgrind:
-        parser.error('Support for running with valgrind is '
-                     'temporarily disabled')
 
     # FIXME: Move into configuration object.
     TestRunner.kChildEnv["PATH"] = os.pathsep.join(opts.path + 

Modified: cfe/trunk/utils/test/TestRunner.py
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/utils/test/TestRunner.py?rev=77424&r1=77423&r2=77424&view=diff

==============================================================================
--- cfe/trunk/utils/test/TestRunner.py (original)
+++ cfe/trunk/utils/test/TestRunner.py Tue Jul 28 21:57:25 2009
@@ -57,7 +57,7 @@
             if e.errno != errno.EEXIST:
                 raise
 
-def executeScript(script, commands, cwd):
+def executeScript(script, commands, cwd, useValgrind):
     # Write script file
     f = open(script,'w')
     if kSystemName == 'Windows':
@@ -71,6 +71,12 @@
         command = ['cmd','/c', script]
     else:
         command = ['/bin/sh', script]
+        if useValgrind:
+            # FIXME: Running valgrind on sh is overkill. We probably could just
+            # ron on clang with no real loss.
+            command = ['valgrind', '-q',
+                       '--tool=memcheck', '--leak-check=no', '--trace-children=yes',
+                       '--error-exitcode=123'] + command
 
     p = subprocess.Popen(command, cwd=cwd,
                          stdin=subprocess.PIPE,
@@ -87,7 +93,7 @@
     return out, err, exitCode
 
 import StringIO
-def runOneTest(testPath, tmpBase, clang, clangcc):
+def runOneTest(testPath, tmpBase, clang, clangcc, useValgrind):
     # Make paths absolute.
     tmpBase = os.path.abspath(tmpBase)
     testPath = os.path.abspath(testPath)
@@ -149,7 +155,8 @@
         scriptLines[i] = ln[:-2]
 
     out, err, exitCode = executeScript(script, scriptLines, 
-                                       cwd=os.path.dirname(testPath))
+                                       os.path.dirname(testPath),
+                                       useValgrind)
     if xfailLines:
         ok = exitCode != 0
         status = (TestStatus.XPass, TestStatus.XFail)[ok]





More information about the cfe-commits mailing list