diff options
Diffstat (limited to 'utils/lit/lit')
-rw-r--r-- | utils/lit/lit/LitConfig.py | 3 | ||||
-rw-r--r-- | utils/lit/lit/TestFormats.py | 4 | ||||
-rw-r--r-- | utils/lit/lit/TestRunner.py | 11 | ||||
-rw-r--r-- | utils/lit/lit/TestingConfig.py | 13 | ||||
-rwxr-xr-x | utils/lit/lit/main.py | 2 |
5 files changed, 25 insertions, 8 deletions
diff --git a/utils/lit/lit/LitConfig.py b/utils/lit/lit/LitConfig.py index bda91744cce3..2cc278111991 100644 --- a/utils/lit/lit/LitConfig.py +++ b/utils/lit/lit/LitConfig.py @@ -20,7 +20,7 @@ class LitConfig: 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 @@ -32,6 +32,7 @@ class LitConfig: 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) diff --git a/utils/lit/lit/TestFormats.py b/utils/lit/lit/TestFormats.py index 6dda2fdb608d..d1c0558b5f37 100644 --- a/utils/lit/lit/TestFormats.py +++ b/utils/lit/lit/TestFormats.py @@ -125,7 +125,11 @@ class ShTest(FileBasedTest): self.execute_external) class TclTest(FileBasedTest): + def __init__(self, ignoreStdErr=False): + self.ignoreStdErr = ignoreStdErr + def execute(self, test, litConfig): + litConfig.ignoreStdErr = self.ignoreStdErr return TestRunner.executeTclTest(test, litConfig) ### diff --git a/utils/lit/lit/TestRunner.py b/utils/lit/lit/TestRunner.py index 80d0ba118399..f5f7c19891b3 100644 --- a/utils/lit/lit/TestRunner.py +++ b/utils/lit/lit/TestRunner.py @@ -397,7 +397,8 @@ def parseIntegratedTestScript(test, normalize_slashes=False): sourcedir = os.path.dirname(sourcepath) execpath = test.getExecPath() execdir,execbase = os.path.split(execpath) - tmpBase = os.path.join(execdir, 'Output', execbase) + tmpDir = os.path.join(execdir, 'Output') + tmpBase = os.path.join(tmpDir, execbase) if test.index is not None: tmpBase += '_%d' % test.index @@ -405,6 +406,7 @@ def parseIntegratedTestScript(test, normalize_slashes=False): if normalize_slashes: sourcepath = sourcepath.replace('\\', '/') sourcedir = sourcedir.replace('\\', '/') + tmpDir = tmpDir.replace('\\', '/') tmpBase = tmpBase.replace('\\', '/') # We use #_MARKER_# to hide %% while we do the other substitutions. @@ -414,6 +416,7 @@ def parseIntegratedTestScript(test, normalize_slashes=False): ('%S', sourcedir), ('%p', sourcedir), ('%t', tmpBase + '.tmp'), + ('%T', tmpDir), # FIXME: Remove this once we kill DejaGNU. ('%abs_tmp', tmpBase + '.tmp'), ('#_MARKER_#', '%')]) @@ -533,13 +536,13 @@ def executeTclTest(test, litConfig): # 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: - ok = exitCode == 0 and not err + ok = exitCode == 0 and (not err or litConfig.ignoreStdErr) if ok: status = Test.PASS else: @@ -550,7 +553,7 @@ def executeTclTest(test, litConfig): # 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) diff --git a/utils/lit/lit/TestingConfig.py b/utils/lit/lit/TestingConfig.py index 25bb3417de43..a92dca8fb1b1 100644 --- a/utils/lit/lit/TestingConfig.py +++ b/utils/lit/lit/TestingConfig.py @@ -1,4 +1,5 @@ import os +import sys class TestingConfig: """" @@ -14,12 +15,18 @@ class TestingConfig: 'LD_LIBRARY_PATH' : os.environ.get('LD_LIBRARY_PATH',''), 'PATH' : os.pathsep.join(litConfig.path + [os.environ.get('PATH','')]), - 'PATHEXT' : os.environ.get('PATHEXT',''), 'SYSTEMROOT' : os.environ.get('SYSTEMROOT',''), - 'LLVM_DISABLE_CRT_DEBUG' : '1', - 'PYTHONUNBUFFERED' : '1', } + if sys.platform == 'win32': + environment.update({ + 'LLVM_DISABLE_CRT_DEBUG' : '1', + 'PATHEXT' : os.environ.get('PATHEXT',''), + 'PYTHONUNBUFFERED' : '1', + 'TEMP' : os.environ.get('TEMP',''), + 'TMP' : os.environ.get('TMP',''), + }) + config = TestingConfig(parent, name = '<unnamed>', suffixes = set(), diff --git a/utils/lit/lit/main.py b/utils/lit/lit/main.py index 13d263009ddd..e1a380c3fcbc 100755 --- a/utils/lit/lit/main.py +++ b/utils/lit/lit/main.py @@ -328,6 +328,7 @@ def load_test_suite(inputs): valgrindArgs = [], useTclAsSh = False, noExecute = False, + ignoreStdErr = False, debug = False, isWindows = (platform.system()=='Windows'), params = {}) @@ -485,6 +486,7 @@ def main(builtinParameters = {}): # Bump the GIL check interval, its more imp valgrindArgs = opts.valgrindArgs, useTclAsSh = opts.useTclAsSh, noExecute = opts.noExecute, + ignoreStdErr = False, debug = opts.debug, isWindows = (platform.system()=='Windows'), params = userParams) |