summaryrefslogtreecommitdiffstats
path: root/googletest/src
diff options
context:
space:
mode:
authorAbseil Team <absl-team@google.com>2023-06-15 14:52:03 (GMT)
committerCopybara-Service <copybara-worker@google.com>2023-06-15 14:52:45 (GMT)
commit18fa6a4db32a30675c0b19bf72f8b5f693d21a23 (patch)
treeb2a54fb18d5454cb218edb73dc2b1759d375c3e2 /googletest/src
parent4c7aee827e16aa338189b88f6e3aa6d3d927dba4 (diff)
downloadgoogletest-18fa6a4db32a30675c0b19bf72f8b5f693d21a23.zip
googletest-18fa6a4db32a30675c0b19bf72f8b5f693d21a23.tar.gz
googletest-18fa6a4db32a30675c0b19bf72f8b5f693d21a23.tar.bz2
Allow clients to un-suppress output from gUnit EXPECT_EXIT tests.
This is useful for running individual tests in a separate process, which is useful for testing e.g. flag changes which have a process-global effect. PiperOrigin-RevId: 540580573 Change-Id: I18a5d24d79425a9d595be3369efc44e2f655f6f8
Diffstat (limited to 'googletest/src')
-rw-r--r--googletest/src/gtest-death-test.cc2
-rw-r--r--googletest/src/gtest.cc6
2 files changed, 4 insertions, 4 deletions
diff --git a/googletest/src/gtest-death-test.cc b/googletest/src/gtest-death-test.cc
index 4cf78e7..0eb6e38 100644
--- a/googletest/src/gtest-death-test.cc
+++ b/googletest/src/gtest-death-test.cc
@@ -1128,7 +1128,7 @@ DeathTest::TestRole NoExecDeathTest::AssumeRole() {
LogToStderr();
// Event forwarding to the listeners of event listener API mush be shut
// down in death test subprocesses.
- GetUnitTestImpl()->listeners()->SuppressEventForwarding();
+ GetUnitTestImpl()->listeners()->SuppressEventForwarding(true);
g_in_fast_death_test_child = true;
return EXECUTE_TEST;
} else {
diff --git a/googletest/src/gtest.cc b/googletest/src/gtest.cc
index a88ac25..d9fd277 100644
--- a/googletest/src/gtest.cc
+++ b/googletest/src/gtest.cc
@@ -5156,8 +5156,8 @@ bool TestEventListeners::EventForwardingEnabled() const {
return repeater_->forwarding_enabled();
}
-void TestEventListeners::SuppressEventForwarding() {
- repeater_->set_forwarding_enabled(false);
+void TestEventListeners::SuppressEventForwarding(bool suppress) {
+ repeater_->set_forwarding_enabled(!suppress);
}
// class UnitTest
@@ -5635,7 +5635,7 @@ void UnitTestImpl::RecordProperty(const TestProperty& test_property) {
// subprocess. Must not be called before InitGoogleTest.
void UnitTestImpl::SuppressTestEventsIfInSubprocess() {
if (internal_run_death_test_flag_ != nullptr)
- listeners()->SuppressEventForwarding();
+ listeners()->SuppressEventForwarding(true);
}
#endif // GTEST_HAS_DEATH_TEST