From: NAKAMURA Takumi Date: Wed, 7 Aug 2013 12:44:29 +0000 (+0000) Subject: Lit: Resurrect --no-execute dropped in r187852. X-Git-Url: http://plrg.eecs.uci.edu/git/?a=commitdiff_plain;h=8f4aab8c2fe095ce1286fc1bd0bdd9157ed00398;p=oota-llvm.git Lit: Resurrect --no-execute dropped in r187852. For now, builders in bb.pgr.jp are using it. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187886 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/utils/lit/lit/LitConfig.py b/utils/lit/lit/LitConfig.py index 991879f2606..cff3636268e 100644 --- a/utils/lit/lit/LitConfig.py +++ b/utils/lit/lit/LitConfig.py @@ -27,7 +27,8 @@ class LitConfig: def __init__(self, progname, path, quiet, useValgrind, valgrindLeakCheck, valgrindArgs, - debug, isWindows, params, config_prefix = None): + noExecute, debug, isWindows, + params, config_prefix = None): # The name of the test runner. self.progname = progname # The items to add to the PATH environment variable. @@ -36,6 +37,7 @@ class LitConfig: self.useValgrind = bool(useValgrind) self.valgrindLeakCheck = bool(valgrindLeakCheck) self.valgrindUserArgs = list(valgrindArgs) + self.noExecute = noExecute 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 a9707cccb3f..1793ab52721 100644 --- a/utils/lit/lit/TestFormats.py +++ b/utils/lit/lit/TestFormats.py @@ -100,6 +100,9 @@ class GoogleTest(object): if litConfig.useValgrind: cmd = litConfig.valgrindArgs + cmd + if litConfig.noExecute: + return Test.PASS, '' + out, err, exitCode = lit.TestRunner.executeCommand( cmd, env=test.config.environment) diff --git a/utils/lit/lit/TestRunner.py b/utils/lit/lit/TestRunner.py index ecd158b4c08..989a992ef82 100644 --- a/utils/lit/lit/TestRunner.py +++ b/utils/lit/lit/TestRunner.py @@ -467,6 +467,9 @@ def executeShTest(test, litConfig, useExternalSh, script, isXFail, tmpBase, execdir = res + if litConfig.noExecute: + return (Test.PASS, '') + # Create the output directory if it does not already exist. Util.mkdir_p(os.path.dirname(tmpBase)) diff --git a/utils/lit/lit/discovery.py b/utils/lit/lit/discovery.py index 86cc46e2d93..f76bd22075f 100644 --- a/utils/lit/lit/discovery.py +++ b/utils/lit/lit/discovery.py @@ -232,6 +232,7 @@ def load_test_suite(inputs): useValgrind = False, valgrindLeakCheck = False, valgrindArgs = [], + noExecute = False, debug = False, isWindows = (platform.system()=='Windows'), params = {}) diff --git a/utils/lit/lit/main.py b/utils/lit/lit/main.py index 423c9d0e92f..acf6101d086 100755 --- a/utils/lit/lit/main.py +++ b/utils/lit/lit/main.py @@ -212,6 +212,9 @@ def main(builtinParameters = {}): group.add_option("", "--time-tests", dest="timeTests", help="Track elapsed wall time for each test", action="store_true", default=False) + group.add_option("", "--no-execute", dest="noExecute", + help="Don't execute any tests (assume PASS)", + action="store_true", default=False) parser.add_option_group(group) group = OptionGroup(parser, "Test Selection") @@ -279,6 +282,7 @@ def main(builtinParameters = {}): useValgrind = opts.useValgrind, valgrindLeakCheck = opts.valgrindLeakCheck, valgrindArgs = opts.valgrindArgs, + noExecute = opts.noExecute, debug = opts.debug, isWindows = (platform.system()=='Windows'), params = userParams,