Commit 9d77e63e authored by Tanzinul Islam's avatar Tanzinul Islam
Browse files

Merge branch 'master' into fix_death_test_child_mingw_wer_issue1116

parents 1cd979a8 e82d3205
...@@ -26,8 +26,7 @@ ...@@ -26,8 +26,7 @@
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//
// Author: wan@google.com (Zhanyong Wan)
// Google Mock - a framework for writing C++ mock classes. // Google Mock - a framework for writing C++ mock classes.
// //
...@@ -1176,7 +1175,7 @@ TEST(UnexpectedCallTest, UnsatisifiedPrerequisites) { ...@@ -1176,7 +1175,7 @@ TEST(UnexpectedCallTest, UnsatisifiedPrerequisites) {
TEST(UndefinedReturnValueTest, TEST(UndefinedReturnValueTest,
ReturnValueIsMandatoryWhenNotDefaultConstructible) { ReturnValueIsMandatoryWhenNotDefaultConstructible) {
MockA a; MockA a;
// TODO(wan@google.com): We should really verify the output message, // FIXME: We should really verify the output message,
// but we cannot yet due to that EXPECT_DEATH only captures stderr // but we cannot yet due to that EXPECT_DEATH only captures stderr
// while Google Mock logs to stdout. // while Google Mock logs to stdout.
#if GTEST_HAS_EXCEPTIONS #if GTEST_HAS_EXCEPTIONS
......
...@@ -26,8 +26,7 @@ ...@@ -26,8 +26,7 @@
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//
// Author: wan@google.com (Zhanyong Wan)
// //
// Tests for Google C++ Mocking Framework (Google Mock) // Tests for Google C++ Mocking Framework (Google Mock)
// //
......
...@@ -26,8 +26,7 @@ ...@@ -26,8 +26,7 @@
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//
// Author: wan@google.com (Zhanyong Wan)
// Tests Google Mock's functionality that depends on exceptions. // Tests Google Mock's functionality that depends on exceptions.
......
...@@ -31,8 +31,6 @@ ...@@ -31,8 +31,6 @@
"""Tests that leaked mock objects can be caught be Google Mock.""" """Tests that leaked mock objects can be caught be Google Mock."""
__author__ = 'wan@google.com (Zhanyong Wan)'
import gmock_test_utils import gmock_test_utils
PROGRAM_PATH = gmock_test_utils.GetTestExecutablePath('gmock_leak_test_') PROGRAM_PATH = gmock_test_utils.GetTestExecutablePath('gmock_leak_test_')
......
...@@ -26,8 +26,7 @@ ...@@ -26,8 +26,7 @@
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//
// Author: wan@google.com (Zhanyong Wan)
// Google Mock - a framework for writing C++ mock classes. // Google Mock - a framework for writing C++ mock classes.
// //
......
...@@ -26,8 +26,7 @@ ...@@ -26,8 +26,7 @@
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//
// Author: wan@google.com (Zhanyong Wan), vladl@google.com (Vlad Losev)
// Google Mock - a framework for writing C++ mock classes. // Google Mock - a framework for writing C++ mock classes.
// //
......
...@@ -26,8 +26,7 @@ ...@@ -26,8 +26,7 @@
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//
// Author: wan@google.com (Zhanyong Wan), vladl@google.com (Vlad Losev)
// Google Mock - a framework for writing C++ mock classes. // Google Mock - a framework for writing C++ mock classes.
// //
......
...@@ -26,8 +26,7 @@ ...@@ -26,8 +26,7 @@
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//
// Author: vladl@google.com (Vlad Losev)
// Google Mock - a framework for writing C++ mock classes. // Google Mock - a framework for writing C++ mock classes.
// //
......
...@@ -29,16 +29,15 @@ ...@@ -29,16 +29,15 @@
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
"""Tests the text output of Google C++ Mocking Framework. r"""Tests the text output of Google C++ Mocking Framework.
To update the golden file: To update the golden file:
gmock_output_test.py --build_dir=BUILD/DIR --gengolden gmock_output_test.py --build_dir=BUILD/DIR --gengolden
# where BUILD/DIR contains the built gmock_output_test_ file. where BUILD/DIR contains the built gmock_output_test_ file.
gmock_output_test.py --gengolden gmock_output_test.py --gengolden
gmock_output_test.py gmock_output_test.py
"""
__author__ = 'wan@google.com (Zhanyong Wan)' """
import os import os
import re import re
......
...@@ -26,8 +26,7 @@ ...@@ -26,8 +26,7 @@
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//
// Author: wan@google.com (Zhanyong Wan)
// Tests Google Mock's output in various scenarios. This ensures that // Tests Google Mock's output in various scenarios. This ensures that
// Google Mock's messages are readable and useful. // Google Mock's messages are readable and useful.
......
...@@ -26,8 +26,7 @@ ...@@ -26,8 +26,7 @@
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//
// Author: wan@google.com (Zhanyong Wan)
// Tests that Google Mock constructs can be used in a large number of // Tests that Google Mock constructs can be used in a large number of
// threads concurrently. // threads concurrently.
......
...@@ -26,8 +26,7 @@ ...@@ -26,8 +26,7 @@
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//
// Author: wan@google.com (Zhanyong Wan)
// Google Mock - a framework for writing C++ mock classes. // Google Mock - a framework for writing C++ mock classes.
// //
......
...@@ -29,8 +29,6 @@ ...@@ -29,8 +29,6 @@
"""Unit test utilities for Google C++ Mocking Framework.""" """Unit test utilities for Google C++ Mocking Framework."""
__author__ = 'wan@google.com (Zhanyong Wan)'
import os import os
import sys import sys
......
...@@ -5,10 +5,6 @@ ...@@ -5,10 +5,6 @@
# ctest. You can select which tests to run using 'ctest -R regex'. # ctest. You can select which tests to run using 'ctest -R regex'.
# For more options, run 'ctest --help'. # For more options, run 'ctest --help'.
# BUILD_SHARED_LIBS is a standard CMake variable, but we declare it here to
# make it prominent in the GUI.
option(BUILD_SHARED_LIBS "Build shared libraries (DLLs)." OFF)
# When other libraries are using a shared version of runtime libraries, # When other libraries are using a shared version of runtime libraries,
# Google Test also has to use one. # Google Test also has to use one.
option( option(
...@@ -60,6 +56,25 @@ if (COMMAND set_up_hermetic_build) ...@@ -60,6 +56,25 @@ if (COMMAND set_up_hermetic_build)
set_up_hermetic_build() set_up_hermetic_build()
endif() endif()
# These commands only run if this is the main project
if(CMAKE_PROJECT_NAME STREQUAL "gtest" OR CMAKE_PROJECT_NAME STREQUAL "googletest-distribution")
# BUILD_SHARED_LIBS is a standard CMake variable, but we declare it here to
# make it prominent in the GUI.
option(BUILD_SHARED_LIBS "Build shared libraries (DLLs)." OFF)
else()
mark_as_advanced(
gtest_force_shared_crt
gtest_build_tests
gtest_build_samples
gtest_disable_pthreads
gtest_hide_internal_symbols)
endif()
if (gtest_hide_internal_symbols) if (gtest_hide_internal_symbols)
set(CMAKE_CXX_VISIBILITY_PRESET hidden) set(CMAKE_CXX_VISIBILITY_PRESET hidden)
set(CMAKE_VISIBILITY_INLINES_HIDDEN 1) set(CMAKE_VISIBILITY_INLINES_HIDDEN 1)
...@@ -86,7 +101,7 @@ include_directories( ...@@ -86,7 +101,7 @@ include_directories(
if (MSVC AND MSVC_VERSION EQUAL 1700) if (MSVC AND MSVC_VERSION EQUAL 1700)
add_definitions(/D _VARIADIC_MAX=10) add_definitions(/D _VARIADIC_MAX=10)
endif() endif()
######################################################################## ########################################################################
# #
# Defines the gtest & gtest_main libraries. User tests should link # Defines the gtest & gtest_main libraries. User tests should link
...@@ -121,13 +136,13 @@ if(INSTALL_GTEST) ...@@ -121,13 +136,13 @@ if(INSTALL_GTEST)
# configure and install pkgconfig files # configure and install pkgconfig files
configure_file( configure_file(
cmake/gtest.pc.in cmake/gtest.pc.in
"${CMAKE_BINARY_DIR}/gtest.pc" "${gtest_BINARY_DIR}/gtest.pc"
@ONLY) @ONLY)
configure_file( configure_file(
cmake/gtest_main.pc.in cmake/gtest_main.pc.in
"${CMAKE_BINARY_DIR}/gtest_main.pc" "${gtest_BINARY_DIR}/gtest_main.pc"
@ONLY) @ONLY)
install(FILES "${CMAKE_BINARY_DIR}/gtest.pc" "${CMAKE_BINARY_DIR}/gtest_main.pc" install(FILES "${gtest_BINARY_DIR}/gtest.pc" "${gtest_BINARY_DIR}/gtest_main.pc"
DESTINATION "${CMAKE_INSTALL_LIBDIR}/pkgconfig") DESTINATION "${CMAKE_INSTALL_LIBDIR}/pkgconfig")
endif() endif()
...@@ -171,28 +186,28 @@ if (gtest_build_tests) ...@@ -171,28 +186,28 @@ if (gtest_build_tests)
############################################################ ############################################################
# C++ tests built with standard compiler flags. # C++ tests built with standard compiler flags.
cxx_test(gtest-death-test_test gtest_main) cxx_test(googletest-death-test-test gtest_main)
cxx_test(gtest_environment_test gtest) cxx_test(gtest_environment_test gtest)
cxx_test(gtest-filepath_test gtest_main) cxx_test(googletest-filepath-test gtest_main)
cxx_test(gtest-linked_ptr_test gtest_main) cxx_test(googletest-linked-ptr-test gtest_main)
cxx_test(gtest-listener_test gtest_main) cxx_test(googletest-listener-test gtest_main)
cxx_test(gtest_main_unittest gtest_main) cxx_test(gtest_main_unittest gtest_main)
cxx_test(gtest-message_test gtest_main) cxx_test(googletest-message-test gtest_main)
cxx_test(gtest_no_test_unittest gtest) cxx_test(gtest_no_test_unittest gtest)
cxx_test(gtest-options_test gtest_main) cxx_test(googletest-options-test gtest_main)
cxx_test(gtest-param-test_test gtest cxx_test(googletest-param-test-test gtest
test/gtest-param-test2_test.cc) test/googletest-param-test2-test.cc)
cxx_test(gtest-port_test gtest_main) cxx_test(googletest-port-test gtest_main)
cxx_test(gtest_pred_impl_unittest gtest_main) cxx_test(gtest_pred_impl_unittest gtest_main)
cxx_test(gtest_premature_exit_test gtest cxx_test(gtest_premature_exit_test gtest
test/gtest_premature_exit_test.cc) test/gtest_premature_exit_test.cc)
cxx_test(gtest-printers_test gtest_main) cxx_test(googletest-printers-test gtest_main)
cxx_test(gtest_prod_test gtest_main cxx_test(gtest_prod_test gtest_main
test/production.cc) test/production.cc)
cxx_test(gtest_repeat_test gtest) cxx_test(gtest_repeat_test gtest)
cxx_test(gtest_sole_header_test gtest_main) cxx_test(gtest_sole_header_test gtest_main)
cxx_test(gtest_stress_test gtest) cxx_test(gtest_stress_test gtest)
cxx_test(gtest-test-part_test gtest_main) cxx_test(googletest-test-part-test gtest_main)
cxx_test(gtest_throw_on_failure_ex_test gtest) cxx_test(gtest_throw_on_failure_ex_test gtest)
cxx_test(gtest-typed-test_test gtest_main cxx_test(gtest-typed-test_test gtest_main
test/gtest-typed-test2_test.cc) test/gtest-typed-test2_test.cc)
...@@ -214,10 +229,10 @@ if (gtest_build_tests) ...@@ -214,10 +229,10 @@ if (gtest_build_tests)
cxx_test_with_flags(gtest-death-test_ex_nocatch_test cxx_test_with_flags(gtest-death-test_ex_nocatch_test
"${cxx_exception} -DGTEST_ENABLE_CATCH_EXCEPTIONS_=0" "${cxx_exception} -DGTEST_ENABLE_CATCH_EXCEPTIONS_=0"
gtest test/gtest-death-test_ex_test.cc) gtest test/googletest-death-test_ex_test.cc)
cxx_test_with_flags(gtest-death-test_ex_catch_test cxx_test_with_flags(gtest-death-test_ex_catch_test
"${cxx_exception} -DGTEST_ENABLE_CATCH_EXCEPTIONS_=1" "${cxx_exception} -DGTEST_ENABLE_CATCH_EXCEPTIONS_=1"
gtest test/gtest-death-test_ex_test.cc) gtest test/googletest-death-test_ex_test.cc)
cxx_test_with_flags(gtest_no_rtti_unittest "${cxx_no_rtti}" cxx_test_with_flags(gtest_no_rtti_unittest "${cxx_no_rtti}"
gtest_main_no_rtti test/gtest_unittest.cc) gtest_main_no_rtti test/gtest_unittest.cc)
...@@ -238,75 +253,75 @@ if (gtest_build_tests) ...@@ -238,75 +253,75 @@ if (gtest_build_tests)
cxx_library(gtest_main_use_own_tuple "${cxx_use_own_tuple}" cxx_library(gtest_main_use_own_tuple "${cxx_use_own_tuple}"
src/gtest-all.cc src/gtest_main.cc) src/gtest-all.cc src/gtest_main.cc)
cxx_test_with_flags(gtest-tuple_test "${cxx_use_own_tuple}" cxx_test_with_flags(googletest-tuple-test "${cxx_use_own_tuple}"
gtest_main_use_own_tuple test/gtest-tuple_test.cc) gtest_main_use_own_tuple test/googletest-tuple-test.cc)
cxx_test_with_flags(gtest_use_own_tuple_test "${cxx_use_own_tuple}" cxx_test_with_flags(gtest_use_own_tuple_test "${cxx_use_own_tuple}"
gtest_main_use_own_tuple gtest_main_use_own_tuple
test/gtest-param-test_test.cc test/gtest-param-test2_test.cc) test/googletest-param-test-test.cc test/googletest-param-test2-test.cc)
endif() endif()
############################################################ ############################################################
# Python tests. # Python tests.
cxx_executable(gtest_break_on_failure_unittest_ test gtest) cxx_executable(googletest-break-on-failure-unittest_ test gtest)
py_test(gtest_break_on_failure_unittest) py_test(googletest-break-on-failure-unittest)
# Visual Studio .NET 2003 does not support STL with exceptions disabled. # Visual Studio .NET 2003 does not support STL with exceptions disabled.
if (NOT MSVC OR MSVC_VERSION GREATER 1310) # 1310 is Visual Studio .NET 2003 if (NOT MSVC OR MSVC_VERSION GREATER 1310) # 1310 is Visual Studio .NET 2003
cxx_executable_with_flags( cxx_executable_with_flags(
gtest_catch_exceptions_no_ex_test_ googletest-catch-exceptions-no-ex-test_
"${cxx_no_exception}" "${cxx_no_exception}"
gtest_main_no_exception gtest_main_no_exception
test/gtest_catch_exceptions_test_.cc) test/googletest-catch-exceptions-test_.cc)
endif() endif()
cxx_executable_with_flags( cxx_executable_with_flags(
gtest_catch_exceptions_ex_test_ googletest-catch-exceptions-ex-test_
"${cxx_exception}" "${cxx_exception}"
gtest_main gtest_main
test/gtest_catch_exceptions_test_.cc) test/googletest-catch-exceptions-test_.cc)
py_test(gtest_catch_exceptions_test) py_test(googletest-catch-exceptions-test)
cxx_executable(gtest_color_test_ test gtest) cxx_executable(googletest-color-test_ test gtest)
py_test(gtest_color_test) py_test(googletest-color-test)
cxx_executable(gtest_env_var_test_ test gtest) cxx_executable(googletest-env-var-test_ test gtest)
py_test(gtest_env_var_test) py_test(googletest-env-var-test)
cxx_executable(gtest_filter_unittest_ test gtest) cxx_executable(googletest-filter-unittest_ test gtest)
py_test(gtest_filter_unittest) py_test(googletest-filter-unittest)
cxx_executable(gtest_help_test_ test gtest_main) cxx_executable(gtest_help_test_ test gtest_main)
py_test(gtest_help_test) py_test(gtest_help_test)
cxx_executable(gtest_list_tests_unittest_ test gtest) cxx_executable(googletest-list-tests-unittest_ test gtest)
py_test(gtest_list_tests_unittest) py_test(googletest-list-tests-unittest)
cxx_executable(gtest_output_test_ test gtest) cxx_executable(googletest-output-test_ test gtest)
py_test(gtest_output_test --no_stacktrace_support) py_test(googletest-output-test --no_stacktrace_support)
cxx_executable(gtest_shuffle_test_ test gtest) cxx_executable(googletest-shuffle-test_ test gtest)
py_test(gtest_shuffle_test) py_test(googletest-shuffle-test)
# MSVC 7.1 does not support STL with exceptions disabled. # MSVC 7.1 does not support STL with exceptions disabled.
if (NOT MSVC OR MSVC_VERSION GREATER 1310) if (NOT MSVC OR MSVC_VERSION GREATER 1310)
cxx_executable(gtest_throw_on_failure_test_ test gtest_no_exception) cxx_executable(googletest-throw-on-failure-test_ test gtest_no_exception)
set_target_properties(gtest_throw_on_failure_test_ set_target_properties(googletest-throw-on-failure-test_
PROPERTIES PROPERTIES
COMPILE_FLAGS "${cxx_no_exception}") COMPILE_FLAGS "${cxx_no_exception}")
py_test(gtest_throw_on_failure_test) py_test(googletest-throw-on-failure-test)
endif() endif()
cxx_executable(gtest_uninitialized_test_ test gtest) cxx_executable(googletest-uninitialized-test_ test gtest)
py_test(gtest_uninitialized_test) py_test(googletest-uninitialized-test)
cxx_executable(gtest_xml_outfile1_test_ test gtest_main) cxx_executable(gtest_xml_outfile1_test_ test gtest_main)
cxx_executable(gtest_xml_outfile2_test_ test gtest_main) cxx_executable(gtest_xml_outfile2_test_ test gtest_main)
py_test(gtest_xml_outfiles_test) py_test(gtest_xml_outfiles_test)
py_test(gtest_json_outfiles_test) py_test(googletest-json-outfiles-test)
cxx_executable(gtest_xml_output_unittest_ test gtest) cxx_executable(gtest_xml_output_unittest_ test gtest)
py_test(gtest_xml_output_unittest --no_stacktrace_support) py_test(gtest_xml_output_unittest --no_stacktrace_support)
py_test(gtest_json_output_unittest) py_test(googletest-json-output-unittest --no_stacktrace_support)
endif() endif()
...@@ -53,40 +53,40 @@ EXTRA_DIST += \ ...@@ -53,40 +53,40 @@ EXTRA_DIST += \
test/gtest-listener_test.cc \ test/gtest-listener_test.cc \
test/gtest-message_test.cc \ test/gtest-message_test.cc \
test/gtest-options_test.cc \ test/gtest-options_test.cc \
test/gtest-param-test2_test.cc \ test/googletest-param-test2-test.cc \
test/gtest-param-test2_test.cc \ test/googletest-param-test2-test.cc \
test/gtest-param-test_test.cc \ test/googletest-param-test-test.cc \
test/gtest-param-test_test.cc \ test/googletest-param-test-test.cc \
test/gtest-param-test_test.h \ test/gtest-param-test_test.h \
test/gtest-port_test.cc \ test/gtest-port_test.cc \
test/gtest_premature_exit_test.cc \ test/gtest_premature_exit_test.cc \
test/gtest-printers_test.cc \ test/gtest-printers_test.cc \
test/gtest-test-part_test.cc \ test/gtest-test-part_test.cc \
test/gtest-tuple_test.cc \ test/googletest-tuple-test.cc \
test/gtest-typed-test2_test.cc \ test/gtest-typed-test2_test.cc \
test/gtest-typed-test_test.cc \ test/gtest-typed-test_test.cc \
test/gtest-typed-test_test.h \ test/gtest-typed-test_test.h \
test/gtest-unittest-api_test.cc \ test/gtest-unittest-api_test.cc \
test/gtest_break_on_failure_unittest_.cc \ test/googletest-break-on-failure-unittest_.cc \
test/gtest_catch_exceptions_test_.cc \ test/googletest-catch-exceptions-test_.cc \
test/gtest_color_test_.cc \ test/googletest-color-test_.cc \
test/gtest_env_var_test_.cc \ test/googletest-env-var-test_.cc \
test/gtest_environment_test.cc \ test/gtest_environment_test.cc \
test/gtest_filter_unittest_.cc \ test/googletest-filter-unittest_.cc \
test/gtest_help_test_.cc \ test/gtest_help_test_.cc \
test/gtest_list_tests_unittest_.cc \ test/googletest-list-tests-unittest_.cc \
test/gtest_main_unittest.cc \ test/gtest_main_unittest.cc \
test/gtest_no_test_unittest.cc \ test/gtest_no_test_unittest.cc \
test/gtest_output_test_.cc \ test/googletest-output-test_.cc \
test/gtest_pred_impl_unittest.cc \ test/gtest_pred_impl_unittest.cc \
test/gtest_prod_test.cc \ test/gtest_prod_test.cc \
test/gtest_repeat_test.cc \ test/gtest_repeat_test.cc \
test/gtest_shuffle_test_.cc \ test/googletest-shuffle-test_.cc \
test/gtest_sole_header_test.cc \ test/gtest_sole_header_test.cc \
test/gtest_stress_test.cc \ test/gtest_stress_test.cc \
test/gtest_throw_on_failure_ex_test.cc \ test/gtest_throw_on_failure_ex_test.cc \
test/gtest_throw_on_failure_test_.cc \ test/googletest-throw-on-failure-test_.cc \
test/gtest_uninitialized_test_.cc \ test/googletest-uninitialized-test_.cc \
test/gtest_unittest.cc \ test/gtest_unittest.cc \
test/gtest_unittest.cc \ test/gtest_unittest.cc \
test/gtest_xml_outfile1_test_.cc \ test/gtest_xml_outfile1_test_.cc \
...@@ -97,19 +97,19 @@ EXTRA_DIST += \ ...@@ -97,19 +97,19 @@ EXTRA_DIST += \
# Python tests that we don't run. # Python tests that we don't run.
EXTRA_DIST += \ EXTRA_DIST += \
test/gtest_break_on_failure_unittest.py \ test/googletest-break-on-failure-unittest.py \
test/gtest_catch_exceptions_test.py \ test/googletest-catch-exceptions-test.py \
test/gtest_color_test.py \ test/googletest-color-test.py \
test/gtest_env_var_test.py \ test/googletest-env-var-test.py \
test/gtest_filter_unittest.py \ test/googletest-filter-unittest.py \
test/gtest_help_test.py \ test/gtest_help_test.py \
test/gtest_list_tests_unittest.py \ test/googletest-list-tests-unittest.py \
test/gtest_output_test.py \ test/googletest-output-test.py \
test/gtest_output_test_golden_lin.txt \ test/googletest-output-test_golden_lin.txt \
test/gtest_shuffle_test.py \ test/googletest-shuffle-test.py \
test/gtest_test_utils.py \ test/gtest_test_utils.py \
test/gtest_throw_on_failure_test.py \ test/googletest-throw-on-failure-test.py \
test/gtest_uninitialized_test.py \ test/googletest-uninitialized-test.py \
test/gtest_xml_outfiles_test.py \ test/gtest_xml_outfiles_test.py \
test/gtest_xml_output_unittest.py \ test/gtest_xml_output_unittest.py \
test/gtest_xml_test_utils.py test/gtest_xml_test_utils.py
......
...@@ -230,7 +230,7 @@ find_package(PythonInterp) ...@@ -230,7 +230,7 @@ find_package(PythonInterp)
# from the given source files with the given compiler flags. # from the given source files with the given compiler flags.
function(cxx_test_with_flags name cxx_flags libs) function(cxx_test_with_flags name cxx_flags libs)
cxx_executable_with_flags(${name} "${cxx_flags}" "${libs}" ${ARGN}) cxx_executable_with_flags(${name} "${cxx_flags}" "${libs}" ${ARGN})
add_test(${name} ${name}) add_test(NAME ${name} COMMAND ${name})
endfunction() endfunction()
# cxx_test(name libs srcs...) # cxx_test(name libs srcs...)
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
## Introduction ## Introduction
Now that you have read the [googletest Primer](primer) and learned how to write Now that you have read the [googletest Primer](primer.md) and learned how to write
tests using googletest, it's time to learn some new tricks. This document will tests using googletest, it's time to learn some new tricks. This document will
show you more assertions as well as how to construct complex failure messages, show you more assertions as well as how to construct complex failure messages,
propagate fatal failures, reuse and speed up your test fixtures, and use various propagate fatal failures, reuse and speed up your test fixtures, and use various
...@@ -103,13 +103,11 @@ If you already have a function or functor that returns `bool` (or a type that ...@@ -103,13 +103,11 @@ If you already have a function or functor that returns `bool` (or a type that
can be implicitly converted to `bool`), you can use it in a *predicate can be implicitly converted to `bool`), you can use it in a *predicate
assertion* to get the function arguments printed for free: assertion* to get the function arguments printed for free:
| Fatal assertion | Nonfatal assertion | Verifies | | Fatal assertion | Nonfatal assertion | Verifies |
| -------------------- | -------------------- | --------------------------- | | ---------------------------------- | ---------------------------------- | --------------------------- |
| `ASSERT_PRED1(pred1, | `EXPECT_PRED1(pred1, | `pred1(val1)` is true | | `ASSERT_PRED1(pred1, val1);` | `EXPECT_PRED1(pred1, val1);` | `pred1(val1)` is true |
: val1);` : val1);` : : | `ASSERT_PRED2(pred2, val1, val2);` | `EXPECT_PRED2(pred2, val1, val2);` | `pred2(val1, val2)` is true |
| `ASSERT_PRED2(pred2, | `EXPECT_PRED2(pred2, | `pred2(val1, val2)` is true | | `...` | `...` | ... |
: val1, val2);` : val1, val2);` : :
| `...` | `...` | ... |
In the above, `predn` is an `n`-ary predicate function or functor, where `val1`, In the above, `predn` is an `n`-ary predicate function or functor, where `val1`,
`val2`, ..., and `valn` are its arguments. The assertion succeeds if the `val2`, ..., and `valn` are its arguments. The assertion succeeds if the
...@@ -120,7 +118,7 @@ either case, the arguments are evaluated exactly once. ...@@ -120,7 +118,7 @@ either case, the arguments are evaluated exactly once.
Here's an example. Given Here's an example. Given
```c++ ```c++
// Returns true iff m and n have no common divisors except 1. // Returns true if m and n have no common divisors except 1.
bool MutuallyPrime(int m, int n) { ... } bool MutuallyPrime(int m, int n) { ... }
const int a = 3; const int a = 3;
...@@ -152,7 +150,7 @@ c is 10 ...@@ -152,7 +150,7 @@ c is 10
> >
> 1. If you see a compiler error "no matching function to call" when using > 1. If you see a compiler error "no matching function to call" when using
> `ASSERT_PRED*` or `EXPECT_PRED*`, please see > `ASSERT_PRED*` or `EXPECT_PRED*`, please see
> [this](faq#OverloadedPredicate) for how to resolve it. > [this](faq.md#OverloadedPredicate) for how to resolve it.
> 1. Currently we only provide predicate assertions of arity <= 5. If you need > 1. Currently we only provide predicate assertions of arity <= 5. If you need
> a higher-arity assertion, let [us](https://github.com/google/googletest/issues) know. > a higher-arity assertion, let [us](https://github.com/google/googletest/issues) know.
...@@ -339,12 +337,10 @@ want to learn more, see ...@@ -339,12 +337,10 @@ want to learn more, see
#### Floating-Point Macros #### Floating-Point Macros
| Fatal assertion | Nonfatal assertion | Verifies | | Fatal assertion | Nonfatal assertion | Verifies |
| ----------------------- | ----------------------- | ----------------------- | | ------------------------------- | ------------------------------ | ---------------------------------------- |
| `ASSERT_FLOAT_EQ(val1, | `EXPECT_FLOAT_EQ(val1, | the two `float` values | | `ASSERT_FLOAT_EQ(val1, val2);` | `EXPECT_FLOAT_EQ(val1,val2);` | the two `float` values are almost equal |
: val2);` : val2);` : are almost equal : | `ASSERT_DOUBLE_EQ(val1, val2);` | `EXPECT_DOUBLE_EQ(val1, val2);`| the two `double` values are almost equal |
| `ASSERT_DOUBLE_EQ(val1, | `EXPECT_DOUBLE_EQ(val1, | the two `double` values |
: val2);` : val2);` : are almost equal :
By "almost equal" we mean the values are within 4 ULP's from each other. By "almost equal" we mean the values are within 4 ULP's from each other.
...@@ -354,12 +350,9 @@ unsafe and has been deprecated. Please don't use it any more. ...@@ -354,12 +350,9 @@ unsafe and has been deprecated. Please don't use it any more.
The following assertions allow you to choose the acceptable error bound: The following assertions allow you to choose the acceptable error bound:
| Fatal assertion | Nonfatal assertion | Verifies | | Fatal assertion | Nonfatal assertion | Verifies |
| ------------------ | ------------------------ | ------------------------- | | ------------------------------------- | ------------------------------------- | ------------------------- |
| `ASSERT_NEAR(val1, | `EXPECT_NEAR(val1, val2, | the difference between | | `ASSERT_NEAR(val1, val2, abs_error);` | `EXPECT_NEAR(val1, val2, abs_error);` | the difference between `val1` and `val2` doesn't exceed the given absolute error |
: val2, abs_error);` : abs_error);` : `val1` and `val2` doesn't :
: : : exceed the given absolute :
: : : error :
**Availability**: Linux, Windows, Mac. **Availability**: Linux, Windows, Mac.
...@@ -387,10 +380,9 @@ library of matchers for validating arguments passed to mock objects. A gMock ...@@ -387,10 +380,9 @@ library of matchers for validating arguments passed to mock objects. A gMock
*matcher* is basically a predicate that knows how to describe itself. It can be *matcher* is basically a predicate that knows how to describe itself. It can be
used in these assertion macros: used in these assertion macros:
| Fatal assertion | Nonfatal assertion | Verifies | | Fatal assertion | Nonfatal assertion | Verifies |
| ------------------- | ------------------------------ | --------------------- | | ------------------------------ | ------------------------------ | --------------------- |
| `ASSERT_THAT(value, | `EXPECT_THAT(value, matcher);` | value matches matcher | | `ASSERT_THAT(value, matcher);` | `EXPECT_THAT(value, matcher);` | value matches matcher |
: matcher);` : : :
For example, `StartsWith(prefix)` is a matcher that matches a string starting For example, `StartsWith(prefix)` is a matcher that matches a string starting
with `prefix`, and you can write: with `prefix`, and you can write:
...@@ -580,7 +572,7 @@ namespace foo { ...@@ -580,7 +572,7 @@ namespace foo {
class Bar { // We want googletest to be able to print instances of this. class Bar { // We want googletest to be able to print instances of this.
... ...
// Create a free inline friend function. // Create a free inline friend function.
friend ::std::ostream& operator<<(::std::ostream& os, const Bar& bar) { friend std::ostream& operator<<(std::ostream& os, const Bar& bar) {
return os << bar.DebugString(); // whatever needed to print bar to os return os << bar.DebugString(); // whatever needed to print bar to os
} }
}; };
...@@ -588,7 +580,7 @@ class Bar { // We want googletest to be able to print instances of this. ...@@ -588,7 +580,7 @@ class Bar { // We want googletest to be able to print instances of this.
// If you can't declare the function in the class it's important that the // If you can't declare the function in the class it's important that the
// << operator is defined in the SAME namespace that defines Bar. C++'s look-up // << operator is defined in the SAME namespace that defines Bar. C++'s look-up
// rules rely on that. // rules rely on that.
::std::ostream& operator<<(::std::ostream& os, const Bar& bar) { std::ostream& operator<<(std::ostream& os, const Bar& bar) {
return os << bar.DebugString(); // whatever needed to print bar to os return os << bar.DebugString(); // whatever needed to print bar to os
} }
...@@ -609,7 +601,7 @@ namespace foo { ...@@ -609,7 +601,7 @@ namespace foo {
class Bar { class Bar {
... ...
friend void PrintTo(const Bar& bar, ::std::ostream* os) { friend void PrintTo(const Bar& bar, std::ostream* os) {
*os << bar.DebugString(); // whatever needed to print bar to os *os << bar.DebugString(); // whatever needed to print bar to os
} }
}; };
...@@ -617,7 +609,7 @@ class Bar { ...@@ -617,7 +609,7 @@ class Bar {
// If you can't declare the function in the class it's important that PrintTo() // If you can't declare the function in the class it's important that PrintTo()
// is defined in the SAME namespace that defines Bar. C++'s look-up rules rely // is defined in the SAME namespace that defines Bar. C++'s look-up rules rely
// on that. // on that.
void PrintTo(const Bar& bar, ::std::ostream* os) { void PrintTo(const Bar& bar, std::ostream* os) {
*os << bar.DebugString(); // whatever needed to print bar to os *os << bar.DebugString(); // whatever needed to print bar to os
} }
...@@ -1396,17 +1388,11 @@ namespace: ...@@ -1396,17 +1388,11 @@ namespace:
| Parameter Generator | Behavior | | Parameter Generator | Behavior |
| ---------------------------- | ------------------------------------------- | | ---------------------------- | ------------------------------------------- |
| `Range(begin, end [, step])` | Yields values `{begin, begin+step, | | `Range(begin, end [, step])` | Yields values `{begin, begin+step, begin+step+step, ...}`. The values do not include `end`. `step` defaults to 1. |
: : begin+step+step, ...}`. The values do not :
: : include `end`. `step` defaults to 1. :
| `Values(v1, v2, ..., vN)` | Yields values `{v1, v2, ..., vN}`. | | `Values(v1, v2, ..., vN)` | Yields values `{v1, v2, ..., vN}`. |
| `ValuesIn(container)` and | Yields values from a C-style array, an | | `ValuesIn(container)` and `ValuesIn(begin,end)` | Yields values from a C-style array, an STL-style container, or an iterator range `[begin, end)`. |
: `ValuesIn(begin,end)` : STL-style container, or an iterator range :
: : `[begin, end)`. :
| `Bool()` | Yields sequence `{false, true}`. | | `Bool()` | Yields sequence `{false, true}`. |
| `Combine(g1, g2, ..., gN)` | Yields all combinations (Cartesian product) | | `Combine(g1, g2, ..., gN)` | Yields all combinations (Cartesian product) as std\:\:tuples of the values generated by the `N` generators. |
: : as std\:\:tuples of the values generated by :
: : the `N` generators. :
For more details, see the comments at the definitions of these functions. For more details, see the comments at the definitions of these functions.
...@@ -1726,11 +1712,11 @@ To test them, we use the following special techniques: ...@@ -1726,11 +1712,11 @@ To test them, we use the following special techniques:
```c++ ```c++
// foo.h // foo.h
#include "gtest/gtest_prod.h" #include "gtest/gtest_prod.h"
class Foo { class Foo {
... ...
private: private:
FRIEND_TEST(FooTest, BarReturnsZeroOnNull); FRIEND_TEST(FooTest, BarReturnsZeroOnNull);
int Bar(void* x); int Bar(void* x);
...@@ -1779,7 +1765,7 @@ To test them, we use the following special techniques: ...@@ -1779,7 +1765,7 @@ To test them, we use the following special techniques:
``` ```
## "Catching" Failures ## "Catching" Failures
If you are building a testing utility on top of googletest, you'll want to test If you are building a testing utility on top of googletest, you'll want to test
your utility. What framework would you use to test it? googletest, of course. your utility. What framework would you use to test it? googletest, of course.
...@@ -2168,23 +2154,22 @@ random seed and re-shuffle the tests in each iteration. ...@@ -2168,23 +2154,22 @@ random seed and re-shuffle the tests in each iteration.
googletest can use colors in its terminal output to make it easier to spot the googletest can use colors in its terminal output to make it easier to spot the
important information: important information:
... ...<br/>
<span style="color:green">[----------]<span style="color:black"> 1 test from FooTest <span style="color:green">[----------]<span style="color:black"> 1 test from FooTest<br/>
<span style="color:green">[ RUN ]<span style="color:black"> FooTest.DoesAbc <span style="color:green">[ RUN ]<span style="color:black"> FooTest.DoesAbc<br/>
<span style="color:green">[ OK ]<span style="color:black"> FooTest.DoesAbc <span style="color:green">[ OK ]<span style="color:black"> FooTest.DoesAbc<br/>
<span style="color:green">[----------]<span style="color:black"> 2 tests from BarTest <span style="color:green">[----------]<span style="color:black"> 2 tests from BarTest<br/>
<span style="color:green">[ RUN ]<span style="color:black"> BarTest.HasXyzProperty <span style="color:green">[ RUN ]<span style="color:black"> BarTest.HasXyzProperty<br/>
<span style="color:green">[ OK ]<span style="color:black"> BarTest.HasXyzProperty <span style="color:green">[ OK ]<span style="color:black"> BarTest.HasXyzProperty<br/>
<span style="color:green">[ RUN ]<span style="color:black"> BarTest.ReturnsTrueOnSuccess <span style="color:green">[ RUN ]<span style="color:black"> BarTest.ReturnsTrueOnSuccess<br/>
... some error messages ... ... some error messages ...<br/>
<span style="color:red">[ FAILED ] <span style="color:black">BarTest.ReturnsTrueOnSuccess <span style="color:red">[ FAILED ] <span style="color:black">BarTest.ReturnsTrueOnSuccess<br/>
... ...<br/>
<span style="color:green">[==========]<span style="color:black"> 30 tests from 14 test cases ran. <span style="color:green">[==========]<span style="color:black"> 30 tests from 14 test cases ran.<br/>
<span style="color:green">[ PASSED ]<span style="color:black"> 28 tests. <span style="color:green">[ PASSED ]<span style="color:black"> 28 tests.<br/>
<span style="color:red">[ FAILED ]<span style="color:black"> 2 tests, listed below: <span style="color:red">[ FAILED ]<span style="color:black"> 2 tests, listed below:<br/>
<span style="color:red">[ FAILED ]<span style="color:black"> BarTest.ReturnsTrueOnSuccess <span style="color:red">[ FAILED ]<span style="color:black"> BarTest.ReturnsTrueOnSuccess<br/>
<span style="color:red">[ FAILED ]<span style="color:black"> AnotherTest.DoesXyz <span style="color:red">[ FAILED ]<span style="color:black"> AnotherTest.DoesXyz<br/>
2 FAILED TESTS 2 FAILED TESTS
You can set the `GTEST_COLOR` environment variable or the `--gtest_color` You can set the `GTEST_COLOR` environment variable or the `--gtest_color`
...@@ -2193,8 +2178,7 @@ disable colors, or let googletest decide. When the value is `auto`, googletest ...@@ -2193,8 +2178,7 @@ disable colors, or let googletest decide. When the value is `auto`, googletest
will use colors if and only if the output goes to a terminal and (on non-Windows will use colors if and only if the output goes to a terminal and (on non-Windows
platforms) the `TERM` environment variable is set to `xterm` or `xterm-color`. platforms) the `TERM` environment variable is set to `xterm` or `xterm-color`.
> **Availability**: Linux, Windows, Mac.
> **Availability**: Linux, Windows, Mac.
#### Suppressing the Elapsed Time #### Suppressing the Elapsed Time
......
...@@ -707,8 +707,9 @@ In general, the recommended way to cause the code to behave differently under ...@@ -707,8 +707,9 @@ In general, the recommended way to cause the code to behave differently under
test is [Dependency Injection](https://en.wikipedia.org/wiki/Dependency_injection). You can inject test is [Dependency Injection](https://en.wikipedia.org/wiki/Dependency_injection). You can inject
different functionality from the test and from the production code. Since your different functionality from the test and from the production code. Since your
production code doesn't link in the for-test logic at all (the production code doesn't link in the for-test logic at all (the
[`testonly`](http://go/testonly) attribute for BUILD targets helps to ensure [`testonly`](https://docs.bazel.build/versions/master/be/common-definitions.html#common.testonly)
that), there is no danger in accidentally running it. attribute for BUILD targets helps to ensure that), there is no danger in
accidentally running it.
However, if you *really*, *really*, *really* have no choice, and if you follow However, if you *really*, *really*, *really* have no choice, and if you follow
the rule of ending your test program names with `_test`, you can use the the rule of ending your test program names with `_test`, you can use the
......
...@@ -26,8 +26,7 @@ ...@@ -26,8 +26,7 @@
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//
// Author: wan@google.com (Zhanyong Wan)
// //
// The Google C++ Testing and Mocking Framework (Google Test) // The Google C++ Testing and Mocking Framework (Google Test)
// //
...@@ -100,6 +99,7 @@ GTEST_API_ bool InDeathTestChild(); ...@@ -100,6 +99,7 @@ GTEST_API_ bool InDeathTestChild();
// //
// On the regular expressions used in death tests: // On the regular expressions used in death tests:
// //
// GOOGLETEST_CM0005 DO NOT DELETE
// On POSIX-compliant systems (*nix), we use the <regex.h> library, // On POSIX-compliant systems (*nix), we use the <regex.h> library,
// which uses the POSIX extended regex syntax. // which uses the POSIX extended regex syntax.
// //
...@@ -161,7 +161,7 @@ GTEST_API_ bool InDeathTestChild(); ...@@ -161,7 +161,7 @@ GTEST_API_ bool InDeathTestChild();
// is rarely a problem as people usually don't put the test binary // is rarely a problem as people usually don't put the test binary
// directory in PATH. // directory in PATH.
// //
// TODO(wan@google.com): make thread-safe death tests search the PATH. // FIXME: make thread-safe death tests search the PATH.
// Asserts that a given statement causes the program to exit, with an // Asserts that a given statement causes the program to exit, with an
// integer exit status that satisfies predicate, and emitting error output // integer exit status that satisfies predicate, and emitting error output
...@@ -202,6 +202,7 @@ class GTEST_API_ ExitedWithCode { ...@@ -202,6 +202,7 @@ class GTEST_API_ ExitedWithCode {
# if !GTEST_OS_WINDOWS && !GTEST_OS_FUCHSIA # if !GTEST_OS_WINDOWS && !GTEST_OS_FUCHSIA
// Tests that an exit code describes an exit due to termination by a // Tests that an exit code describes an exit due to termination by a
// given signal. // given signal.
// GOOGLETEST_CM0006 DO NOT DELETE
class GTEST_API_ KilledBySignal { class GTEST_API_ KilledBySignal {
public: public:
explicit KilledBySignal(int signum); explicit KilledBySignal(int signum);
......
...@@ -26,8 +26,7 @@ ...@@ -26,8 +26,7 @@
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//
// Author: wan@google.com (Zhanyong Wan)
// //
// The Google C++ Testing and Mocking Framework (Google Test) // The Google C++ Testing and Mocking Framework (Google Test)
// //
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment