Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
googletest
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Chen Yisong
googletest
Commits
82cc1d11
Commit
82cc1d11
authored
Oct 26, 2010
by
vladlosev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Changes default of --gtest_catch_exceptions to true.
parent
25958f3e
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
15 additions
and
15 deletions
+15
-15
gtest.cc
src/gtest.cc
+4
-3
gtest_catch_exceptions_test.py
test/gtest_catch_exceptions_test.py
+9
-8
gtest_env_var_test.py
test/gtest_env_var_test.py
+1
-3
gtest_help_test.py
test/gtest_help_test.py
+1
-1
No files found.
src/gtest.cc
View file @
82cc1d11
...
@@ -191,7 +191,7 @@ GTEST_DEFINE_bool_(
...
@@ -191,7 +191,7 @@ GTEST_DEFINE_bool_(
GTEST_DEFINE_bool_
(
GTEST_DEFINE_bool_
(
catch_exceptions
,
catch_exceptions
,
internal
::
BoolFromGTestEnv
(
"catch_exceptions"
,
fals
e
),
internal
::
BoolFromGTestEnv
(
"catch_exceptions"
,
tru
e
),
"True iff "
GTEST_NAME_
"True iff "
GTEST_NAME_
" should catch exceptions and treat them as test failures."
);
" should catch exceptions and treat them as test failures."
);
...
@@ -4711,8 +4711,9 @@ static const char kColorEncodedHelpMessage[] =
...
@@ -4711,8 +4711,9 @@ static const char kColorEncodedHelpMessage[] =
" Turn assertion failures into debugger break-points.
\n
"
" Turn assertion failures into debugger break-points.
\n
"
" @G--"
GTEST_FLAG_PREFIX_
"throw_on_failure@D
\n
"
" @G--"
GTEST_FLAG_PREFIX_
"throw_on_failure@D
\n
"
" Turn assertion failures into C++ exceptions.
\n
"
" Turn assertion failures into C++ exceptions.
\n
"
" @G--"
GTEST_FLAG_PREFIX_
"catch_exceptions@D
\n
"
" @G--"
GTEST_FLAG_PREFIX_
"catch_exceptions=0@D
\n
"
" Suppress pop-ups caused by exceptions.
\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
"
"
\n
"
"Except for @G--"
GTEST_FLAG_PREFIX_
"list_tests@D, you can alternatively set "
"Except for @G--"
GTEST_FLAG_PREFIX_
"list_tests@D, you can alternatively set "
"the corresponding
\n
"
"the corresponding
\n
"
...
...
test/gtest_catch_exceptions_test.py
View file @
82cc1d11
...
@@ -42,9 +42,10 @@ import os
...
@@ -42,9 +42,10 @@ import os
import
gtest_test_utils
import
gtest_test_utils
# Constants.
# Constants.
LIST_TESTS_FLAG
=
'--gtest_list_tests'
FLAG_PREFIX
=
'--gtest_'
CATCH_EXCEPTIONS_FLAG
=
'--gtest_catch_exceptions=1'
LIST_TESTS_FLAG
=
FLAG_PREFIX
+
'list_tests'
FILTER_FLAG
=
'--gtest_filter'
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
# Path to the gtest_catch_exceptions_ex_test_ binary, compiled with
# exceptions enabled.
# exceptions enabled.
...
@@ -61,11 +62,9 @@ TEST_LIST = gtest_test_utils.Subprocess([EXE_PATH, LIST_TESTS_FLAG]).output
...
@@ -61,11 +62,9 @@ TEST_LIST = gtest_test_utils.Subprocess([EXE_PATH, LIST_TESTS_FLAG]).output
SUPPORTS_SEH_EXCEPTIONS
=
'ThrowsSehException'
in
TEST_LIST
SUPPORTS_SEH_EXCEPTIONS
=
'ThrowsSehException'
in
TEST_LIST
if
SUPPORTS_SEH_EXCEPTIONS
:
if
SUPPORTS_SEH_EXCEPTIONS
:
BINARY_OUTPUT
=
gtest_test_utils
.
Subprocess
([
EXE_PATH
,
BINARY_OUTPUT
=
gtest_test_utils
.
Subprocess
([
EXE_PATH
])
.
output
CATCH_EXCEPTIONS_FLAG
])
.
output
EX_BINARY_OUTPUT
=
gtest_test_utils
.
Subprocess
([
EX_EXE_PATH
,
EX_BINARY_OUTPUT
=
gtest_test_utils
.
Subprocess
([
EX_EXE_PATH
])
.
output
CATCH_EXCEPTIONS_FLAG
])
.
output
# The tests.
# The tests.
if
SUPPORTS_SEH_EXCEPTIONS
:
if
SUPPORTS_SEH_EXCEPTIONS
:
...
@@ -208,7 +207,9 @@ class CatchCxxExceptionsTest(gtest_test_utils.TestCase):
...
@@ -208,7 +207,9 @@ class CatchCxxExceptionsTest(gtest_test_utils.TestCase):
FITLER_OUT_SEH_TESTS_FLAG
=
FILTER_FLAG
+
'=-*Seh*'
FITLER_OUT_SEH_TESTS_FLAG
=
FILTER_FLAG
+
'=-*Seh*'
# By default, Google Test doesn't catch the exceptions.
# By default, Google Test doesn't catch the exceptions.
uncaught_exceptions_ex_binary_output
=
gtest_test_utils
.
Subprocess
(
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'
self
.
assert_
(
'Unhandled C++ exception terminating the program'
in
uncaught_exceptions_ex_binary_output
)
in
uncaught_exceptions_ex_binary_output
)
...
...
test/gtest_env_var_test.py
View file @
82cc1d11
...
@@ -92,9 +92,7 @@ class GTestEnvVarTest(gtest_test_utils.TestCase):
...
@@ -92,9 +92,7 @@ class GTestEnvVarTest(gtest_test_utils.TestCase):
TestFlag
(
'repeat'
,
'999'
,
'1'
)
TestFlag
(
'repeat'
,
'999'
,
'1'
)
TestFlag
(
'throw_on_failure'
,
'1'
,
'0'
)
TestFlag
(
'throw_on_failure'
,
'1'
,
'0'
)
TestFlag
(
'death_test_style'
,
'threadsafe'
,
'fast'
)
TestFlag
(
'death_test_style'
,
'threadsafe'
,
'fast'
)
TestFlag
(
'catch_exceptions'
,
'0'
,
'1'
)
if
IS_WINDOWS
:
TestFlag
(
'catch_exceptions'
,
'1'
,
'0'
)
if
IS_LINUX
:
if
IS_LINUX
:
TestFlag
(
'death_test_use_fork'
,
'1'
,
'0'
)
TestFlag
(
'death_test_use_fork'
,
'1'
,
'0'
)
...
...
test/gtest_help_test.py
View file @
82cc1d11
...
@@ -74,7 +74,7 @@ HELP_REGEX = re.compile(
...
@@ -74,7 +74,7 @@ HELP_REGEX = re.compile(
FLAG_PREFIX
+
r'output=.*'
+
FLAG_PREFIX
+
r'output=.*'
+
FLAG_PREFIX
+
r'break_on_failure.*'
+
FLAG_PREFIX
+
r'break_on_failure.*'
+
FLAG_PREFIX
+
r'throw_on_failure.*'
+
FLAG_PREFIX
+
r'throw_on_failure.*'
+
FLAG_PREFIX
+
r'catch_exceptions.*'
,
FLAG_PREFIX
+
r'catch_exceptions
=0
.*'
,
re
.
DOTALL
)
re
.
DOTALL
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment