summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorvladlosev <vladlosev@861a406c-534a-0410-8894-cb66d6ee9925>2010-10-26 23:12:47 (GMT)
committervladlosev <vladlosev@861a406c-534a-0410-8894-cb66d6ee9925>2010-10-26 23:12:47 (GMT)
commit82cc1d1135879be3b901a10e224dbd827365f8bf (patch)
tree490d88c5462527cf7bed5df3ee6a3fcafc204a37
parent25958f3e4c4097caca8347b7937f5f6fb26d6c56 (diff)
downloadgoogletest-82cc1d1135879be3b901a10e224dbd827365f8bf.zip
googletest-82cc1d1135879be3b901a10e224dbd827365f8bf.tar.gz
googletest-82cc1d1135879be3b901a10e224dbd827365f8bf.tar.bz2
Changes default of --gtest_catch_exceptions to true.
-rw-r--r--src/gtest.cc7
-rwxr-xr-xtest/gtest_catch_exceptions_test.py17
-rwxr-xr-xtest/gtest_env_var_test.py4
-rwxr-xr-xtest/gtest_help_test.py2
4 files changed, 15 insertions, 15 deletions
diff --git a/src/gtest.cc b/src/gtest.cc
index ea3a47c..ba27bba 100644
--- a/src/gtest.cc
+++ b/src/gtest.cc
@@ -191,7 +191,7 @@ GTEST_DEFINE_bool_(
GTEST_DEFINE_bool_(
catch_exceptions,
- internal::BoolFromGTestEnv("catch_exceptions", false),
+ internal::BoolFromGTestEnv("catch_exceptions", true),
"True iff " GTEST_NAME_
" should catch exceptions and treat them as test failures.");
@@ -4711,8 +4711,9 @@ static const char kColorEncodedHelpMessage[] =
" Turn assertion failures into debugger break-points.\n"
" @G--" GTEST_FLAG_PREFIX_ "throw_on_failure@D\n"
" Turn assertion failures into C++ exceptions.\n"
-" @G--" GTEST_FLAG_PREFIX_ "catch_exceptions@D\n"
-" Suppress pop-ups caused by exceptions.\n"
+" @G--" GTEST_FLAG_PREFIX_ "catch_exceptions=0@D\n"
+" Do not report exceptions as test failures. Instead, allow them\n"
+" to crash the program or throw a pop-up (on Windows).\n"
"\n"
"Except for @G--" GTEST_FLAG_PREFIX_ "list_tests@D, you can alternatively set "
"the corresponding\n"
diff --git a/test/gtest_catch_exceptions_test.py b/test/gtest_catch_exceptions_test.py
index 061c5c3..7fd7dba 100755
--- a/test/gtest_catch_exceptions_test.py
+++ b/test/gtest_catch_exceptions_test.py
@@ -42,9 +42,10 @@ import os
import gtest_test_utils
# Constants.
-LIST_TESTS_FLAG = '--gtest_list_tests'
-CATCH_EXCEPTIONS_FLAG = '--gtest_catch_exceptions=1'
-FILTER_FLAG='--gtest_filter'
+FLAG_PREFIX = '--gtest_'
+LIST_TESTS_FLAG = FLAG_PREFIX + 'list_tests'
+NO_CATCH_EXCEPTIONS_FLAG = FLAG_PREFIX + 'catch_exceptions=0'
+FILTER_FLAG = FLAG_PREFIX + 'filter'
# Path to the gtest_catch_exceptions_ex_test_ binary, compiled with
# exceptions enabled.
@@ -61,11 +62,9 @@ TEST_LIST = gtest_test_utils.Subprocess([EXE_PATH, LIST_TESTS_FLAG]).output
SUPPORTS_SEH_EXCEPTIONS = 'ThrowsSehException' in TEST_LIST
if SUPPORTS_SEH_EXCEPTIONS:
- BINARY_OUTPUT = gtest_test_utils.Subprocess([EXE_PATH,
- CATCH_EXCEPTIONS_FLAG]).output
+ BINARY_OUTPUT = gtest_test_utils.Subprocess([EXE_PATH]).output
-EX_BINARY_OUTPUT = gtest_test_utils.Subprocess([EX_EXE_PATH,
- CATCH_EXCEPTIONS_FLAG]).output
+EX_BINARY_OUTPUT = gtest_test_utils.Subprocess([EX_EXE_PATH]).output
# The tests.
if SUPPORTS_SEH_EXCEPTIONS:
@@ -208,7 +207,9 @@ class CatchCxxExceptionsTest(gtest_test_utils.TestCase):
FITLER_OUT_SEH_TESTS_FLAG = FILTER_FLAG + '=-*Seh*'
# By default, Google Test doesn't catch the exceptions.
uncaught_exceptions_ex_binary_output = gtest_test_utils.Subprocess(
- [EX_EXE_PATH, FITLER_OUT_SEH_TESTS_FLAG]).output
+ [EX_EXE_PATH,
+ NO_CATCH_EXCEPTIONS_FLAG,
+ FITLER_OUT_SEH_TESTS_FLAG]).output
self.assert_('Unhandled C++ exception terminating the program'
in uncaught_exceptions_ex_binary_output)
diff --git a/test/gtest_env_var_test.py b/test/gtest_env_var_test.py
index bcc0bfd..ac24337 100755
--- a/test/gtest_env_var_test.py
+++ b/test/gtest_env_var_test.py
@@ -92,9 +92,7 @@ class GTestEnvVarTest(gtest_test_utils.TestCase):
TestFlag('repeat', '999', '1')
TestFlag('throw_on_failure', '1', '0')
TestFlag('death_test_style', 'threadsafe', 'fast')
-
- if IS_WINDOWS:
- TestFlag('catch_exceptions', '1', '0')
+ TestFlag('catch_exceptions', '0', '1')
if IS_LINUX:
TestFlag('death_test_use_fork', '1', '0')
diff --git a/test/gtest_help_test.py b/test/gtest_help_test.py
index 0777106..093c838 100755
--- a/test/gtest_help_test.py
+++ b/test/gtest_help_test.py
@@ -74,7 +74,7 @@ HELP_REGEX = re.compile(
FLAG_PREFIX + r'output=.*' +
FLAG_PREFIX + r'break_on_failure.*' +
FLAG_PREFIX + r'throw_on_failure.*' +
- FLAG_PREFIX + r'catch_exceptions.*',
+ FLAG_PREFIX + r'catch_exceptions=0.*',
re.DOTALL)