forked from OSchip/llvm-project
[lit][gtest] Support SKIPPED tests
This updates the googletest format to support tests that use GTEST_SKIP(), which is now available with the updated googletest framework. Differential Revision: https://reviews.llvm.org/D102694
This commit is contained in:
parent
95423c7c99
commit
21b40f02d2
|
@ -135,6 +135,9 @@ class GoogleTest(TestFormat):
|
|||
if exitCode:
|
||||
return lit.Test.FAIL, out + err
|
||||
|
||||
if '[ SKIPPED ] 1 test,' in out:
|
||||
return lit.Test.SKIPPED, ''
|
||||
|
||||
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' %
|
||||
|
|
|
@ -10,6 +10,7 @@ if sys.argv[1] == "--gtest_list_tests":
|
|||
FirstTest.
|
||||
subTestA
|
||||
subTestB
|
||||
subTestC
|
||||
ParameterizedTest/0.
|
||||
subTest
|
||||
ParameterizedTest/1.
|
||||
|
@ -27,6 +28,12 @@ elif test_name == 'FirstTest.subTestB':
|
|||
print('I am subTest B, I FAIL')
|
||||
print('And I have two lines of output')
|
||||
sys.exit(1)
|
||||
elif test_name == 'FirstTest.subTestC':
|
||||
print('I am subTest C, I am SKIPPED')
|
||||
print('[ PASSED ] 0 tests.')
|
||||
print('[ SKIPPED ] 1 test, listed below:')
|
||||
print('[ SKIPPED ] FirstTest.subTestC')
|
||||
sys.exit(0)
|
||||
elif test_name in ('ParameterizedTest/0.subTest',
|
||||
'ParameterizedTest/1.subTest'):
|
||||
print('I am a parameterized test, I also PASS')
|
||||
|
|
|
@ -18,9 +18,10 @@
|
|||
# CHECK-NEXT: I am subTest B, I FAIL
|
||||
# CHECK-NEXT: And I have two lines of output
|
||||
# CHECK: ***
|
||||
# CHECK: SKIPPED: googletest-format :: {{[Dd]ummy[Ss]ub[Dd]ir}}/OneTest.py/FirstTest.subTestC
|
||||
# CHECK: PASS: googletest-format :: {{[Dd]ummy[Ss]ub[Dd]ir}}/OneTest.py/ParameterizedTest/0.subTest
|
||||
# CHECK: PASS: googletest-format :: {{[Dd]ummy[Ss]ub[Dd]ir}}/OneTest.py/ParameterizedTest/1.subTest
|
||||
# CHECK: Failed Tests (1)
|
||||
# CHECK: Passed: 3
|
||||
# CHECK: Failed: 1
|
||||
|
||||
# CHECK: Skipped: 1
|
||||
# CHECK: Passed : 3
|
||||
# CHECK: Failed : 1
|
||||
|
|
Loading…
Reference in New Issue