summaryrefslogtreecommitdiff
path: root/utils/lit
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
commit6bccb4c2373532b972ecf84e8428f800e5e9995f (patch)
tree570a261b77fa0cb85d5f3b1876dc34bd3448dc8f /utils/lit
parentc1a38f59b5a258bfebbe553498c0e67f24ca74ec (diff)
downloadllvm-6bccb4c2373532b972ecf84e8428f800e5e9995f.tar.gz
llvm-6bccb4c2373532b972ecf84e8428f800e5e9995f.tar.bz2
llvm-6bccb4c2373532b972ecf84e8428f800e5e9995f.tar.xz
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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84387 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'utils/lit')
-rw-r--r--utils/lit/TestFormats.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/utils/lit/TestFormats.py b/utils/lit/TestFormats.py
index 61bdb18535..7e638b47f4 100644
--- a/utils/lit/TestFormats.py
+++ b/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)