Index: llvm/utils/lit/lit/formats/googletest.py =================================================================== --- llvm/utils/lit/lit/formats/googletest.py +++ llvm/utils/lit/lit/formats/googletest.py @@ -135,6 +135,9 @@ 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' % Index: llvm/utils/lit/tests/Inputs/googletest-format/DummySubDir/OneTest.py =================================================================== --- llvm/utils/lit/tests/Inputs/googletest-format/DummySubDir/OneTest.py +++ llvm/utils/lit/tests/Inputs/googletest-format/DummySubDir/OneTest.py @@ -10,6 +10,7 @@ FirstTest. subTestA subTestB + subTestC ParameterizedTest/0. subTest ParameterizedTest/1. @@ -27,6 +28,12 @@ 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') Index: llvm/utils/lit/tests/googletest-format.py =================================================================== --- llvm/utils/lit/tests/googletest-format.py +++ llvm/utils/lit/tests/googletest-format.py @@ -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