1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-18 10:32:48 +02:00

[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:
Igor Kudrin 2021-05-21 10:31:35 +07:00
parent b32d7b7d22
commit ca34183385
3 changed files with 14 additions and 3 deletions

View File

@ -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' %

View File

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

View File

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