diff options
author | David L. Jones <dlj@google.com> | 2017-07-06 03:23:18 +0000 |
---|---|---|
committer | David L. Jones <dlj@google.com> | 2017-07-06 03:23:18 +0000 |
commit | a63c3369aa005bf9ba9c6de5e47ae0f544fc82fb (patch) | |
tree | 174ac5670a8354b6e4aa0a46c04f8c54f7ad7171 /llvm/utils | |
parent | a15e7f296babc33d7565dc6c224a818a9597796b (diff) | |
download | bcm5719-llvm-a63c3369aa005bf9ba9c6de5e47ae0f544fc82fb.tar.gz bcm5719-llvm-a63c3369aa005bf9ba9c6de5e47ae0f544fc82fb.zip |
[lit] Fix unit test discovery for Visual Studio builds.
Fix by Andrew Ng!
The Visual Studio build can contain output for multiple configuration types (
e.g. Debug, Release & RelWithDebInfo) within the same build output
directory. Therefore when discovering unit tests, the "build mode" sub directory
containing the appropriate configuration is included in the search. This sub
directory may not always be present, so a test for its existence is required.
Reviewers: zturner, modocache, dlj
Reviewed By: zturner, dlj
Subscribers: grimar, bd1976llvm, gbreynoo, edd, jhenderson, llvm-commits
Differential Revision: https://reviews.llvm.org/D34976
llvm-svn: 307235
Diffstat (limited to 'llvm/utils')
-rw-r--r-- | llvm/utils/lit/lit/formats/googletest.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/llvm/utils/lit/lit/formats/googletest.py b/llvm/utils/lit/lit/formats/googletest.py index b683f7c7db8..9c55e71d233 100644 --- a/llvm/utils/lit/lit/formats/googletest.py +++ b/llvm/utils/lit/lit/formats/googletest.py @@ -78,7 +78,10 @@ class GoogleTest(TestFormat): litConfig, localConfig): source_path = testSuite.getSourcePath(path_in_suite) for subdir in self.test_sub_dirs: - for fn in lit.util.listdir_files(os.path.join(source_path, subdir), + dir_path = os.path.join(source_path, subdir) + if not os.path.isdir(dir_path): + continue + for fn in lit.util.listdir_files(dir_path, suffixes={self.test_suffix}): # Discover the tests in this executable. execpath = os.path.join(source_path, subdir, fn) |