summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJeffrey Yasskin <jyasskin@google.com>2009-10-18 02:05:42 +0000
committerJeffrey Yasskin <jyasskin@google.com>2009-10-18 02:05:42 +0000
commit35ec32d397d36834d1093e1ebaa88c099900738e (patch)
tree5fb0eb78196e4a58944757be9d8b7df35bac2c6a
parent1700197e65896dc0e4697f3b802cb2e1bea0e850 (diff)
downloadbcm5719-llvm-35ec32d397d36834d1093e1ebaa88c099900738e.tar.gz
bcm5719-llvm-35ec32d397d36834d1093e1ebaa88c099900738e.zip
Support GoogleTest's "typed tests"
(http://code.google.com/p/googletest/wiki/GoogleTestAdvancedGuide#Typed_Tests) in lit.py. These tests have names like "ValueMapTest/0.Iteration", which broke when lit.py os.path.join()ed them onto the path and then assumed it could os.path.split() them back off. This patch shifts path components from the testPath to the testName until the testPath exists. llvm-svn: 84387
-rw-r--r--llvm/utils/lit/TestFormats.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/llvm/utils/lit/TestFormats.py b/llvm/utils/lit/TestFormats.py
index 61bdb185355..7e638b47f4d 100644
--- a/llvm/utils/lit/TestFormats.py
+++ b/llvm/utils/lit/TestFormats.py
@@ -53,6 +53,10 @@ class GoogleTest(object):
def execute(self, test, litConfig):
testPath,testName = os.path.split(test.getSourcePath())
+ if not os.path.exists(testPath):
+ # Handle GTest typed tests, whose name includes a '/'.
+ testPath, namePrefix = os.path.split(testPath)
+ testName = os.path.join(namePrefix, testName)
cmd = [testPath, '--gtest_filter=' + testName]
out, err, exitCode = TestRunner.executeCommand(cmd)
OpenPOWER on IntegriCloud