aboutsummaryrefslogtreecommitdiffstats
path: root/utils/lit/lit/formats/googletest.py
diff options
context:
space:
mode:
Diffstat (limited to 'utils/lit/lit/formats/googletest.py')
-rw-r--r--utils/lit/lit/formats/googletest.py20
1 files changed, 16 insertions, 4 deletions
diff --git a/utils/lit/lit/formats/googletest.py b/utils/lit/lit/formats/googletest.py
index 59ac3c5..3ce5791 100644
--- a/utils/lit/lit/formats/googletest.py
+++ b/utils/lit/lit/formats/googletest.py
@@ -53,6 +53,11 @@ class GoogleTest(TestFormat):
ln = ln[index*2:]
if ln.endswith('.'):
nested_tests.append(ln)
+ elif any([name.startswith('DISABLED_')
+ for name in nested_tests + [ln]]):
+ # Gtest will internally skip these tests. No need to launch a
+ # child process for it.
+ continue
else:
yield ''.join(nested_tests) + ln
@@ -95,7 +100,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 +112,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