Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion googletest/src/gtest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2463,7 +2463,7 @@ void TestResult::Clear() {
elapsed_time_ = 0;
}

// Returns true off the test part was skipped.
// Returns true if the test part was skipped.
static bool TestPartSkipped(const TestPartResult& result) {
return result.skipped();
}
Expand Down Expand Up @@ -3755,6 +3755,8 @@ void BriefUnitTestResultPrinter::OnTestPartResult(
// If the test part succeeded, we don't need to do anything.
case TestPartResult::kSuccess:
return;
case TestPartResult::kSkip:
return;
default:
// Print failure message from the assertion
// (e.g. expected this and got that).
Expand Down
13 changes: 12 additions & 1 deletion googletest/test/gtest_skip_check_output_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@

from googletest.test import gtest_test_utils

# Path to the gtest_skip_in_environment_setup_test binary
# Path to the gtest_skip_test binary
EXE_PATH = gtest_test_utils.GetTestExecutablePath('gtest_skip_test')

OUTPUT = gtest_test_utils.Subprocess([EXE_PATH]).output
Expand All @@ -55,6 +55,17 @@ def testSkipEntireEnvironmentTest(self):
)
self.assertNotIn('FAILED', OUTPUT)

def testSkipTestWithBriefFlag(self):
brief_output = gtest_test_utils.Subprocess([EXE_PATH, "--gtest_brief=1"]).output
self.assertNotIn('Skipped\nskipping single test\n', brief_output)
skip_fixture = 'Skipped\nskipping all tests for this fixture\n'
self.assertIsNone(
re.search(skip_fixture + '.*' + skip_fixture, brief_output, flags=re.DOTALL),
repr(brief_output),
)
self.assertIn('SKIPPED', brief_output)
self.assertNotIn('FAILED', brief_output)


if __name__ == '__main__':
gtest_test_utils.Main()