A convenient wrapper for adding an environment for the test program. You should call this before RUN_ALL_TESTS() is called, probably in main(). If you use gtest_main, you need to call this before main() starts for it to take effect. For example, you can define a global variable like this: testing::Environment* const foo_env = testing::AddGlobalTestEnvironment(new FooEnvironment); However, we
| 13912 | // (remember that the compiler doesn't guarantee the order in which |
| 13913 | // global variables from different translation units are initialized). |
| 13914 | inline Environment* AddGlobalTestEnvironment(Environment* env) { |
| 13915 | return UnitTest::GetInstance()->AddEnvironment(env); |
| 13916 | } |
| 13917 | |
| 13918 | // Initializes Google Test. This must be called before calling |
| 13919 | // RUN_ALL_TESTS(). In particular, it parses a command line for the |
nothing calls this directly
no test coverage detected