MultiTestRunner: Reenable --vg option.
- Simplified from before and using --error-exitcode so failures show up as failures. llvm-svn: 77424
This commit is contained in:
parent
13796e3b95
commit
1cb8d81b41
|
@ -9,6 +9,10 @@ TODO
|
||||||
- Use a timeout / ulimit
|
- Use a timeout / ulimit
|
||||||
- Detect signaled failures (abort)
|
- Detect signaled failures (abort)
|
||||||
- Better support for finding tests
|
- 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
|
# TOD
|
||||||
|
@ -157,7 +161,8 @@ class Tester(threading.Thread):
|
||||||
else:
|
else:
|
||||||
startTime = time.time()
|
startTime = time.time()
|
||||||
code, output = TestRunner.runOneTest(path, base,
|
code, output = TestRunner.runOneTest(path, base,
|
||||||
opts.clang, opts.clangcc)
|
opts.clang, opts.clangcc,
|
||||||
|
opts.useValgrind)
|
||||||
elapsed = time.time() - startTime
|
elapsed = time.time() - startTime
|
||||||
except KeyboardInterrupt:
|
except KeyboardInterrupt:
|
||||||
# This is a sad hack. Unfortunately subprocess goes
|
# This is a sad hack. Unfortunately subprocess goes
|
||||||
|
@ -242,9 +247,6 @@ def main():
|
||||||
|
|
||||||
if not args:
|
if not args:
|
||||||
parser.error('No inputs specified')
|
parser.error('No inputs specified')
|
||||||
if opts.useValgrind:
|
|
||||||
parser.error('Support for running with valgrind is '
|
|
||||||
'temporarily disabled')
|
|
||||||
|
|
||||||
# FIXME: Move into configuration object.
|
# FIXME: Move into configuration object.
|
||||||
TestRunner.kChildEnv["PATH"] = os.pathsep.join(opts.path +
|
TestRunner.kChildEnv["PATH"] = os.pathsep.join(opts.path +
|
||||||
|
|
|
@ -57,7 +57,7 @@ def mkdir_p(path):
|
||||||
if e.errno != errno.EEXIST:
|
if e.errno != errno.EEXIST:
|
||||||
raise
|
raise
|
||||||
|
|
||||||
def executeScript(script, commands, cwd):
|
def executeScript(script, commands, cwd, useValgrind):
|
||||||
# Write script file
|
# Write script file
|
||||||
f = open(script,'w')
|
f = open(script,'w')
|
||||||
if kSystemName == 'Windows':
|
if kSystemName == 'Windows':
|
||||||
|
@ -71,6 +71,12 @@ def executeScript(script, commands, cwd):
|
||||||
command = ['cmd','/c', script]
|
command = ['cmd','/c', script]
|
||||||
else:
|
else:
|
||||||
command = ['/bin/sh', script]
|
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,
|
p = subprocess.Popen(command, cwd=cwd,
|
||||||
stdin=subprocess.PIPE,
|
stdin=subprocess.PIPE,
|
||||||
|
@ -87,7 +93,7 @@ def executeScript(script, commands, cwd):
|
||||||
return out, err, exitCode
|
return out, err, exitCode
|
||||||
|
|
||||||
import StringIO
|
import StringIO
|
||||||
def runOneTest(testPath, tmpBase, clang, clangcc):
|
def runOneTest(testPath, tmpBase, clang, clangcc, useValgrind):
|
||||||
# Make paths absolute.
|
# Make paths absolute.
|
||||||
tmpBase = os.path.abspath(tmpBase)
|
tmpBase = os.path.abspath(tmpBase)
|
||||||
testPath = os.path.abspath(testPath)
|
testPath = os.path.abspath(testPath)
|
||||||
|
@ -149,7 +155,8 @@ def runOneTest(testPath, tmpBase, clang, clangcc):
|
||||||
scriptLines[i] = ln[:-2]
|
scriptLines[i] = ln[:-2]
|
||||||
|
|
||||||
out, err, exitCode = executeScript(script, scriptLines,
|
out, err, exitCode = executeScript(script, scriptLines,
|
||||||
cwd=os.path.dirname(testPath))
|
os.path.dirname(testPath),
|
||||||
|
useValgrind)
|
||||||
if xfailLines:
|
if xfailLines:
|
||||||
ok = exitCode != 0
|
ok = exitCode != 0
|
||||||
status = (TestStatus.XPass, TestStatus.XFail)[ok]
|
status = (TestStatus.XPass, TestStatus.XFail)[ok]
|
||||||
|
|
Loading…
Reference in New Issue