Lit: Resurrect --no-execute dropped in r187852.
authorNAKAMURA Takumi <geek4civic@gmail.com>
Wed, 7 Aug 2013 12:44:29 +0000 (12:44 +0000)
committerNAKAMURA Takumi <geek4civic@gmail.com>
Wed, 7 Aug 2013 12:44:29 +0000 (12:44 +0000)
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

utils/lit/lit/LitConfig.py
utils/lit/lit/TestFormats.py
utils/lit/lit/TestRunner.py
utils/lit/lit/discovery.py
utils/lit/lit/main.py

index 991879f2606e0ec09e7a5b0177719ad5829b22cc..cff3636268e76c8f0497d17f5c623fb8eb6dd0a2 100644 (file)
@@ -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)
index a9707cccb3faeaf1251a22cdd8bc94767acca473..1793ab52721ae6aa5eef4d3de679cb3af7eb1b68 100644 (file)
@@ -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)
 
index ecd158b4c083857eb4852c69f5275fb7b4eae6f5..989a992ef82e863b83424efb6a15bee6f770e616 100644 (file)
@@ -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))
 
index 86cc46e2d93ed81600b2dfe5d0495db43969eab2..f76bd22075f4956947970c5f0fe4041160d6e249 100644 (file)
@@ -232,6 +232,7 @@ def load_test_suite(inputs):
                                     useValgrind = False,
                                     valgrindLeakCheck = False,
                                     valgrindArgs = [],
+                                    noExecute = False,
                                     debug = False,
                                     isWindows = (platform.system()=='Windows'),
                                     params = {})
index 423c9d0e92fac5280947db8b5fa487c17c176723..acf6101d08607dbc76b74d145b5b9b188216a0fc 100755 (executable)
@@ -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,