aboutsummaryrefslogtreecommitdiffstats
path: root/utils/lit
diff options
context:
space:
mode:
authorDaniel Dunbar <daniel@zuster.org>2009-12-15 22:00:37 +0000
committerDaniel Dunbar <daniel@zuster.org>2009-12-15 22:00:37 +0000
commit99ea6898e18ec1496907a90efedf5b21a2040ea0 (patch)
tree7fc78a37f8d8ae6c8f23a7fed555a0b2be812264 /utils/lit
parent9b03da6824372f3b6cb961ecf88de949cb10b450 (diff)
downloadexternal_llvm-99ea6898e18ec1496907a90efedf5b21a2040ea0.zip
external_llvm-99ea6898e18ec1496907a90efedf5b21a2040ea0.tar.gz
external_llvm-99ea6898e18ec1496907a90efedf5b21a2040ea0.tar.bz2
lit: Improve error when gtest discovery fails.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@91458 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'utils/lit')
-rw-r--r--utils/lit/TestFormats.py11
1 files changed, 8 insertions, 3 deletions
diff --git a/utils/lit/TestFormats.py b/utils/lit/TestFormats.py
index 7305c79..5dfd54a 100644
--- a/utils/lit/TestFormats.py
+++ b/utils/lit/TestFormats.py
@@ -9,12 +9,17 @@ class GoogleTest(object):
self.test_sub_dir = str(test_sub_dir)
self.test_suffix = str(test_suffix)
- def getGTestTests(self, path):
+ def getGTestTests(self, path, litConfig):
"""getGTestTests(path) - [name]
Return the tests available in gtest executable."""
- lines = Util.capture([path, '--gtest_list_tests']).split('\n')
+ try:
+ lines = Util.capture([path, '--gtest_list_tests']).split('\n')
+ except:
+ litConfig.error("unable to discover google-tests in %r" % path)
+ raise StopIteration
+
nested_tests = []
for ln in lines:
if not ln.strip():
@@ -47,7 +52,7 @@ class GoogleTest(object):
execpath = os.path.join(filepath, subfilename)
# Discover the tests in this executable.
- for name in self.getGTestTests(execpath):
+ for name in self.getGTestTests(execpath, litConfig):
testPath = path_in_suite + (filename, subfilename, name)
yield Test.Test(testSuite, testPath, localConfig)