Lines Matching +full:generate +full:- +full:env
37 #include "src/gtest-internal-inl.h"
49 // generate a non-fatal failure, generate a fatal failure, or
56 ADD_FAILURE() << "Expected non-fatal failure in global set-up."; in SetUp()
59 FAIL() << "Expected fatal failure in global set-up."; in SetUp()
66 // Generates a non-fatal failure.
69 ADD_FAILURE() << "Expected non-fatal failure in global tear-down."; in TearDown()
80 // generate.
113 // be generated by the global set-up.
114 int RunAllTests(MyEnvironment* env, FailureType failure) { in RunAllTests() argument
115 env->Reset(); in RunAllTests()
116 env->set_failure_in_set_up(failure); in RunAllTests()
118 testing::internal::GetUnitTestImpl()->ClearAdHocTestResult(); in RunAllTests()
129 MyEnvironment* const env = new MyEnvironment; in main() local
130 Check(testing::AddGlobalTestEnvironment(env) == env, in main()
134 // set-up is successful. in main()
135 Check(RunAllTests(env, NO_FAILURE) != 0, in main()
136 "RUN_ALL_TESTS() should return non-zero, as the global tear-down " in main()
137 "should generate a failure."); in main()
139 "The tests should run, as the global set-up should generate no " in main()
141 Check(env->tear_down_was_run(), in main()
142 "The global tear-down should run, as the global set-up was run."); in main()
145 // set-up generates no fatal failure. in main()
146 Check(RunAllTests(env, NON_FATAL_FAILURE) != 0, in main()
147 "RUN_ALL_TESTS() should return non-zero, as both the global set-up " in main()
148 "and the global tear-down should generate a non-fatal failure."); in main()
150 "The tests should run, as the global set-up should generate no " in main()
152 Check(env->tear_down_was_run(), in main()
153 "The global tear-down should run, as the global set-up was run."); in main()
155 // Verifies that RUN_ALL_TESTS() runs no test when the global set-up in main()
157 Check(RunAllTests(env, FATAL_FAILURE) != 0, in main()
158 "RUN_ALL_TESTS() should return non-zero, as the global set-up " in main()
159 "should generate a fatal failure."); in main()
161 "The tests should not run, as the global set-up should generate " in main()
163 Check(env->tear_down_was_run(), in main()
164 "The global tear-down should run, as the global set-up was run."); in main()
166 // Verifies that RUN_ALL_TESTS() doesn't do global set-up or in main()
167 // tear-down when there is no test to run. in main()
168 GTEST_FLAG_SET(filter, "-*"); in main()
169 Check(RunAllTests(env, NO_FAILURE) == 0, in main()
171 Check(!env->set_up_was_run(), in main()
172 "The global set-up should not run, as there is no test to run."); in main()
173 Check(!env->tear_down_was_run(), in main()
174 "The global tear-down should not run, " in main()
175 "as the global set-up was not run."); in main()