#include <stdlib.h>
#include <stdio.h>
#include "gtest/gtest.h"
#include "src/gtest-internal-inl.h"
Go to the source code of this file.
#define GTEST_IMPLEMENTATION_ 1 |
int main |
( |
int |
argc, |
|
|
char ** |
argv |
|
) |
| |
Definition at line 137 of file gtest_environment_test.cc.
References testing::AddGlobalTestEnvironment(), folly::pushmi::operators::filter, GTEST_FLAG, testing::InitGoogleTest(), and RunAllTests().
142 MyEnvironment*
const env =
new MyEnvironment;
144 "AddGlobalTestEnvironment() should return its argument.");
149 "RUN_ALL_TESTS() should return non-zero, as the global tear-down " 150 "should generate a failure.");
152 "The tests should run, as the global set-up should generate no " 154 Check(env->tear_down_was_run(),
155 "The global tear-down should run, as the global set-up was run.");
160 "RUN_ALL_TESTS() should return non-zero, as both the global set-up " 161 "and the global tear-down should generate a non-fatal failure.");
163 "The tests should run, as the global set-up should generate no " 165 Check(env->tear_down_was_run(),
166 "The global tear-down should run, as the global set-up was run.");
171 "RUN_ALL_TESTS() should return non-zero, as the global set-up " 172 "should generate a fatal failure.");
174 "The tests should not run, as the global set-up should generate " 176 Check(env->tear_down_was_run(),
177 "The global tear-down should run, as the global set-up was run.");
183 "RUN_ALL_TESTS() should return zero, as there is no test to run.");
184 Check(!env->set_up_was_run(),
185 "The global set-up should not run, as there is no test to run.");
186 Check(!env->tear_down_was_run(),
187 "The global tear-down should not run, " 188 "as the global set-up was not run.");
PUSHMI_INLINE_VAR constexpr detail::filter_fn filter
Environment * AddGlobalTestEnvironment(Environment *env)
GTEST_API_ void InitGoogleTest(int *argc, char **argv)