diff options
| author | Daniel Dunbar <daniel@zuster.org> | 2009-07-29 02:57:25 +0000 | 
|---|---|---|
| committer | Daniel Dunbar <daniel@zuster.org> | 2009-07-29 02:57:25 +0000 | 
| commit | 1cb8d81b41dc1ce3b270cd470fd9926646ae6438 (patch) | |
| tree | 86783b6d35ba3ce27fb8af8fcd957ebce075a0a4 /clang/utils | |
| parent | 13796e3b95ff13bfcca5d43db0af7b9b7831308d (diff) | |
| download | bcm5719-llvm-1cb8d81b41dc1ce3b270cd470fd9926646ae6438.tar.gz bcm5719-llvm-1cb8d81b41dc1ce3b270cd470fd9926646ae6438.zip  | |
MultiTestRunner: Reenable --vg option.
 - Simplified from before and using --error-exitcode so failures show up as
   failures.
llvm-svn: 77424
Diffstat (limited to 'clang/utils')
| -rwxr-xr-x | clang/utils/test/MultiTestRunner.py | 10 | ||||
| -rwxr-xr-x | clang/utils/test/TestRunner.py | 13 | 
2 files changed, 16 insertions, 7 deletions
diff --git a/clang/utils/test/MultiTestRunner.py b/clang/utils/test/MultiTestRunner.py index 8b48d8d6c75..3ac40e15c13 100755 --- a/clang/utils/test/MultiTestRunner.py +++ b/clang/utils/test/MultiTestRunner.py @@ -9,6 +9,10 @@ TODO   - 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 @@ class Tester(threading.Thread):              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 @@ def main():      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 +  diff --git a/clang/utils/test/TestRunner.py b/clang/utils/test/TestRunner.py index 9aae55cedeb..854d60bb408 100755 --- a/clang/utils/test/TestRunner.py +++ b/clang/utils/test/TestRunner.py @@ -57,7 +57,7 @@ def mkdir_p(path):              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 @@ def executeScript(script, commands, cwd):          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 @@ def executeScript(script, commands, cwd):      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 @@ def runOneTest(testPath, tmpBase, clang, clangcc):          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]  | 

