mirror of
https://github.com/google/googletest.git
synced 2025-12-07 01:06:50 +08:00
Merge 8d24b1552bb723d36f006cce2d64861496b29377 into 1b96fa13f549387b7549cc89e1a785cf143a1a50
This commit is contained in:
commit
b928651657
@ -2463,7 +2463,7 @@ void TestResult::Clear() {
|
|||||||
elapsed_time_ = 0;
|
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) {
|
static bool TestPartSkipped(const TestPartResult& result) {
|
||||||
return result.skipped();
|
return result.skipped();
|
||||||
}
|
}
|
||||||
@ -3755,6 +3755,8 @@ void BriefUnitTestResultPrinter::OnTestPartResult(
|
|||||||
// If the test part succeeded, we don't need to do anything.
|
// If the test part succeeded, we don't need to do anything.
|
||||||
case TestPartResult::kSuccess:
|
case TestPartResult::kSuccess:
|
||||||
return;
|
return;
|
||||||
|
case TestPartResult::kSkip:
|
||||||
|
return;
|
||||||
default:
|
default:
|
||||||
// Print failure message from the assertion
|
// Print failure message from the assertion
|
||||||
// (e.g. expected this and got that).
|
// (e.g. expected this and got that).
|
||||||
|
|||||||
@ -37,7 +37,7 @@ import re
|
|||||||
|
|
||||||
from googletest.test import gtest_test_utils
|
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')
|
EXE_PATH = gtest_test_utils.GetTestExecutablePath('gtest_skip_test')
|
||||||
|
|
||||||
OUTPUT = gtest_test_utils.Subprocess([EXE_PATH]).output
|
OUTPUT = gtest_test_utils.Subprocess([EXE_PATH]).output
|
||||||
@ -55,6 +55,17 @@ class SkipEntireEnvironmentTest(gtest_test_utils.TestCase):
|
|||||||
)
|
)
|
||||||
self.assertNotIn('FAILED', OUTPUT)
|
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__':
|
if __name__ == '__main__':
|
||||||
gtest_test_utils.Main()
|
gtest_test_utils.Main()
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user