Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 18 additions & 8 deletions llvm/utils/lit/lit/formats/googletest.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
class GoogleTest(TestFormat):
def __init__(self, test_sub_dirs, test_suffix, run_under=[], test_prefix=None):
self.seen_executables = set()
self.test_sub_dirs = str(test_sub_dirs).split(";")
self.test_sub_dirs = [d for d in str(test_sub_dirs).split(";") if d] or ["."]

# On Windows, assume tests will also end in '.exe'.
exe_suffix = str(test_suffix)
Expand Down Expand Up @@ -80,12 +80,19 @@ def getTestsInDirectory(self, testSuite, path_in_suite, litConfig, localConfig):

# Create one lit test for each shard.
for idx in range(nshard):
testPath = path_in_suite + (
subdir,
fn,
str(idx),
str(nshard),
)
if subdir == ".":
testPath = path_in_suite + (
fn,
str(idx),
str(nshard),
)
else:
testPath = path_in_suite + (
subdir,
fn,
str(idx),
str(nshard),
)
json_file = (
"-".join(
[
Expand All @@ -106,7 +113,10 @@ def getTestsInDirectory(self, testSuite, path_in_suite, litConfig, localConfig):
gtest_json_file=json_file,
)
else:
testPath = path_in_suite + (subdir, fn)
if subdir == ".":
testPath = path_in_suite + (fn,)
else:
testPath = path_in_suite + (subdir, fn)
json_file = (
"-".join(
[
Expand Down
Loading