aboutsummaryrefslogtreecommitdiffstats
path: root/test/gtest_output_test_.cc
diff options
context:
space:
mode:
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.