Improves EXPECT_DEATH_IF_SUPPORTED to allow streaming of messages and enforcing the validity of arguments (by Vlad Losev); adds samples for the event listener API (by Vlad Losev); simplifies the tests using EXPECT_DEATH_IF_SUPPORTED (by Zhanyong Wan).
This commit is contained in:
@@ -6345,16 +6345,14 @@ TEST(EventListenerTest, SuppressEventForwarding) {
|
||||
EXPECT_EQ(0, on_start_counter);
|
||||
}
|
||||
|
||||
#if GTEST_HAS_DEATH_TEST
|
||||
// Tests that events generated by Google Test are not forwarded in
|
||||
// death test subprocesses.
|
||||
TEST(EventListenerDeathTest, EventsNotForwardedInDeathTestSubprecesses) {
|
||||
EXPECT_DEATH({ // NOLINT
|
||||
EXPECT_DEATH_IF_SUPPORTED({
|
||||
GTEST_CHECK_(EventListenersAccessor::EventForwardingEnabled(
|
||||
*GetUnitTestImpl()->listeners())) << "expected failure";},
|
||||
"expected failure");
|
||||
}
|
||||
#endif // GTEST_HAS_DEATH_TEST
|
||||
|
||||
// Tests that a listener installed via SetDefaultResultPrinter() starts
|
||||
// receiving events and is returned via default_result_printer() and that
|
||||
|
||||
Reference in New Issue
Block a user