summaryrefslogtreecommitdiffstats
path: root/llvm/utils/lit
diff options
context:
space:
mode:
authorHans Wennborg <hans@hanshq.net>2014-06-10 22:51:58 +0000
committerHans Wennborg <hans@hanshq.net>2014-06-10 22:51:58 +0000
commita55d30a223db1803b84106e588d417c4168fd46a (patch)
treed30b6e67adb710bad987d4f0b55bc7c4e549fc4f /llvm/utils/lit
parent6c786a1dd1af5a35e2f04ee773fbb85969a04f22 (diff)
downloadbcm5719-llvm-a55d30a223db1803b84106e588d417c4168fd46a.tar.gz
bcm5719-llvm-a55d30a223db1803b84106e588d417c4168fd46a.zip
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 llvm-svn: 210597
Diffstat (limited to 'llvm/utils/lit')
-rw-r--r--llvm/utils/lit/lit/discovery.py8
1 files changed, 5 insertions, 3 deletions
diff --git a/llvm/utils/lit/lit/discovery.py b/llvm/utils/lit/lit/discovery.py
index c3c0f283b55..8f22b247752 100644
--- a/llvm/utils/lit/lit/discovery.py
+++ b/llvm/utils/lit/lit/discovery.py
@@ -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:
@@ -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 = []
OpenPOWER on IntegriCloud