This is useful for testing a build a temporarily hand instrumented
build.
Patch by arrowdodger!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@138804
91177308-0d34-0410-b5e6-
96231b3b80d8
# testFormat: The test format to use to interpret tests.
config.test_format = lit.formats.TclTest()
# testFormat: The test format to use to interpret tests.
config.test_format = lit.formats.TclTest()
+# To ignore test output on stderr so it doesn't trigger failures uncomment this:
+#config.test_format = lit.formats.TclTest(ignoreStdErr=True)
+
# suffixes: A list of file extensions to treat as test files, this is actually
# set by on_clone().
config.suffixes = []
# suffixes: A list of file extensions to treat as test files, this is actually
# set by on_clone().
config.suffixes = []
def __init__(self, progname, path, quiet,
useValgrind, valgrindLeakCheck, valgrindArgs,
useTclAsSh,
def __init__(self, progname, path, quiet,
useValgrind, valgrindLeakCheck, valgrindArgs,
useTclAsSh,
- noExecute, debug, isWindows,
+ noExecute, ignoreStdErr, debug, isWindows,
params):
# The name of the test runner.
self.progname = progname
params):
# The name of the test runner.
self.progname = progname
self.valgrindUserArgs = list(valgrindArgs)
self.useTclAsSh = bool(useTclAsSh)
self.noExecute = noExecute
self.valgrindUserArgs = list(valgrindArgs)
self.useTclAsSh = bool(useTclAsSh)
self.noExecute = noExecute
+ self.ignoreStdErr = ignoreStdErr
self.debug = debug
self.isWindows = bool(isWindows)
self.params = dict(params)
self.debug = debug
self.isWindows = bool(isWindows)
self.params = dict(params)
self.execute_external)
class TclTest(FileBasedTest):
self.execute_external)
class TclTest(FileBasedTest):
+ def __init__(self, ignoreStdErr=False):
+ self.ignoreStdErr = ignoreStdErr
+
def execute(self, test, litConfig):
def execute(self, test, litConfig):
+ litConfig.ignoreStdErr = self.ignoreStdErr
return TestRunner.executeTclTest(test, litConfig)
###
return TestRunner.executeTclTest(test, litConfig)
###
# considered to fail if there is any standard error output.
out,err,exitCode = res
if isXFail:
# considered to fail if there is any standard error output.
out,err,exitCode = res
if isXFail:
- ok = exitCode != 0 or err
+ ok = exitCode != 0 or err and not litConfig.ignoreStdErr
if ok:
status = Test.XFAIL
else:
status = Test.XPASS
else:
if ok:
status = Test.XFAIL
else:
status = Test.XPASS
else:
- ok = exitCode == 0 and not err
+ ok = exitCode == 0 and (not err or litConfig.ignoreStdErr)
if ok:
status = Test.PASS
else:
if ok:
status = Test.PASS
else:
# Set a flag for formatTestOutput so it can explain why the test was
# considered to have failed, despite having an exit code of 0.
# Set a flag for formatTestOutput so it can explain why the test was
# considered to have failed, despite having an exit code of 0.
- failDueToStderr = exitCode == 0 and err
+ failDueToStderr = exitCode == 0 and err and not litConfig.ignoreStdErr
return formatTestOutput(status, out, err, exitCode, failDueToStderr, script)
return formatTestOutput(status, out, err, exitCode, failDueToStderr, script)
valgrindArgs = [],
useTclAsSh = False,
noExecute = False,
valgrindArgs = [],
useTclAsSh = False,
noExecute = False,
debug = False,
isWindows = (platform.system()=='Windows'),
params = {})
debug = False,
isWindows = (platform.system()=='Windows'),
params = {})
valgrindArgs = opts.valgrindArgs,
useTclAsSh = opts.useTclAsSh,
noExecute = opts.noExecute,
valgrindArgs = opts.valgrindArgs,
useTclAsSh = opts.useTclAsSh,
noExecute = opts.noExecute,
debug = opts.debug,
isWindows = (platform.system()=='Windows'),
params = userParams)
debug = opts.debug,
isWindows = (platform.system()=='Windows'),
params = userParams)