diff options
author | kaswhy <sxshx818@naver.com> | 2023-12-28 17:05:18 (GMT) |
---|---|---|
committer | kaswhy <sxshx818@naver.com> | 2023-12-28 17:05:18 (GMT) |
commit | dda72ef32181edbfcd32a8c52b4740cd8061ab6f (patch) | |
tree | c1587e889fdf0ea6f21d5c519b68222b6f88b67e /docs | |
parent | dddb219c3eb96d7f9200f09b0a381f016e6b4562 (diff) | |
download | googletest-dda72ef32181edbfcd32a8c52b4740cd8061ab6f.zip googletest-dda72ef32181edbfcd32a8c52b4740cd8061ab6f.tar.gz googletest-dda72ef32181edbfcd32a8c52b4740cd8061ab6f.tar.bz2 |
Docs: add conditions for calling TearDown()
Diffstat (limited to 'docs')
-rw-r--r-- | docs/advanced.md | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/docs/advanced.md b/docs/advanced.md index 0e1f812..8e1df2a 100644 --- a/docs/advanced.md +++ b/docs/advanced.md @@ -1006,9 +1006,12 @@ Environment* AddGlobalTestEnvironment(Environment* env); Now, when `RUN_ALL_TESTS()` is called, it first calls the `SetUp()` method of each environment object, then runs the tests if none of the environments -reported fatal failures and `GTEST_SKIP()` was not called. `RUN_ALL_TESTS()` -always calls `TearDown()` with each environment object, regardless of whether or -not the tests were run. +reported fatal failures and `GTEST_SKIP()` was not called. + +RUN_ALL_TESTS() calls TearDown() for each environment object when they are recreated +for each iteration. However, if the test environments are not recreated for each iteration, +TearDown() is called only on the last iteration. +Additionally, TearDown() is executed regardless of whether the tests were run or not. It's OK to register multiple environment objects. In this suite, their `SetUp()` will be called in the order they are registered, and their `TearDown()` will be |