1c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch########################################################################
2731df977c0511bca2206b5f333555b1205ff1f43Iain Merrick# CMake build script for Google Test.
3c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch#
4c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch# To run the tests for Google Test itself on Linux, use 'make test' or
5c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch# ctest.  You can select which tests to run using 'ctest -R regex'.
6c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch# For more options, run 'ctest --help'.
7c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch
83345a6884c488ff3a535c2c9acdd33d74b37e311Iain Merrick# BUILD_SHARED_LIBS is a standard CMake variable, but we declare it here to
93345a6884c488ff3a535c2c9acdd33d74b37e311Iain Merrick# make it prominent in the GUI.
103345a6884c488ff3a535c2c9acdd33d74b37e311Iain Merrickoption(BUILD_SHARED_LIBS "Build shared libraries (DLLs)." OFF)
113345a6884c488ff3a535c2c9acdd33d74b37e311Iain Merrick
123345a6884c488ff3a535c2c9acdd33d74b37e311Iain Merrick# When other libraries are using a shared version of runtime libraries,
133345a6884c488ff3a535c2c9acdd33d74b37e311Iain Merrick# Google Test also has to use one.
143345a6884c488ff3a535c2c9acdd33d74b37e311Iain Merrickoption(
153345a6884c488ff3a535c2c9acdd33d74b37e311Iain Merrick  gtest_force_shared_crt
163345a6884c488ff3a535c2c9acdd33d74b37e311Iain Merrick  "Use shared (DLL) run-time lib even when Google Test is built as static lib."
173345a6884c488ff3a535c2c9acdd33d74b37e311Iain Merrick  OFF)
183345a6884c488ff3a535c2c9acdd33d74b37e311Iain Merrick
193345a6884c488ff3a535c2c9acdd33d74b37e311Iain Merrickoption(gtest_build_tests "Build all of gtest's own tests." OFF)
203345a6884c488ff3a535c2c9acdd33d74b37e311Iain Merrick
213345a6884c488ff3a535c2c9acdd33d74b37e311Iain Merrickoption(gtest_build_samples "Build gtest's sample programs." OFF)
223345a6884c488ff3a535c2c9acdd33d74b37e311Iain Merrick
23731df977c0511bca2206b5f333555b1205ff1f43Iain Merrickoption(gtest_disable_pthreads "Disable uses of pthreads in gtest." OFF)
24731df977c0511bca2206b5f333555b1205ff1f43Iain Merrick
25731df977c0511bca2206b5f333555b1205ff1f43Iain Merrick# Defines pre_project_set_up_hermetic_build() and set_up_hermetic_build().
263345a6884c488ff3a535c2c9acdd33d74b37e311Iain Merrickinclude(cmake/hermetic_build.cmake OPTIONAL)
273345a6884c488ff3a535c2c9acdd33d74b37e311Iain Merrick
283345a6884c488ff3a535c2c9acdd33d74b37e311Iain Merrickif (COMMAND pre_project_set_up_hermetic_build)
293345a6884c488ff3a535c2c9acdd33d74b37e311Iain Merrick  pre_project_set_up_hermetic_build()
30c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdochendif()
31c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch
32c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch########################################################################
33c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch#
34c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch# Project-wide settings
35c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch
36c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch# Name of the project.
37c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch#
38c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch# CMake files in this project can refer to the root source directory
39c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch# as ${gtest_SOURCE_DIR} and to the root binary directory as
40c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch# ${gtest_BINARY_DIR}.
41c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch# Language "C" is required for find_package(Threads).
42c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdochproject(gtest CXX C)
433345a6884c488ff3a535c2c9acdd33d74b37e311Iain Merrickcmake_minimum_required(VERSION 2.6.2)
443345a6884c488ff3a535c2c9acdd33d74b37e311Iain Merrick
453345a6884c488ff3a535c2c9acdd33d74b37e311Iain Merrickif (COMMAND set_up_hermetic_build)
463345a6884c488ff3a535c2c9acdd33d74b37e311Iain Merrick  set_up_hermetic_build()
47c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdochendif()
48c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch
49731df977c0511bca2206b5f333555b1205ff1f43Iain Merrick# Define helper functions and macros used by Google Test.
503345a6884c488ff3a535c2c9acdd33d74b37e311Iain Merrickinclude(cmake/internal_utils.cmake)
513345a6884c488ff3a535c2c9acdd33d74b37e311Iain Merrick
52731df977c0511bca2206b5f333555b1205ff1f43Iain Merrickconfig_compiler_and_linker()  # Defined in internal_utils.cmake.
533345a6884c488ff3a535c2c9acdd33d74b37e311Iain Merrick
543345a6884c488ff3a535c2c9acdd33d74b37e311Iain Merrick# Where Google Test's .h files can be found.
55c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdochinclude_directories(
56c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch  ${gtest_SOURCE_DIR}/include
57c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch  ${gtest_SOURCE_DIR})
58c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch
593345a6884c488ff3a535c2c9acdd33d74b37e311Iain Merrick# Where Google Test's libraries can be found.
603345a6884c488ff3a535c2c9acdd33d74b37e311Iain Merricklink_directories(${gtest_BINARY_DIR}/src)
61c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch
62c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch########################################################################
63c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch#
64c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch# Defines the gtest & gtest_main libraries.  User tests should link
65c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch# with one of them.
663345a6884c488ff3a535c2c9acdd33d74b37e311Iain Merrick
673345a6884c488ff3a535c2c9acdd33d74b37e311Iain Merrick# Google Test libraries.  We build them using more strict warnings than what
683345a6884c488ff3a535c2c9acdd33d74b37e311Iain Merrick# are used for other targets, to ensure that gtest can be compiled by a user
693345a6884c488ff3a535c2c9acdd33d74b37e311Iain Merrick# aggressive about warnings.
703345a6884c488ff3a535c2c9acdd33d74b37e311Iain Merrickcxx_library(gtest "${cxx_strict}" src/gtest-all.cc)
713345a6884c488ff3a535c2c9acdd33d74b37e311Iain Merrickcxx_library(gtest_main "${cxx_strict}" src/gtest_main.cc)
72c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdochtarget_link_libraries(gtest_main gtest)
73c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch
74c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch########################################################################
75c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch#
76c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch# Samples on how to link user tests with gtest or gtest_main.
77c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch#
78c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch# They are not built by default.  To build them, set the
793345a6884c488ff3a535c2c9acdd33d74b37e311Iain Merrick# gtest_build_samples option to ON.  You can do it by running ccmake
80c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch# or specifying the -Dbuild_gtest_samples=ON flag when running cmake.
81c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch
823345a6884c488ff3a535c2c9acdd33d74b37e311Iain Merrickif (gtest_build_samples)
83c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch  cxx_executable(sample1_unittest samples gtest_main samples/sample1.cc)
84c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch  cxx_executable(sample2_unittest samples gtest_main samples/sample2.cc)
85c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch  cxx_executable(sample3_unittest samples gtest_main)
86c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch  cxx_executable(sample4_unittest samples gtest_main samples/sample4.cc)
87c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch  cxx_executable(sample5_unittest samples gtest_main samples/sample1.cc)
88c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch  cxx_executable(sample6_unittest samples gtest_main)
89c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch  cxx_executable(sample7_unittest samples gtest_main)
90c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch  cxx_executable(sample8_unittest samples gtest_main)
91c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch  cxx_executable(sample9_unittest samples gtest)
92c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch  cxx_executable(sample10_unittest samples gtest)
93c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdochendif()
94c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch
95c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch########################################################################
96c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch#
97c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch# Google Test's own tests.
98c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch#
99c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch# You can skip this section if you aren't interested in testing
100c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch# Google Test itself.
101c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch#
1023345a6884c488ff3a535c2c9acdd33d74b37e311Iain Merrick# The tests are not built by default.  To build them, set the
1033345a6884c488ff3a535c2c9acdd33d74b37e311Iain Merrick# gtest_build_tests option to ON.  You can do it by running ccmake
1043345a6884c488ff3a535c2c9acdd33d74b37e311Iain Merrick# or specifying the -Dgtest_build_tests=ON flag when running cmake.
105c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch
1063345a6884c488ff3a535c2c9acdd33d74b37e311Iain Merrickif (gtest_build_tests)
1073345a6884c488ff3a535c2c9acdd33d74b37e311Iain Merrick  # This must be set in the root directory for the tests to be run by
1083345a6884c488ff3a535c2c9acdd33d74b37e311Iain Merrick  # 'make test' or ctest.
1093345a6884c488ff3a535c2c9acdd33d74b37e311Iain Merrick  enable_testing()
110c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch
1113345a6884c488ff3a535c2c9acdd33d74b37e311Iain Merrick  ############################################################
1123345a6884c488ff3a535c2c9acdd33d74b37e311Iain Merrick  # C++ tests built with standard compiler flags.
113c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch
114c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch  cxx_test(gtest-death-test_test gtest_main)
115c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch  cxx_test(gtest_environment_test gtest)
116c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch  cxx_test(gtest-filepath_test gtest_main)
117c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch  cxx_test(gtest-linked_ptr_test gtest_main)
118c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch  cxx_test(gtest-listener_test gtest_main)
119c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch  cxx_test(gtest_main_unittest gtest_main)
120c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch  cxx_test(gtest-message_test gtest_main)
121c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch  cxx_test(gtest_no_test_unittest gtest)
122c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch  cxx_test(gtest-options_test gtest_main)
123c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch  cxx_test(gtest-param-test_test gtest
124c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch    test/gtest-param-test2_test.cc)
125c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch  cxx_test(gtest-port_test gtest_main)
126c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch  cxx_test(gtest_pred_impl_unittest gtest_main)
1273345a6884c488ff3a535c2c9acdd33d74b37e311Iain Merrick  cxx_test(gtest-printers_test gtest_main)
128c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch  cxx_test(gtest_prod_test gtest_main
129c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch    test/production.cc)
130c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch  cxx_test(gtest_repeat_test gtest)
131c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch  cxx_test(gtest_sole_header_test gtest_main)
132c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch  cxx_test(gtest_stress_test gtest)
133c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch  cxx_test(gtest-test-part_test gtest_main)
134c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch  cxx_test(gtest_throw_on_failure_ex_test gtest)
135c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch  cxx_test(gtest-typed-test_test gtest_main
136c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch    test/gtest-typed-test2_test.cc)
1373345a6884c488ff3a535c2c9acdd33d74b37e311Iain Merrick  cxx_test(gtest_unittest gtest_main)
138c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch  cxx_test(gtest-unittest-api_test gtest)
139c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch
1403345a6884c488ff3a535c2c9acdd33d74b37e311Iain Merrick  ############################################################
1413345a6884c488ff3a535c2c9acdd33d74b37e311Iain Merrick  # C++ tests built with non-standard compiler flags.
142c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch
143c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch  cxx_library(gtest_no_exception "${cxx_no_exception}"
144c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch    src/gtest-all.cc)
145731df977c0511bca2206b5f333555b1205ff1f43Iain Merrick  cxx_library(gtest_main_no_exception "${cxx_no_exception}"
146731df977c0511bca2206b5f333555b1205ff1f43Iain Merrick    src/gtest-all.cc src/gtest_main.cc)
147c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch  cxx_library(gtest_main_no_rtti "${cxx_no_rtti}"
148c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch    src/gtest-all.cc src/gtest_main.cc)
149c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch
150dc0f95d653279beabeb9817299e2902918ba123eKristian Monsen  cxx_test_with_flags(gtest-death-test_ex_nocatch_test
151dc0f95d653279beabeb9817299e2902918ba123eKristian Monsen    "${cxx_exception} -DGTEST_ENABLE_CATCH_EXCEPTIONS_=0"
152dc0f95d653279beabeb9817299e2902918ba123eKristian Monsen    gtest test/gtest-death-test_ex_test.cc)
153dc0f95d653279beabeb9817299e2902918ba123eKristian Monsen  cxx_test_with_flags(gtest-death-test_ex_catch_test
154dc0f95d653279beabeb9817299e2902918ba123eKristian Monsen    "${cxx_exception} -DGTEST_ENABLE_CATCH_EXCEPTIONS_=1"
155dc0f95d653279beabeb9817299e2902918ba123eKristian Monsen    gtest test/gtest-death-test_ex_test.cc)
156dc0f95d653279beabeb9817299e2902918ba123eKristian Monsen
157c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch  cxx_test_with_flags(gtest_no_rtti_unittest "${cxx_no_rtti}"
158c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch    gtest_main_no_rtti test/gtest_unittest.cc)
159c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch
1603345a6884c488ff3a535c2c9acdd33d74b37e311Iain Merrick  cxx_shared_library(gtest_dll "${cxx_default}"
1613345a6884c488ff3a535c2c9acdd33d74b37e311Iain Merrick    src/gtest-all.cc src/gtest_main.cc)
162c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch
1633345a6884c488ff3a535c2c9acdd33d74b37e311Iain Merrick  cxx_executable_with_flags(gtest_dll_test_ "${cxx_default}"
164c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch    gtest_dll test/gtest_all_test.cc)
1653345a6884c488ff3a535c2c9acdd33d74b37e311Iain Merrick  set_target_properties(gtest_dll_test_
1663345a6884c488ff3a535c2c9acdd33d74b37e311Iain Merrick                        PROPERTIES
1673345a6884c488ff3a535c2c9acdd33d74b37e311Iain Merrick                        COMPILE_DEFINITIONS "GTEST_LINKED_AS_SHARED_LIBRARY=1")
168c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch
1693345a6884c488ff3a535c2c9acdd33d74b37e311Iain Merrick  if (NOT MSVC OR NOT MSVC_VERSION EQUAL 1600)
170c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch    # The C++ Standard specifies tuple_element<int, class>.
171c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch    # Yet MSVC 10's <utility> declares tuple_element<size_t, class>.
172c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch    # That declaration conflicts with our own standard-conforming
173c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch    # tuple implementation.  Therefore using our own tuple with
174c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch    # MSVC 10 doesn't compile.
175c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch    cxx_library(gtest_main_use_own_tuple "${cxx_use_own_tuple}"
176c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch      src/gtest-all.cc src/gtest_main.cc)
177c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch
178c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch    cxx_test_with_flags(gtest-tuple_test "${cxx_use_own_tuple}"
179c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch      gtest_main_use_own_tuple test/gtest-tuple_test.cc)
180c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch
181c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch    cxx_test_with_flags(gtest_use_own_tuple_test "${cxx_use_own_tuple}"
182c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch      gtest_main_use_own_tuple
183c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch      test/gtest-param-test_test.cc test/gtest-param-test2_test.cc)
184c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch  endif()
185c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch
1863345a6884c488ff3a535c2c9acdd33d74b37e311Iain Merrick  ############################################################
1873345a6884c488ff3a535c2c9acdd33d74b37e311Iain Merrick  # Python tests.
188c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch
189c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch  cxx_executable(gtest_break_on_failure_unittest_ test gtest)
190c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch  py_test(gtest_break_on_failure_unittest)
191c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch
192731df977c0511bca2206b5f333555b1205ff1f43Iain Merrick  cxx_executable_with_flags(
193731df977c0511bca2206b5f333555b1205ff1f43Iain Merrick    gtest_catch_exceptions_no_ex_test_
194731df977c0511bca2206b5f333555b1205ff1f43Iain Merrick    "${cxx_no_exception}"
195731df977c0511bca2206b5f333555b1205ff1f43Iain Merrick    gtest_main_no_exception
196731df977c0511bca2206b5f333555b1205ff1f43Iain Merrick    test/gtest_catch_exceptions_test_.cc)
197731df977c0511bca2206b5f333555b1205ff1f43Iain Merrick  cxx_executable_with_flags(
198731df977c0511bca2206b5f333555b1205ff1f43Iain Merrick    gtest_catch_exceptions_ex_test_
199731df977c0511bca2206b5f333555b1205ff1f43Iain Merrick    "${cxx_exception}"
200731df977c0511bca2206b5f333555b1205ff1f43Iain Merrick    gtest_main
201731df977c0511bca2206b5f333555b1205ff1f43Iain Merrick    test/gtest_catch_exceptions_test_.cc)
202731df977c0511bca2206b5f333555b1205ff1f43Iain Merrick  py_test(gtest_catch_exceptions_test)
203731df977c0511bca2206b5f333555b1205ff1f43Iain Merrick
204c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch  cxx_executable(gtest_color_test_ test gtest)
205c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch  py_test(gtest_color_test)
206c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch
207c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch  cxx_executable(gtest_env_var_test_ test gtest)
208c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch  py_test(gtest_env_var_test)
209c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch
210c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch  cxx_executable(gtest_filter_unittest_ test gtest)
211c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch  py_test(gtest_filter_unittest)
212c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch
213c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch  cxx_executable(gtest_help_test_ test gtest_main)
214c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch  py_test(gtest_help_test)
215c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch
216c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch  cxx_executable(gtest_list_tests_unittest_ test gtest)
217c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch  py_test(gtest_list_tests_unittest)
218c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch
219c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch  cxx_executable(gtest_output_test_ test gtest)
220c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch  py_test(gtest_output_test)
221c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch
222c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch  cxx_executable(gtest_shuffle_test_ test gtest)
223c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch  py_test(gtest_shuffle_test)
224c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch
225c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch  cxx_executable(gtest_throw_on_failure_test_ test gtest_no_exception)
226c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch  set_target_properties(gtest_throw_on_failure_test_
227c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch    PROPERTIES
228c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch    COMPILE_FLAGS "${cxx_no_exception}")
229c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch  py_test(gtest_throw_on_failure_test)
230c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch
231c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch  cxx_executable(gtest_uninitialized_test_ test gtest)
232c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch  py_test(gtest_uninitialized_test)
233c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch
234c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch  cxx_executable(gtest_xml_outfile1_test_ test gtest_main)
235c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch  cxx_executable(gtest_xml_outfile2_test_ test gtest_main)
236c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch  py_test(gtest_xml_outfiles_test)
237c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch
238c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch  cxx_executable(gtest_xml_output_unittest_ test gtest)
239c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch  py_test(gtest_xml_output_unittest)
240c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdochendif()
241