[llvm] r210597 - lit: warn when passed invalid pathname

Hans Wennborg hans at hanshq.net
Tue Jun 10 15:51:59 PDT 2014


Author: hans
Date: Tue Jun 10 17:51:58 2014
New Revision: 210597

URL: http://llvm.org/viewvc/llvm-project?rev=210597&view=rev
Log:
lit: warn when passed invalid pathname

It would previously say things like

  warning: input 'test/Frontend/foo.c' contained no tests

and have the user pull their hair trying to figure out what's wrong with that
file. This patch changes the message to the much clearer:

  warning: no such file or directory: 'test/Frontend/foo.c'

Differential Revision: http://reviews.llvm.org/D4097

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

Modified: llvm/trunk/utils/lit/lit/discovery.py
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/lit/lit/discovery.py?rev=210597&r1=210596&r2=210597&view=diff
==============================================================================
--- llvm/trunk/utils/lit/lit/discovery.py (original)
+++ llvm/trunk/utils/lit/lit/discovery.py Tue Jun 10 17:51:58 2014
@@ -200,9 +200,7 @@ def find_tests_for_inputs(lit_config, in
     # 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:
@@ -211,6 +209,10 @@ def find_tests_for_inputs(lit_config, in
                         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 = []





More information about the llvm-commits mailing list