Adds tests for EXPECT_FATAL_FAILURE and reduces the golden file bloat (by Zhanyong Wan). Fixes more warnings on Windows (by Vlad Losev).

This commit is contained in:
zhanyong.wan
2009-02-06 00:47:20 +00:00
parent ad99ca1446
commit 3750499433
7 changed files with 119 additions and 98 deletions

View File

@@ -60,6 +60,8 @@
using testing::ScopedFakeTestPartResultReporter;
using testing::TestPartResultArray;
using testing::internal::String;
// Tests catching fatal failures.
// A subroutine used by the following test.
@@ -958,6 +960,10 @@ class BarEnvironment : public testing::Environment {
}
};
GTEST_DEFINE_bool_(internal_skip_environment_and_ad_hoc_tests, false,
"This flag causes the program to skip test environment "
"tests and ad hoc tests.");
// The main function.
//
// The idea is to use Google Test to run all the tests we have defined (some
@@ -968,6 +974,9 @@ int main(int argc, char **argv) {
// We will use a separate Python script to compare the output of
// this program with the golden file.
testing::InitGoogleTest(&argc, argv);
if (argc >= 2 &&
String(argv[1]) == "--gtest_internal_skip_environment_and_ad_hoc_tests")
GTEST_FLAG(internal_skip_environment_and_ad_hoc_tests) = true;
#ifdef GTEST_HAS_DEATH_TEST
if (testing::internal::GTEST_FLAG(internal_run_death_test) != "") {
@@ -978,6 +987,9 @@ int main(int argc, char **argv) {
}
#endif // GTEST_HAS_DEATH_TEST
if (GTEST_FLAG(internal_skip_environment_and_ad_hoc_tests))
return RUN_ALL_TESTS();
// Registers two global test environments.
// The golden file verifies that they are set up in the order they
// are registered, and torn down in the reverse order.