[llvm-commits] [llvm] r84387 - /llvm/trunk/utils/lit/TestFormats.py
Jeffrey Yasskin
jyasskin at google.com
Sat Oct 17 19:05:42 PDT 2009
Author: jyasskin
Date: Sat Oct 17 21:05:42 2009
New Revision: 84387
URL: http://llvm.org/viewvc/llvm-project?rev=84387&view=rev
Log:
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.
Modified:
llvm/trunk/utils/lit/TestFormats.py
Modified: llvm/trunk/utils/lit/TestFormats.py
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/lit/TestFormats.py?rev=84387&r1=84386&r2=84387&view=diff
==============================================================================
--- llvm/trunk/utils/lit/TestFormats.py (original)
+++ llvm/trunk/utils/lit/TestFormats.py Sat Oct 17 21:05:42 2009
@@ -53,6 +53,10 @@
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)
More information about the llvm-commits
mailing list