startTime = time.time()
code = TestRunner.runOneTest(path, command, output, testname,
opts.clang, opts.clangcc,
- useValgrind=opts.useValgrind,
useDGCompat=opts.useDGCompat,
useScript=opts.testScript,
output=open(testresults,'w'))
if not args:
parser.error('No inputs specified')
+ if opts.useValgrind:
+ parser.error('Support for running with valgrind is '
+ 'temporarily disabled')
if opts.clang is None:
opts.clang = TestRunner.inferClang()
f.close()
def runOneTest(FILENAME, SUBST, OUTPUT, TESTNAME, CLANG, CLANGCC,
- useValgrind=False,
useDGCompat=False,
useScript=None,
output=sys.stdout):
OUTPUT = os.path.abspath(OUTPUT)
- if useValgrind:
- VG_OUTPUT = '%s.vg'%(OUTPUT,)
- os.system('rm -f %s.*'%(VG_OUTPUT))
- VALGRIND = 'valgrind -q --tool=memcheck --leak-check=full --trace-children=yes --log-file=%s.%%p'%(VG_OUTPUT)
- CLANG = '%s %s'%(VALGRIND, CLANG)
- CLANGCC = '%s %s'%(VALGRIND, CLANGCC)
# Create the output directory if it does not already exist.
mkdir_p(os.path.dirname(OUTPUT))
f = open(SCRIPT,'w')
if kSystemName == 'Windows':
f.write('\nif %ERRORLEVEL% NEQ 0 EXIT\n'.join(scriptLines))
- f.write('\n')
else:
f.write(' &&\n'.join(scriptLines))
+ f.write('\n')
f.close()
outputFile = open(OUTPUT,'w')
if xfailLines:
SCRIPT_STATUS = not SCRIPT_STATUS
- if useValgrind:
- if kSystemName == 'Windows':
- raise NotImplementedError,'Cannot run valgrind on windows'
- else:
- VG_OUTPUT = capture(['/bin/sh','-c','cat %s.*'%(VG_OUTPUT)])
- VG_STATUS = len(VG_OUTPUT)
- else:
- VG_STATUS = 0
-
- if SCRIPT_STATUS or VG_STATUS:
+ if SCRIPT_STATUS:
print >>output, "******************** TEST '%s' FAILED! ********************"%(TESTNAME,)
print >>output, "Command: "
output.writelines(scriptLines)
else:
print >>output, "Incorrect Output:"
cat(OUTPUT, output)
- if VG_STATUS:
- print >>output, "Valgrind Output:"
- print >>output, VG_OUTPUT
print >>output, "******************** TEST '%s' FAILED! ********************"%(TESTNAME,)
output.flush()
if xfailLines:
parser.add_option("", "--clang-cc", dest="clangcc",
help="Program to use as \"clang-cc\"",
action="store", default=None)
- parser.add_option("", "--vg", dest="useValgrind",
- help="Run tests under valgrind",
- action="store_true", default=False)
parser.add_option("", "--dg", dest="useDGCompat",
help="Use llvm dejagnu compatibility mode",
action="store_true", default=False)
res = runOneTest(path, command, output, testname,
opts.clang, opts.clangcc,
- useValgrind=opts.useValgrind,
useDGCompat=opts.useDGCompat,
useScript=os.getenv("TEST_SCRIPT"))