summaryrefslogtreecommitdiffstats
path: root/googletest/src/gtest.cc
diff options
context:
space:
mode:
authorAbseil Team <absl-team@google.com>2022-01-25 07:46:09 (GMT)
committerCopybara-Service <copybara-worker@google.com>2022-01-25 07:46:52 (GMT)
commitf45d5865ed0b2b8912244627cdf508a24cc6ccb4 (patch)
treec4ca7a44bcc7083f9b5d359398b51d1e6a5c804e /googletest/src/gtest.cc
parent7eae8de0da5774fa08ce350d9d470901b76b2834 (diff)
downloadgoogletest-f45d5865ed0b2b8912244627cdf508a24cc6ccb4.zip
googletest-f45d5865ed0b2b8912244627cdf508a24cc6ccb4.tar.gz
googletest-f45d5865ed0b2b8912244627cdf508a24cc6ccb4.tar.bz2
Make recreate_environments_when_repeating=false the default.
So that global test environments are by default set up and torn down once, regardless of the value of the repeat flag. The point of global environments is to be set up and torn down once, and shared by all tests in the process. There is no obvious reason why multiple runs of the same test should be treated distinctly from single runs of different tests. Having this be false by default means that repeats using a global environment run faster. It can still be set to true if it's desired that every repeat get a fresh environment, but this seems less important given the nature of a global environment. Every test I've seen using a global environment uses it to set up some expensive external resource, not something that can/should be set up for each test anew. (Again this is unsurprising, since the environment is a global.) PiperOrigin-RevId: 424003937 Change-Id: I9e8a825cb8900960dd65b85fe5ffcc0a337e57f3
Diffstat (limited to 'googletest/src/gtest.cc')
-rw-r--r--googletest/src/gtest.cc2
1 files changed, 1 insertions, 1 deletions
diff --git a/googletest/src/gtest.cc b/googletest/src/gtest.cc
index f8a291a..04266dc 100644
--- a/googletest/src/gtest.cc
+++ b/googletest/src/gtest.cc
@@ -317,7 +317,7 @@ GTEST_DEFINE_int32_(
GTEST_DEFINE_bool_(
recreate_environments_when_repeating,
testing::internal::BoolFromGTestEnv("recreate_environments_when_repeating",
- true),
+ false),
"Controls whether global test environments are recreated for each repeat "
"of the tests. If set to false the global test environments are only set "
"up once, for the first iteration, and only torn down once, for the last. "