Skip to content

Commit

Permalink
lit: warn when passed invalid pathname
Browse files Browse the repository at this point in the history
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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210597 91177308-0d34-0410-b5e6-96231b3b80d8
  • Loading branch information
zmodem committed Jun 10, 2014
1 parent c6e5ff4 commit a327ac3
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions utils/lit/lit/discovery.py
Original file line number Diff line number Diff line change
Expand Up @@ -200,9 +200,7 @@ def find_tests_for_inputs(lit_config, inputs):
# 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:
Expand All @@ -211,6 +209,10 @@ def find_tests_for_inputs(lit_config, inputs):
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 = []
Expand Down

0 comments on commit a327ac3

Please sign in to comment.