[PATCH] lit: warn when passed invalid pathname

Hans Wennborg hans at chromium.org
Tue Jun 10 15:59:54 PDT 2014


Closed by commit rL210597 (authored by @hans).

http://reviews.llvm.org/D4097

Files:
  llvm/trunk/utils/lit/lit/discovery.py

Index: llvm/trunk/utils/lit/lit/discovery.py
===================================================================
--- llvm/trunk/utils/lit/lit/discovery.py
+++ llvm/trunk/utils/lit/lit/discovery.py
@@ -200,17 +200,19 @@
     # Expand '@...' form in inputs.
     actual_inputs = []
     for input in inputs:
-        if os.path.exists(input) or not input.startswith('@'):
-            actual_inputs.append(input)
-        else:
+        if input.startswith('@'):
             f = open(input[1:])
             try:
                 for ln in f:
                     ln = ln.strip()
                     if ln:
                         actual_inputs.append(ln)
             finally:
                 f.close()
+        elif os.path.exists(input):
+            actual_inputs.append(input)
+        else:
+            lit_config.warning('no such file or directory: %r' % input)
                     
     # Load the tests from the inputs.
     tests = []
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D4097.10305.patch
Type: text/x-patch
Size: 949 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20140610/4039fe8c/attachment.bin>


More information about the llvm-commits mailing list