summaryrefslogtreecommitdiff
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
commite0ca02f7b4175a1c21f7416039f9f06c028b544a (patch)
treea7c84a0c95dd0bb3af5e23cd4cce7dba4c4bc8f2 /test/gtest_output_test_.cc
parent0ebc16a68eea644a9f8a718fbdef95112a4a0ff2 (diff)
downloadgoogletest-e0ca02f7b4175a1c21f7416039f9f06c028b544a.tar.gz
Adds tests for EXPECT_FATAL_FAILURE and reduces the golden file bloat (by Zhanyong Wan). Fixes more warnings on Windows (by Vlad Losev).
git-svn-id: http://googletest.googlecode.com/svn/trunk@185 861a406c-534a-0410-8894-cb66d6ee9925
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 31a0672..5c76609 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.