lit: Add support for 'lit ... @foo', which reads a list of tests to run from
authorDaniel Dunbar <daniel@zuster.org>
Wed, 12 May 2010 17:56:42 +0000 (17:56 +0000)
committerDaniel Dunbar <daniel@zuster.org>
Wed, 12 May 2010 17:56:42 +0000 (17:56 +0000)
foo.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@103625 91177308-0d34-0410-b5e6-96231b3b80d8

utils/lit/lit/lit.py

index 3de1084e6aa973eda805b8981c44d987ce7374ea..db0653f7966d9aaa72ba12e61b372dd30ec8babb 100755 (executable)
@@ -490,11 +490,27 @@ def main():
                                     isWindows = (platform.system()=='Windows'),
                                     params = userParams)
 
+    # Expand '@...' form in inputs.
+    actual_inputs = []
+    for input in inputs:
+        if os.path.exists(input) or not input.startswith('@'):
+            actual_inputs.append(input)
+        else:
+            f = open(input[1:])
+            try:
+                for ln in f:
+                    ln = ln.strip()
+                    if ln:
+                        actual_inputs.append(ln)
+            finally:
+                f.close()
+                    
+            
     # Load the tests from the inputs.
     tests = []
     testSuiteCache = {}
     localConfigCache = {}
-    for input in inputs:
+    for input in actual_inputs:
         prev = len(tests)
         tests.extend(getTests(input, litConfig,
                               testSuiteCache, localConfigCache)[1])