1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-19 02:52:53 +02:00

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
This commit is contained in:
Jeffrey Yasskin 2009-10-18 02:05:42 +00:00
parent d21c892821
commit 160f3b9191

View File

@ -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)