diff options
author | Reid Kleckner <reid@kleckner.net> | 2015-04-06 21:49:55 +0000 |
---|---|---|
committer | Reid Kleckner <reid@kleckner.net> | 2015-04-06 21:49:55 +0000 |
commit | ad4cee162b684e4de4870d32a90640dc28355be3 (patch) | |
tree | f630196a67243316ef2976a8bb55821cda9036e0 /llvm/utils/lit | |
parent | bcd67f03a47f2f9e26b6912022b2b9562d1839e6 (diff) | |
download | bcm5719-llvm-ad4cee162b684e4de4870d32a90640dc28355be3.tar.gz bcm5719-llvm-ad4cee162b684e4de4870d32a90640dc28355be3.zip |
[lit] Fix running gtest type-parameterized tests on Windows
The '/' character in the test name of a type-parameterized test is not a
path separator, and should not be '\' on Windows. We were passing a test
name to --gtest_filter which found no tests, so the exit code was zero,
indicating a passed test.
This bug has been here since r84387 in 2009, when Jeff Yasskin added the
original lit support for type-paratermized tests. Somewhere along the
line some of the ValueMapTests started failing, but we can fix those
separately.
llvm-svn: 234242
Diffstat (limited to 'llvm/utils/lit')
-rw-r--r-- | llvm/utils/lit/lit/formats/googletest.py | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/llvm/utils/lit/lit/formats/googletest.py b/llvm/utils/lit/lit/formats/googletest.py index 59ac3c5cb37..748dcc7fc67 100644 --- a/llvm/utils/lit/lit/formats/googletest.py +++ b/llvm/utils/lit/lit/formats/googletest.py @@ -95,7 +95,7 @@ class GoogleTest(TestFormat): # Handle GTest parametrized and typed tests, whose name includes # some '/'s. testPath, namePrefix = os.path.split(testPath) - testName = os.path.join(namePrefix, testName) + testName = namePrefix + '/' + testName cmd = [testPath, '--gtest_filter=' + testName] if litConfig.useValgrind: @@ -107,7 +107,14 @@ class GoogleTest(TestFormat): out, err, exitCode = lit.util.executeCommand( cmd, env=test.config.environment) - if not exitCode: - return lit.Test.PASS,'' + if exitCode: + return lit.Test.FAIL, out + err + + passing_test_line = '[ PASSED ] 1 test.' + if passing_test_line not in out: + msg = ('Unable to find %r in gtest output:\n\n%s%s' % + (passing_test_line, out, err)) + return lit.Test.UNRESOLVED, msg + + return lit.Test.PASS,'' - return lit.Test.FAIL, out + err |