diff options
author | Daniel Dunbar <daniel@zuster.org> | 2009-12-15 22:00:37 +0000 |
---|---|---|
committer | Daniel Dunbar <daniel@zuster.org> | 2009-12-15 22:00:37 +0000 |
commit | c6d3c5ef76e06e9acd13bf5f83c32b2ad9ccde85 (patch) | |
tree | 1d96e3806791d8a5e111a6404d06e841fad45639 | |
parent | 2b9fc83db5c892044f86a160a66f9709b8e44ff6 (diff) | |
download | bcm5719-llvm-c6d3c5ef76e06e9acd13bf5f83c32b2ad9ccde85.tar.gz bcm5719-llvm-c6d3c5ef76e06e9acd13bf5f83c32b2ad9ccde85.zip |
lit: Improve error when gtest discovery fails.
llvm-svn: 91458
-rw-r--r-- | llvm/utils/lit/TestFormats.py | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/llvm/utils/lit/TestFormats.py b/llvm/utils/lit/TestFormats.py index 7305c794a2a..5dfd54ac5ec 100644 --- a/llvm/utils/lit/TestFormats.py +++ b/llvm/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) |