[llvm-commits] [llvm] r103625 - /llvm/trunk/utils/lit/lit/lit.py

Daniel Dunbar daniel at zuster.org
Wed May 12 10:56:42 PDT 2010


Author: ddunbar
Date: Wed May 12 12:56:42 2010
New Revision: 103625

URL: http://llvm.org/viewvc/llvm-project?rev=103625&view=rev
Log:
lit: Add support for 'lit ... @foo', which reads a list of tests to run from
foo.

Modified:
    llvm/trunk/utils/lit/lit/lit.py

Modified: llvm/trunk/utils/lit/lit/lit.py
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/lit/lit/lit.py?rev=103625&r1=103624&r2=103625&view=diff
==============================================================================
--- llvm/trunk/utils/lit/lit/lit.py (original)
+++ llvm/trunk/utils/lit/lit/lit.py Wed May 12 12:56:42 2010
@@ -490,11 +490,27 @@
                                     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])





More information about the llvm-commits mailing list