aboutsummaryrefslogtreecommitdiffstats
path: root/test/gtest_output_test_.cc
diff options
context:
space:
mode:
authorzhanyong.wan <zhanyong.wan@861a406c-534a-0410-8894-cb66d6ee9925>2009-02-06 00:47:20 +0000
committerzhanyong.wan <zhanyong.wan@861a406c-534a-0410-8894-cb66d6ee9925>2009-02-06 00:47:20 +0000
commit37504994338c114247519331237831f88a9a7c40 (patch)
treea7c84a0c95dd0bb3af5e23cd4cce7dba4c4bc8f2 /test/gtest_output_test_.cc
parentad99ca14461f0e929d835d29518e11c05e8d41f0 (diff)
downloadgoogletest-37504994338c114247519331237831f88a9a7c40.tar.gz
googletest-37504994338c114247519331237831f88a9a7c40.tar.bz2
googletest-37504994338c114247519331237831f88a9a7c40.zip
Adds tests for EXPECT_FATAL_FAILURE and reduces the golden file bloat (by Zhanyong Wan). Fixes more warnings on Windows (by Vlad Losev).
Diffstat (limited to 'test/gtest_output_test_.cc')
-rw-r--r--test/gtest_output_test_.cc12
1 files changed, 12 insertions, 0 deletions
diff --git a/test/gtest_output_test_.cc b/test/gtest_output_test_.cc
index 31a0672f..5c76609f 100644
--- a/test/gtest_output_test_.cc
+++ b/test/gtest_output_test_.cc
@@ -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.