Merge lp:~sil2100/sync-monitor/packaging_review into lp:sync-monitor
- packaging_review
- Merge into trunk
Status: | Merged |
---|---|
Merged at revision: | 18 |
Proposed branch: | lp:~sil2100/sync-monitor/packaging_review |
Merge into: | lp:sync-monitor |
Diff against target: |
71399 lines (+69387/-475) 204 files modified
.bzr-builddeb/default.conf (+2/-0) .bzrignore (+2/-0) 3rd_party/CMakeLists.txt (+1/-0) 3rd_party/gmock/CMakeLists.txt (+171/-0) 3rd_party/gmock/gtest/CHANGES (+153/-0) 3rd_party/gmock/gtest/CMakeLists.txt (+250/-0) 3rd_party/gmock/gtest/CONTRIBUTORS (+37/-0) 3rd_party/gmock/gtest/Makefile.am (+305/-0) 3rd_party/gmock/gtest/README (+435/-0) 3rd_party/gmock/gtest/cmake/internal_utils.cmake (+227/-0) 3rd_party/gmock/gtest/codegear/gtest_all.cc (+38/-0) 3rd_party/gmock/gtest/codegear/gtest_link.cc (+40/-0) 3rd_party/gmock/gtest/configure.ac (+68/-0) 3rd_party/gmock/gtest/include/gtest/gtest-death-test.h (+294/-0) 3rd_party/gmock/gtest/include/gtest/gtest-message.h (+250/-0) 3rd_party/gmock/gtest/include/gtest/gtest-param-test.h (+1421/-0) 3rd_party/gmock/gtest/include/gtest/gtest-param-test.h.pump (+487/-0) 3rd_party/gmock/gtest/include/gtest/gtest-printers.h (+855/-0) 3rd_party/gmock/gtest/include/gtest/gtest-spi.h (+232/-0) 3rd_party/gmock/gtest/include/gtest/gtest-test-part.h (+179/-0) 3rd_party/gmock/gtest/include/gtest/gtest-typed-test.h (+259/-0) 3rd_party/gmock/gtest/include/gtest/gtest.h (+2291/-0) 3rd_party/gmock/gtest/include/gtest/gtest_pred_impl.h (+358/-0) 3rd_party/gmock/gtest/include/gtest/gtest_prod.h (+58/-0) 3rd_party/gmock/gtest/include/gtest/internal/gtest-death-test-internal.h (+319/-0) 3rd_party/gmock/gtest/include/gtest/internal/gtest-filepath.h (+206/-0) 3rd_party/gmock/gtest/include/gtest/internal/gtest-internal.h (+1147/-0) 3rd_party/gmock/gtest/include/gtest/internal/gtest-linked_ptr.h (+233/-0) 3rd_party/gmock/gtest/include/gtest/internal/gtest-param-util-generated.h (+5143/-0) 3rd_party/gmock/gtest/include/gtest/internal/gtest-param-util-generated.h.pump (+301/-0) 3rd_party/gmock/gtest/include/gtest/internal/gtest-param-util.h (+619/-0) 3rd_party/gmock/gtest/include/gtest/internal/gtest-port.h (+1947/-0) 3rd_party/gmock/gtest/include/gtest/internal/gtest-string.h (+167/-0) 3rd_party/gmock/gtest/include/gtest/internal/gtest-tuple.h (+1012/-0) 3rd_party/gmock/gtest/include/gtest/internal/gtest-tuple.h.pump (+339/-0) 3rd_party/gmock/gtest/include/gtest/internal/gtest-type-util.h (+3331/-0) 3rd_party/gmock/gtest/include/gtest/internal/gtest-type-util.h.pump (+297/-0) 3rd_party/gmock/gtest/m4/acx_pthread.m4 (+363/-0) 3rd_party/gmock/gtest/m4/gtest.m4 (+74/-0) 3rd_party/gmock/gtest/make/Makefile (+82/-0) 3rd_party/gmock/gtest/samples/prime_tables.h (+123/-0) 3rd_party/gmock/gtest/samples/sample1.cc (+68/-0) 3rd_party/gmock/gtest/samples/sample1.h (+43/-0) 3rd_party/gmock/gtest/samples/sample10_unittest.cc (+144/-0) 3rd_party/gmock/gtest/samples/sample1_unittest.cc (+153/-0) 3rd_party/gmock/gtest/samples/sample2.cc (+56/-0) 3rd_party/gmock/gtest/samples/sample2.h (+85/-0) 3rd_party/gmock/gtest/samples/sample2_unittest.cc (+109/-0) 3rd_party/gmock/gtest/samples/sample3-inl.h (+172/-0) 3rd_party/gmock/gtest/samples/sample3_unittest.cc (+151/-0) 3rd_party/gmock/gtest/samples/sample4.cc (+46/-0) 3rd_party/gmock/gtest/samples/sample4.h (+53/-0) 3rd_party/gmock/gtest/samples/sample4_unittest.cc (+45/-0) 3rd_party/gmock/gtest/samples/sample5_unittest.cc (+199/-0) 3rd_party/gmock/gtest/samples/sample6_unittest.cc (+224/-0) 3rd_party/gmock/gtest/samples/sample7_unittest.cc (+130/-0) 3rd_party/gmock/gtest/samples/sample8_unittest.cc (+173/-0) 3rd_party/gmock/gtest/samples/sample9_unittest.cc (+160/-0) 3rd_party/gmock/gtest/scripts/fuse_gtest_files.py (+250/-0) 3rd_party/gmock/gtest/scripts/gen_gtest_pred_impl.py (+730/-0) 3rd_party/gmock/gtest/scripts/gtest-config.in (+274/-0) 3rd_party/gmock/gtest/scripts/pump.py (+855/-0) 3rd_party/gmock/gtest/scripts/test/Makefile (+59/-0) 3rd_party/gmock/gtest/scripts/upload.py (+1387/-0) 3rd_party/gmock/gtest/scripts/upload_gtest.py (+78/-0) 3rd_party/gmock/gtest/src/gtest-all.cc (+48/-0) 3rd_party/gmock/gtest/src/gtest-death-test.cc (+1344/-0) 3rd_party/gmock/gtest/src/gtest-filepath.cc (+382/-0) 3rd_party/gmock/gtest/src/gtest-internal-inl.h (+1218/-0) 3rd_party/gmock/gtest/src/gtest-port.cc (+805/-0) 3rd_party/gmock/gtest/src/gtest-printers.cc (+363/-0) 3rd_party/gmock/gtest/src/gtest-test-part.cc (+110/-0) 3rd_party/gmock/gtest/src/gtest-typed-test.cc (+110/-0) 3rd_party/gmock/gtest/src/gtest.cc (+4961/-0) 3rd_party/gmock/gtest/src/gtest_main.cc (+38/-0) 3rd_party/gmock/gtest/test/gtest-death-test_ex_test.cc (+93/-0) 3rd_party/gmock/gtest/test/gtest-death-test_test.cc (+1368/-0) 3rd_party/gmock/gtest/test/gtest-filepath_test.cc (+680/-0) 3rd_party/gmock/gtest/test/gtest-linked_ptr_test.cc (+154/-0) 3rd_party/gmock/gtest/test/gtest-listener_test.cc (+310/-0) 3rd_party/gmock/gtest/test/gtest-message_test.cc (+159/-0) 3rd_party/gmock/gtest/test/gtest-options_test.cc (+215/-0) 3rd_party/gmock/gtest/test/gtest-param-test2_test.cc (+65/-0) 3rd_party/gmock/gtest/test/gtest-param-test_test.cc (+904/-0) 3rd_party/gmock/gtest/test/gtest-param-test_test.h (+57/-0) 3rd_party/gmock/gtest/test/gtest-port_test.cc (+1253/-0) 3rd_party/gmock/gtest/test/gtest-printers_test.cc (+1566/-0) 3rd_party/gmock/gtest/test/gtest-test-part_test.cc (+208/-0) 3rd_party/gmock/gtest/test/gtest-tuple_test.cc (+320/-0) 3rd_party/gmock/gtest/test/gtest-typed-test2_test.cc (+45/-0) 3rd_party/gmock/gtest/test/gtest-typed-test_test.cc (+360/-0) 3rd_party/gmock/gtest/test/gtest-typed-test_test.h (+66/-0) 3rd_party/gmock/gtest/test/gtest-unittest-api_test.cc (+341/-0) 3rd_party/gmock/gtest/test/gtest_all_test.cc (+47/-0) 3rd_party/gmock/gtest/test/gtest_break_on_failure_unittest.py (+218/-0) 3rd_party/gmock/gtest/test/gtest_break_on_failure_unittest_.cc (+88/-0) 3rd_party/gmock/gtest/test/gtest_catch_exceptions_test.py (+223/-0) 3rd_party/gmock/gtest/test/gtest_catch_exceptions_test_.cc (+311/-0) 3rd_party/gmock/gtest/test/gtest_color_test.py (+130/-0) 3rd_party/gmock/gtest/test/gtest_color_test_.cc (+71/-0) 3rd_party/gmock/gtest/test/gtest_env_var_test.py (+103/-0) 3rd_party/gmock/gtest/test/gtest_env_var_test_.cc (+126/-0) 3rd_party/gmock/gtest/test/gtest_environment_test.cc (+192/-0) 3rd_party/gmock/gtest/test/gtest_filter_unittest.py (+633/-0) 3rd_party/gmock/gtest/test/gtest_filter_unittest_.cc (+140/-0) 3rd_party/gmock/gtest/test/gtest_help_test.py (+172/-0) 3rd_party/gmock/gtest/test/gtest_help_test_.cc (+46/-0) 3rd_party/gmock/gtest/test/gtest_list_tests_unittest.py (+207/-0) 3rd_party/gmock/gtest/test/gtest_list_tests_unittest_.cc (+157/-0) 3rd_party/gmock/gtest/test/gtest_main_unittest.cc (+45/-0) 3rd_party/gmock/gtest/test/gtest_no_test_unittest.cc (+56/-0) 3rd_party/gmock/gtest/test/gtest_output_test.py (+335/-0) 3rd_party/gmock/gtest/test/gtest_output_test_.cc (+1034/-0) 3rd_party/gmock/gtest/test/gtest_output_test_golden_lin.txt (+720/-0) 3rd_party/gmock/gtest/test/gtest_pred_impl_unittest.cc (+2427/-0) 3rd_party/gmock/gtest/test/gtest_prod_test.cc (+57/-0) 3rd_party/gmock/gtest/test/gtest_repeat_test.cc (+253/-0) 3rd_party/gmock/gtest/test/gtest_shuffle_test.py (+325/-0) 3rd_party/gmock/gtest/test/gtest_shuffle_test_.cc (+103/-0) 3rd_party/gmock/gtest/test/gtest_sole_header_test.cc (+57/-0) 3rd_party/gmock/gtest/test/gtest_stress_test.cc (+256/-0) 3rd_party/gmock/gtest/test/gtest_test_utils.py (+305/-0) 3rd_party/gmock/gtest/test/gtest_throw_on_failure_ex_test.cc (+92/-0) 3rd_party/gmock/gtest/test/gtest_throw_on_failure_test.py (+171/-0) 3rd_party/gmock/gtest/test/gtest_throw_on_failure_test_.cc (+72/-0) 3rd_party/gmock/gtest/test/gtest_uninitialized_test.py (+70/-0) 3rd_party/gmock/gtest/test/gtest_uninitialized_test_.cc (+43/-0) 3rd_party/gmock/gtest/test/gtest_unittest.cc (+7415/-0) 3rd_party/gmock/gtest/test/gtest_xml_outfile1_test_.cc (+49/-0) 3rd_party/gmock/gtest/test/gtest_xml_outfile2_test_.cc (+49/-0) 3rd_party/gmock/gtest/test/gtest_xml_outfiles_test.py (+132/-0) 3rd_party/gmock/gtest/test/gtest_xml_output_unittest.py (+307/-0) 3rd_party/gmock/gtest/test/gtest_xml_output_unittest_.cc (+181/-0) 3rd_party/gmock/gtest/test/gtest_xml_test_utils.py (+194/-0) 3rd_party/gmock/gtest/test/production.cc (+36/-0) 3rd_party/gmock/gtest/test/production.h (+55/-0) 3rd_party/gmock/gtest/xcode/Config/DebugProject.xcconfig (+30/-0) 3rd_party/gmock/gtest/xcode/Config/FrameworkTarget.xcconfig (+17/-0) 3rd_party/gmock/gtest/xcode/Config/General.xcconfig (+41/-0) 3rd_party/gmock/gtest/xcode/Config/ReleaseProject.xcconfig (+32/-0) 3rd_party/gmock/gtest/xcode/Config/StaticLibraryTarget.xcconfig (+18/-0) 3rd_party/gmock/gtest/xcode/Config/TestTarget.xcconfig (+8/-0) 3rd_party/gmock/gtest/xcode/Resources/Info.plist (+30/-0) 3rd_party/gmock/gtest/xcode/Samples/FrameworkSample/Info.plist (+28/-0) 3rd_party/gmock/gtest/xcode/Samples/FrameworkSample/runtests.sh (+62/-0) 3rd_party/gmock/gtest/xcode/Samples/FrameworkSample/widget.cc (+63/-0) 3rd_party/gmock/gtest/xcode/Samples/FrameworkSample/widget.h (+59/-0) 3rd_party/gmock/gtest/xcode/Samples/FrameworkSample/widget_test.cc (+68/-0) 3rd_party/gmock/gtest/xcode/Scripts/runtests.sh (+65/-0) 3rd_party/gmock/gtest/xcode/Scripts/versiongenerate.py (+100/-0) 3rd_party/gmock/src/gmock-all.cc (+47/-0) 3rd_party/gmock/src/gmock-cardinalities.cc (+156/-0) 3rd_party/gmock/src/gmock-internal-utils.cc (+174/-0) 3rd_party/gmock/src/gmock-matchers.cc (+137/-0) 3rd_party/gmock/src/gmock-spec-builders.cc (+813/-0) 3rd_party/gmock/src/gmock.cc (+182/-0) 3rd_party/gmock/src/gmock_main.cc (+54/-0) CMakeLists.txt (+4/-0) accounts/applications/CMakeLists.txt (+4/-4) accounts/applications/calendar-sync.application.in (+7/-6) accounts/applications/contacts-sync.application.in (+7/-6) accounts/services/CMakeLists.txt (+4/-0) accounts/services/google-caldav.service.in (+2/-1) accounts/services/google-carddav.service.in (+2/-1) accounts/services/yahoo-caldav.service.in (+15/-0) accounts/services/yahoo-carddav.service.in (+15/-0) config.h.in (+4/-0) data/CMakeLists.txt (+8/-0) data/com.canonical.SyncMonitor.service.in (+3/-0) debian/changelog (+1/-1) debian/control (+19/-17) debian/copyright (+63/-7) debian/rules (+0/-4) debian/sync-monitor.install (+3/-1) src/CMakeLists.txt (+31/-9) src/address-book-trigger.cpp (+0/-71) src/address-book-trigger.h (+0/-45) src/eds-helper.cpp (+174/-0) src/eds-helper.h (+59/-0) src/main.cpp (+2/-0) src/notify-message-mock.cpp (+2/-1) src/notify-message-notify.cpp (+3/-2) src/notify-message.h (+1/-1) src/provider-template.cpp (+78/-0) src/provider-template.h (+42/-0) src/sync-account.cpp (+369/-176) src/sync-account.h (+44/-23) src/sync-configure.cpp (+241/-0) src/sync-configure.h (+65/-0) src/sync-daemon.cpp (+229/-75) src/sync-daemon.h (+34/-13) src/sync-dbus.cpp (+100/-0) src/sync-dbus.h (+101/-0) src/sync-queue.cpp (+105/-0) src/sync-queue.h (+47/-0) src/syncevolution-session-proxy.cpp (+17/-10) src/syncevolution-session-proxy.h (+1/-1) templates/CMakeLists.txt (+8/-0) templates/google.conf (+13/-0) templates/yahoo.conf (+5/-0) tests/CMakeLists.txt (+1/-0) tests/unittest/CMakeLists.txt (+26/-0) tests/unittest/sync-account-mock.h (+37/-0) tests/unittest/sync-queue-test.cpp (+201/-0) |
To merge this branch: | bzr merge lp:~sil2100/sync-monitor/packaging_review |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
PS Jenkins bot | continuous-integration | Approve | |
Ubuntu Phablet Team | Pending | ||
Review via email: mp+214781@code.launchpad.net |
Commit message
Basic preliminary packaging review. Fixed packaging, copyright and changed the install directory (/usr/libdir is not valid in Ubuntu)
Description of the change
Basic preliminary packaging review. Fixed packaging, copyright and changed the install directory (/usr/libdir is not valid in Ubuntu)
- 59. By Łukasz Zemczak
-
Merge latest trunk
PS Jenkins bot (ps-jenkins) wrote : | # |
PS Jenkins bot (ps-jenkins) wrote : | # |
PASSED: Continuous integration, rev:59
http://
Executed test runs:
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
Preview Diff
1 | === added directory '.bzr-builddeb' |
2 | === added file '.bzr-builddeb/default.conf' |
3 | --- .bzr-builddeb/default.conf 1970-01-01 00:00:00 +0000 |
4 | +++ .bzr-builddeb/default.conf 2014-04-08 15:07:37 +0000 |
5 | @@ -0,0 +1,2 @@ |
6 | +[BUILDDEB] |
7 | +split = True |
8 | |
9 | === added file '.bzrignore' |
10 | --- .bzrignore 1970-01-01 00:00:00 +0000 |
11 | +++ .bzrignore 2014-04-08 15:07:37 +0000 |
12 | @@ -0,0 +1,2 @@ |
13 | +CMakeLists.txt.user |
14 | +build |
15 | |
16 | === modified file '3rd_party/CMakeLists.txt' |
17 | --- 3rd_party/CMakeLists.txt 2014-02-14 22:58:16 +0000 |
18 | +++ 3rd_party/CMakeLists.txt 2014-04-08 15:07:37 +0000 |
19 | @@ -1,1 +1,2 @@ |
20 | add_subdirectory(syncevolution-qt) |
21 | +add_subdirectory(gmock) |
22 | |
23 | === added directory '3rd_party/gmock' |
24 | === added file '3rd_party/gmock/CMakeLists.txt' |
25 | --- 3rd_party/gmock/CMakeLists.txt 1970-01-01 00:00:00 +0000 |
26 | +++ 3rd_party/gmock/CMakeLists.txt 2014-04-08 15:07:37 +0000 |
27 | @@ -0,0 +1,171 @@ |
28 | +######################################################################## |
29 | +# CMake build script for Google Mock. |
30 | +# |
31 | +# To run the tests for Google Mock itself on Linux, use 'make test' or |
32 | +# ctest. You can select which tests to run using 'ctest -R regex'. |
33 | +# For more options, run 'ctest --help'. |
34 | + |
35 | +# BUILD_SHARED_LIBS is a standard CMake variable, but we declare it here to |
36 | +# make it prominent in the GUI. |
37 | +option(BUILD_SHARED_LIBS "Build shared libraries (DLLs)." OFF) |
38 | + |
39 | +option(gmock_build_tests "Build all of Google Mock's own tests." OFF) |
40 | + |
41 | +# A directory to find Google Test sources. |
42 | +if (EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/gtest/CMakeLists.txt") |
43 | + set(gtest_dir gtest) |
44 | +else() |
45 | + set(gtest_dir ../gtest) |
46 | +endif() |
47 | + |
48 | +# Defines pre_project_set_up_hermetic_build() and set_up_hermetic_build(). |
49 | +include("${gtest_dir}/cmake/hermetic_build.cmake" OPTIONAL) |
50 | + |
51 | +if (COMMAND pre_project_set_up_hermetic_build) |
52 | + # Google Test also calls hermetic setup functions from add_subdirectory, |
53 | + # although its changes will not affect things at the current scope. |
54 | + pre_project_set_up_hermetic_build() |
55 | +endif() |
56 | + |
57 | +######################################################################## |
58 | +# |
59 | +# Project-wide settings |
60 | + |
61 | +# Name of the project. |
62 | +# |
63 | +# CMake files in this project can refer to the root source directory |
64 | +# as ${gmock_SOURCE_DIR} and to the root binary directory as |
65 | +# ${gmock_BINARY_DIR}. |
66 | +# Language "C" is required for find_package(Threads). |
67 | +project(gmock CXX C) |
68 | +cmake_minimum_required(VERSION 2.6.2) |
69 | + |
70 | +if (COMMAND set_up_hermetic_build) |
71 | + set_up_hermetic_build() |
72 | +endif() |
73 | + |
74 | +# Instructs CMake to process Google Test's CMakeLists.txt and add its |
75 | +# targets to the current scope. We are placing Google Test's binary |
76 | +# directory in a subdirectory of our own as VC compilation may break |
77 | +# if they are the same (the default). |
78 | +add_subdirectory("${gtest_dir}" "${gmock_BINARY_DIR}/gtest") |
79 | + |
80 | +# Although Google Test's CMakeLists.txt calls this function, the |
81 | +# changes there don't affect the current scope. Therefore we have to |
82 | +# call it again here. |
83 | +config_compiler_and_linker() # from ${gtest_dir}/cmake/internal_utils.cmake |
84 | + |
85 | +# Adds Google Mock's and Google Test's header directories to the search path. |
86 | +include_directories("${gmock_SOURCE_DIR}/include" |
87 | + "${gmock_SOURCE_DIR}" |
88 | + "${gtest_SOURCE_DIR}/include" |
89 | + # This directory is needed to build directly from Google |
90 | + # Test sources. |
91 | + "${gtest_SOURCE_DIR}") |
92 | + |
93 | +######################################################################## |
94 | +# |
95 | +# Defines the gmock & gmock_main libraries. User tests should link |
96 | +# with one of them. |
97 | + |
98 | +# Google Mock libraries. We build them using more strict warnings than what |
99 | +# are used for other targets, to ensure that Google Mock can be compiled by |
100 | +# a user aggressive about warnings. |
101 | +cxx_library(gmock |
102 | + "${cxx_strict}" |
103 | + "${gtest_dir}/src/gtest-all.cc" |
104 | + src/gmock-all.cc) |
105 | + |
106 | +cxx_library(gmock_main |
107 | + "${cxx_strict}" |
108 | + "${gtest_dir}/src/gtest-all.cc" |
109 | + src/gmock-all.cc |
110 | + src/gmock_main.cc) |
111 | + |
112 | +######################################################################## |
113 | +# |
114 | +# Google Mock's own tests. |
115 | +# |
116 | +# You can skip this section if you aren't interested in testing |
117 | +# Google Mock itself. |
118 | +# |
119 | +# The tests are not built by default. To build them, set the |
120 | +# gmock_build_tests option to ON. You can do it by running ccmake |
121 | +# or specifying the -Dgmock_build_tests=ON flag when running cmake. |
122 | + |
123 | +if (gmock_build_tests) |
124 | + # This must be set in the root directory for the tests to be run by |
125 | + # 'make test' or ctest. |
126 | + enable_testing() |
127 | + |
128 | + ############################################################ |
129 | + # C++ tests built with standard compiler flags. |
130 | + |
131 | + cxx_test(gmock-actions_test gmock_main) |
132 | + cxx_test(gmock-cardinalities_test gmock_main) |
133 | + cxx_test(gmock_ex_test gmock_main) |
134 | + cxx_test(gmock-generated-actions_test gmock_main) |
135 | + cxx_test(gmock-generated-function-mockers_test gmock_main) |
136 | + cxx_test(gmock-generated-internal-utils_test gmock_main) |
137 | + cxx_test(gmock-generated-matchers_test gmock_main) |
138 | + cxx_test(gmock-internal-utils_test gmock_main) |
139 | + cxx_test(gmock-matchers_test gmock_main) |
140 | + cxx_test(gmock-more-actions_test gmock_main) |
141 | + cxx_test(gmock-nice-strict_test gmock_main) |
142 | + cxx_test(gmock-port_test gmock_main) |
143 | + cxx_test(gmock-spec-builders_test gmock_main) |
144 | + cxx_test(gmock_link_test gmock_main test/gmock_link2_test.cc) |
145 | + cxx_test(gmock_test gmock_main) |
146 | + |
147 | + if (CMAKE_USE_PTHREADS_INIT) |
148 | + cxx_test(gmock_stress_test gmock) |
149 | + endif() |
150 | + |
151 | + # gmock_all_test is commented to save time building and running tests. |
152 | + # Uncomment if necessary. |
153 | + # cxx_test(gmock_all_test gmock_main) |
154 | + |
155 | + ############################################################ |
156 | + # C++ tests built with non-standard compiler flags. |
157 | + |
158 | + cxx_library(gmock_main_no_exception "${cxx_no_exception}" |
159 | + "${gtest_dir}/src/gtest-all.cc" src/gmock-all.cc src/gmock_main.cc) |
160 | + |
161 | + cxx_library(gmock_main_no_rtti "${cxx_no_rtti}" |
162 | + "${gtest_dir}/src/gtest-all.cc" src/gmock-all.cc src/gmock_main.cc) |
163 | + |
164 | + cxx_library(gmock_main_use_own_tuple "${cxx_use_own_tuple}" |
165 | + "${gtest_dir}/src/gtest-all.cc" src/gmock-all.cc src/gmock_main.cc) |
166 | + |
167 | + cxx_test_with_flags(gmock-more-actions_no_exception_test "${cxx_no_exception}" |
168 | + gmock_main_no_exception test/gmock-more-actions_test.cc) |
169 | + |
170 | + cxx_test_with_flags(gmock_no_rtti_test "${cxx_no_rtti}" |
171 | + gmock_main_no_rtti test/gmock-spec-builders_test.cc) |
172 | + |
173 | + cxx_test_with_flags(gmock_use_own_tuple_test "${cxx_use_own_tuple}" |
174 | + gmock_main_use_own_tuple test/gmock-spec-builders_test.cc) |
175 | + |
176 | + cxx_shared_library(shared_gmock_main "${cxx_default}" |
177 | + "${gtest_dir}/src/gtest-all.cc" src/gmock-all.cc src/gmock_main.cc) |
178 | + |
179 | + # Tests that a binary can be built with Google Mock as a shared library. On |
180 | + # some system configurations, it may not possible to run the binary without |
181 | + # knowing more details about the system configurations. We do not try to run |
182 | + # this binary. To get a more robust shared library coverage, configure with |
183 | + # -DBUILD_SHARED_LIBS=ON. |
184 | + cxx_executable_with_flags(shared_gmock_test_ "${cxx_default}" |
185 | + shared_gmock_main test/gmock-spec-builders_test.cc) |
186 | + set_target_properties(shared_gmock_test_ |
187 | + PROPERTIES |
188 | + COMPILE_DEFINITIONS "GTEST_LINKED_AS_SHARED_LIBRARY=1") |
189 | + |
190 | + ############################################################ |
191 | + # Python tests. |
192 | + |
193 | + cxx_executable(gmock_leak_test_ test gmock_main) |
194 | + py_test(gmock_leak_test) |
195 | + |
196 | + cxx_executable(gmock_output_test_ test gmock) |
197 | + py_test(gmock_output_test) |
198 | +endif() |
199 | |
200 | === added directory '3rd_party/gmock/gtest' |
201 | === added file '3rd_party/gmock/gtest/CHANGES' |
202 | --- 3rd_party/gmock/gtest/CHANGES 1970-01-01 00:00:00 +0000 |
203 | +++ 3rd_party/gmock/gtest/CHANGES 2014-04-08 15:07:37 +0000 |
204 | @@ -0,0 +1,153 @@ |
205 | +Changes for 1.7.0: |
206 | + |
207 | +* New feature: death tests are supported on OpenBSD and in iOS |
208 | + simulator now. |
209 | +* New feature: Test::RecordProperty() can now be used outside of the |
210 | + lifespan of a test method, in which case it will be attributed to |
211 | + the current test case or the test program in the XML report. |
212 | +* New feature (potentially breaking): --gtest_list_tests now prints |
213 | + the type parameters and value parameters for each test. |
214 | +* Improvement: char pointers and char arrays are now escaped properly |
215 | + in failure messages. |
216 | +* Improvement: failure summary in XML reports now includes file and |
217 | + line information. |
218 | +* Improvement: the <testsuites> XML element now has a timestamp attribute. |
219 | +* Improvement: When --gtest_filter is specified, XML report now doesn't |
220 | + contain information about tests that are filtered out. |
221 | +* Fixed the bug where long --gtest_filter flag values are truncated in |
222 | + death tests. |
223 | +* Potentially breaking change: RUN_ALL_TESTS() is now implemented as a |
224 | + function instead of a macro in order to work better with Clang. |
225 | +* Compatibility fixes with C++ 11 and various platforms. |
226 | +* Bug/warning fixes. |
227 | + |
228 | +Changes for 1.6.0: |
229 | + |
230 | +* New feature: ADD_FAILURE_AT() for reporting a test failure at the |
231 | + given source location -- useful for writing testing utilities. |
232 | +* New feature: the universal value printer is moved from Google Mock |
233 | + to Google Test. |
234 | +* New feature: type parameters and value parameters are reported in |
235 | + the XML report now. |
236 | +* A gtest_disable_pthreads CMake option. |
237 | +* Colored output works in GNU Screen sessions now. |
238 | +* Parameters of value-parameterized tests are now printed in the |
239 | + textual output. |
240 | +* Failures from ad hoc test assertions run before RUN_ALL_TESTS() are |
241 | + now correctly reported. |
242 | +* Arguments of ASSERT_XY and EXPECT_XY no longer need to support << to |
243 | + ostream. |
244 | +* More complete handling of exceptions. |
245 | +* GTEST_ASSERT_XY can be used instead of ASSERT_XY in case the latter |
246 | + name is already used by another library. |
247 | +* --gtest_catch_exceptions is now true by default, allowing a test |
248 | + program to continue after an exception is thrown. |
249 | +* Value-parameterized test fixtures can now derive from Test and |
250 | + WithParamInterface<T> separately, easing conversion of legacy tests. |
251 | +* Death test messages are clearly marked to make them more |
252 | + distinguishable from other messages. |
253 | +* Compatibility fixes for Android, Google Native Client, MinGW, HP UX, |
254 | + PowerPC, Lucid autotools, libCStd, Sun C++, Borland C++ Builder (Code Gear), |
255 | + IBM XL C++ (Visual Age C++), and C++0x. |
256 | +* Bug fixes and implementation clean-ups. |
257 | +* Potentially incompatible changes: disables the harmful 'make install' |
258 | + command in autotools. |
259 | + |
260 | +Changes for 1.5.0: |
261 | + |
262 | + * New feature: assertions can be safely called in multiple threads |
263 | + where the pthreads library is available. |
264 | + * New feature: predicates used inside EXPECT_TRUE() and friends |
265 | + can now generate custom failure messages. |
266 | + * New feature: Google Test can now be compiled as a DLL. |
267 | + * New feature: fused source files are included. |
268 | + * New feature: prints help when encountering unrecognized Google Test flags. |
269 | + * Experimental feature: CMake build script (requires CMake 2.6.4+). |
270 | + * Experimental feature: the Pump script for meta programming. |
271 | + * double values streamed to an assertion are printed with enough precision |
272 | + to differentiate any two different values. |
273 | + * Google Test now works on Solaris and AIX. |
274 | + * Build and test script improvements. |
275 | + * Bug fixes and implementation clean-ups. |
276 | + |
277 | + Potentially breaking changes: |
278 | + |
279 | + * Stopped supporting VC++ 7.1 with exceptions disabled. |
280 | + * Dropped support for 'make install'. |
281 | + |
282 | +Changes for 1.4.0: |
283 | + |
284 | + * New feature: the event listener API |
285 | + * New feature: test shuffling |
286 | + * New feature: the XML report format is closer to junitreport and can |
287 | + be parsed by Hudson now. |
288 | + * New feature: when a test runs under Visual Studio, its failures are |
289 | + integrated in the IDE. |
290 | + * New feature: /MD(d) versions of VC++ projects. |
291 | + * New feature: elapsed time for the tests is printed by default. |
292 | + * New feature: comes with a TR1 tuple implementation such that Boost |
293 | + is no longer needed for Combine(). |
294 | + * New feature: EXPECT_DEATH_IF_SUPPORTED macro and friends. |
295 | + * New feature: the Xcode project can now produce static gtest |
296 | + libraries in addition to a framework. |
297 | + * Compatibility fixes for Solaris, Cygwin, minGW, Windows Mobile, |
298 | + Symbian, gcc, and C++Builder. |
299 | + * Bug fixes and implementation clean-ups. |
300 | + |
301 | +Changes for 1.3.0: |
302 | + |
303 | + * New feature: death tests on Windows, Cygwin, and Mac. |
304 | + * New feature: ability to use Google Test assertions in other testing |
305 | + frameworks. |
306 | + * New feature: ability to run disabled test via |
307 | + --gtest_also_run_disabled_tests. |
308 | + * New feature: the --help flag for printing the usage. |
309 | + * New feature: access to Google Test flag values in user code. |
310 | + * New feature: a script that packs Google Test into one .h and one |
311 | + .cc file for easy deployment. |
312 | + * New feature: support for distributing test functions to multiple |
313 | + machines (requires support from the test runner). |
314 | + * Bug fixes and implementation clean-ups. |
315 | + |
316 | +Changes for 1.2.1: |
317 | + |
318 | + * Compatibility fixes for Linux IA-64 and IBM z/OS. |
319 | + * Added support for using Boost and other TR1 implementations. |
320 | + * Changes to the build scripts to support upcoming release of Google C++ |
321 | + Mocking Framework. |
322 | + * Added Makefile to the distribution package. |
323 | + * Improved build instructions in README. |
324 | + |
325 | +Changes for 1.2.0: |
326 | + |
327 | + * New feature: value-parameterized tests. |
328 | + * New feature: the ASSERT/EXPECT_(NON)FATAL_FAILURE(_ON_ALL_THREADS) |
329 | + macros. |
330 | + * Changed the XML report format to match JUnit/Ant's. |
331 | + * Added tests to the Xcode project. |
332 | + * Added scons/SConscript for building with SCons. |
333 | + * Added src/gtest-all.cc for building Google Test from a single file. |
334 | + * Fixed compatibility with Solaris and z/OS. |
335 | + * Enabled running Python tests on systems with python 2.3 installed, |
336 | + e.g. Mac OS X 10.4. |
337 | + * Bug fixes. |
338 | + |
339 | +Changes for 1.1.0: |
340 | + |
341 | + * New feature: type-parameterized tests. |
342 | + * New feature: exception assertions. |
343 | + * New feature: printing elapsed time of tests. |
344 | + * Improved the robustness of death tests. |
345 | + * Added an Xcode project and samples. |
346 | + * Adjusted the output format on Windows to be understandable by Visual Studio. |
347 | + * Minor bug fixes. |
348 | + |
349 | +Changes for 1.0.1: |
350 | + |
351 | + * Added project files for Visual Studio 7.1. |
352 | + * Fixed issues with compiling on Mac OS X. |
353 | + * Fixed issues with compiling on Cygwin. |
354 | + |
355 | +Changes for 1.0.0: |
356 | + |
357 | + * Initial Open Source release of Google Test |
358 | |
359 | === added file '3rd_party/gmock/gtest/CMakeLists.txt' |
360 | --- 3rd_party/gmock/gtest/CMakeLists.txt 1970-01-01 00:00:00 +0000 |
361 | +++ 3rd_party/gmock/gtest/CMakeLists.txt 2014-04-08 15:07:37 +0000 |
362 | @@ -0,0 +1,250 @@ |
363 | +######################################################################## |
364 | +# CMake build script for Google Test. |
365 | +# |
366 | +# To run the tests for Google Test itself on Linux, use 'make test' or |
367 | +# ctest. You can select which tests to run using 'ctest -R regex'. |
368 | +# For more options, run 'ctest --help'. |
369 | + |
370 | +# BUILD_SHARED_LIBS is a standard CMake variable, but we declare it here to |
371 | +# make it prominent in the GUI. |
372 | +option(BUILD_SHARED_LIBS "Build shared libraries (DLLs)." OFF) |
373 | + |
374 | +# When other libraries are using a shared version of runtime libraries, |
375 | +# Google Test also has to use one. |
376 | +option( |
377 | + gtest_force_shared_crt |
378 | + "Use shared (DLL) run-time lib even when Google Test is built as static lib." |
379 | + OFF) |
380 | + |
381 | +option(gtest_build_tests "Build all of gtest's own tests." OFF) |
382 | + |
383 | +option(gtest_build_samples "Build gtest's sample programs." OFF) |
384 | + |
385 | +option(gtest_disable_pthreads "Disable uses of pthreads in gtest." OFF) |
386 | + |
387 | +# Defines pre_project_set_up_hermetic_build() and set_up_hermetic_build(). |
388 | +include(cmake/hermetic_build.cmake OPTIONAL) |
389 | + |
390 | +if (COMMAND pre_project_set_up_hermetic_build) |
391 | + pre_project_set_up_hermetic_build() |
392 | +endif() |
393 | + |
394 | +######################################################################## |
395 | +# |
396 | +# Project-wide settings |
397 | + |
398 | +# Name of the project. |
399 | +# |
400 | +# CMake files in this project can refer to the root source directory |
401 | +# as ${gtest_SOURCE_DIR} and to the root binary directory as |
402 | +# ${gtest_BINARY_DIR}. |
403 | +# Language "C" is required for find_package(Threads). |
404 | +project(gtest CXX C) |
405 | +cmake_minimum_required(VERSION 2.6.2) |
406 | + |
407 | +if (COMMAND set_up_hermetic_build) |
408 | + set_up_hermetic_build() |
409 | +endif() |
410 | + |
411 | +# Define helper functions and macros used by Google Test. |
412 | +include(cmake/internal_utils.cmake) |
413 | + |
414 | +config_compiler_and_linker() # Defined in internal_utils.cmake. |
415 | + |
416 | +# Where Google Test's .h files can be found. |
417 | +include_directories( |
418 | + ${gtest_SOURCE_DIR}/include |
419 | + ${gtest_SOURCE_DIR}) |
420 | + |
421 | +# Where Google Test's libraries can be found. |
422 | +link_directories(${gtest_BINARY_DIR}/src) |
423 | + |
424 | +######################################################################## |
425 | +# |
426 | +# Defines the gtest & gtest_main libraries. User tests should link |
427 | +# with one of them. |
428 | + |
429 | +# Google Test libraries. We build them using more strict warnings than what |
430 | +# are used for other targets, to ensure that gtest can be compiled by a user |
431 | +# aggressive about warnings. |
432 | +cxx_library(gtest "${cxx_strict}" src/gtest-all.cc) |
433 | +cxx_library(gtest_main "${cxx_strict}" src/gtest_main.cc) |
434 | +target_link_libraries(gtest_main gtest) |
435 | + |
436 | +######################################################################## |
437 | +# |
438 | +# Samples on how to link user tests with gtest or gtest_main. |
439 | +# |
440 | +# They are not built by default. To build them, set the |
441 | +# gtest_build_samples option to ON. You can do it by running ccmake |
442 | +# or specifying the -Dbuild_gtest_samples=ON flag when running cmake. |
443 | + |
444 | +if (gtest_build_samples) |
445 | + cxx_executable(sample1_unittest samples gtest_main samples/sample1.cc) |
446 | + cxx_executable(sample2_unittest samples gtest_main samples/sample2.cc) |
447 | + cxx_executable(sample3_unittest samples gtest_main) |
448 | + cxx_executable(sample4_unittest samples gtest_main samples/sample4.cc) |
449 | + cxx_executable(sample5_unittest samples gtest_main samples/sample1.cc) |
450 | + cxx_executable(sample6_unittest samples gtest_main) |
451 | + cxx_executable(sample7_unittest samples gtest_main) |
452 | + cxx_executable(sample8_unittest samples gtest_main) |
453 | + cxx_executable(sample9_unittest samples gtest) |
454 | + cxx_executable(sample10_unittest samples gtest) |
455 | +endif() |
456 | + |
457 | +######################################################################## |
458 | +# |
459 | +# Google Test's own tests. |
460 | +# |
461 | +# You can skip this section if you aren't interested in testing |
462 | +# Google Test itself. |
463 | +# |
464 | +# The tests are not built by default. To build them, set the |
465 | +# gtest_build_tests option to ON. You can do it by running ccmake |
466 | +# or specifying the -Dgtest_build_tests=ON flag when running cmake. |
467 | + |
468 | +if (gtest_build_tests) |
469 | + # This must be set in the root directory for the tests to be run by |
470 | + # 'make test' or ctest. |
471 | + enable_testing() |
472 | + |
473 | + ############################################################ |
474 | + # C++ tests built with standard compiler flags. |
475 | + |
476 | + cxx_test(gtest-death-test_test gtest_main) |
477 | + cxx_test(gtest_environment_test gtest) |
478 | + cxx_test(gtest-filepath_test gtest_main) |
479 | + cxx_test(gtest-linked_ptr_test gtest_main) |
480 | + cxx_test(gtest-listener_test gtest_main) |
481 | + cxx_test(gtest_main_unittest gtest_main) |
482 | + cxx_test(gtest-message_test gtest_main) |
483 | + cxx_test(gtest_no_test_unittest gtest) |
484 | + cxx_test(gtest-options_test gtest_main) |
485 | + cxx_test(gtest-param-test_test gtest |
486 | + test/gtest-param-test2_test.cc) |
487 | + cxx_test(gtest-port_test gtest_main) |
488 | + cxx_test(gtest_pred_impl_unittest gtest_main) |
489 | + cxx_test(gtest-printers_test gtest_main) |
490 | + cxx_test(gtest_prod_test gtest_main |
491 | + test/production.cc) |
492 | + cxx_test(gtest_repeat_test gtest) |
493 | + cxx_test(gtest_sole_header_test gtest_main) |
494 | + cxx_test(gtest_stress_test gtest) |
495 | + cxx_test(gtest-test-part_test gtest_main) |
496 | + cxx_test(gtest_throw_on_failure_ex_test gtest) |
497 | + cxx_test(gtest-typed-test_test gtest_main |
498 | + test/gtest-typed-test2_test.cc) |
499 | + cxx_test(gtest_unittest gtest_main) |
500 | + cxx_test(gtest-unittest-api_test gtest) |
501 | + |
502 | + ############################################################ |
503 | + # C++ tests built with non-standard compiler flags. |
504 | + |
505 | + # MSVC 7.1 does not support STL with exceptions disabled. |
506 | + if (NOT MSVC OR MSVC_VERSION GREATER 1310) |
507 | + cxx_library(gtest_no_exception "${cxx_no_exception}" |
508 | + src/gtest-all.cc) |
509 | + cxx_library(gtest_main_no_exception "${cxx_no_exception}" |
510 | + src/gtest-all.cc src/gtest_main.cc) |
511 | + endif() |
512 | + cxx_library(gtest_main_no_rtti "${cxx_no_rtti}" |
513 | + src/gtest-all.cc src/gtest_main.cc) |
514 | + |
515 | + cxx_test_with_flags(gtest-death-test_ex_nocatch_test |
516 | + "${cxx_exception} -DGTEST_ENABLE_CATCH_EXCEPTIONS_=0" |
517 | + gtest test/gtest-death-test_ex_test.cc) |
518 | + cxx_test_with_flags(gtest-death-test_ex_catch_test |
519 | + "${cxx_exception} -DGTEST_ENABLE_CATCH_EXCEPTIONS_=1" |
520 | + gtest test/gtest-death-test_ex_test.cc) |
521 | + |
522 | + cxx_test_with_flags(gtest_no_rtti_unittest "${cxx_no_rtti}" |
523 | + gtest_main_no_rtti test/gtest_unittest.cc) |
524 | + |
525 | + cxx_shared_library(gtest_dll "${cxx_default}" |
526 | + src/gtest-all.cc src/gtest_main.cc) |
527 | + |
528 | + cxx_executable_with_flags(gtest_dll_test_ "${cxx_default}" |
529 | + gtest_dll test/gtest_all_test.cc) |
530 | + set_target_properties(gtest_dll_test_ |
531 | + PROPERTIES |
532 | + COMPILE_DEFINITIONS "GTEST_LINKED_AS_SHARED_LIBRARY=1") |
533 | + |
534 | + if (NOT MSVC OR NOT MSVC_VERSION EQUAL 1600) |
535 | + # The C++ Standard specifies tuple_element<int, class>. |
536 | + # Yet MSVC 10's <utility> declares tuple_element<size_t, class>. |
537 | + # That declaration conflicts with our own standard-conforming |
538 | + # tuple implementation. Therefore using our own tuple with |
539 | + # MSVC 10 doesn't compile. |
540 | + cxx_library(gtest_main_use_own_tuple "${cxx_use_own_tuple}" |
541 | + src/gtest-all.cc src/gtest_main.cc) |
542 | + |
543 | + cxx_test_with_flags(gtest-tuple_test "${cxx_use_own_tuple}" |
544 | + gtest_main_use_own_tuple test/gtest-tuple_test.cc) |
545 | + |
546 | + cxx_test_with_flags(gtest_use_own_tuple_test "${cxx_use_own_tuple}" |
547 | + gtest_main_use_own_tuple |
548 | + test/gtest-param-test_test.cc test/gtest-param-test2_test.cc) |
549 | + endif() |
550 | + |
551 | + ############################################################ |
552 | + # Python tests. |
553 | + |
554 | + cxx_executable(gtest_break_on_failure_unittest_ test gtest) |
555 | + py_test(gtest_break_on_failure_unittest) |
556 | + |
557 | + # MSVC 7.1 does not support STL with exceptions disabled. |
558 | + if (NOT MSVC OR MSVC_VERSION GREATER 1310) |
559 | + cxx_executable_with_flags( |
560 | + gtest_catch_exceptions_no_ex_test_ |
561 | + "${cxx_no_exception}" |
562 | + gtest_main_no_exception |
563 | + test/gtest_catch_exceptions_test_.cc) |
564 | + endif() |
565 | + |
566 | + cxx_executable_with_flags( |
567 | + gtest_catch_exceptions_ex_test_ |
568 | + "${cxx_exception}" |
569 | + gtest_main |
570 | + test/gtest_catch_exceptions_test_.cc) |
571 | + py_test(gtest_catch_exceptions_test) |
572 | + |
573 | + cxx_executable(gtest_color_test_ test gtest) |
574 | + py_test(gtest_color_test) |
575 | + |
576 | + cxx_executable(gtest_env_var_test_ test gtest) |
577 | + py_test(gtest_env_var_test) |
578 | + |
579 | + cxx_executable(gtest_filter_unittest_ test gtest) |
580 | + py_test(gtest_filter_unittest) |
581 | + |
582 | + cxx_executable(gtest_help_test_ test gtest_main) |
583 | + py_test(gtest_help_test) |
584 | + |
585 | + cxx_executable(gtest_list_tests_unittest_ test gtest) |
586 | + py_test(gtest_list_tests_unittest) |
587 | + |
588 | + cxx_executable(gtest_output_test_ test gtest) |
589 | + py_test(gtest_output_test) |
590 | + |
591 | + cxx_executable(gtest_shuffle_test_ test gtest) |
592 | + py_test(gtest_shuffle_test) |
593 | + |
594 | + # MSVC 7.1 does not support STL with exceptions disabled. |
595 | + if (NOT MSVC OR MSVC_VERSION GREATER 1310) |
596 | + cxx_executable(gtest_throw_on_failure_test_ test gtest_no_exception) |
597 | + set_target_properties(gtest_throw_on_failure_test_ |
598 | + PROPERTIES |
599 | + COMPILE_FLAGS "${cxx_no_exception}") |
600 | + py_test(gtest_throw_on_failure_test) |
601 | + endif() |
602 | + |
603 | + cxx_executable(gtest_uninitialized_test_ test gtest) |
604 | + py_test(gtest_uninitialized_test) |
605 | + |
606 | + cxx_executable(gtest_xml_outfile1_test_ test gtest_main) |
607 | + cxx_executable(gtest_xml_outfile2_test_ test gtest_main) |
608 | + py_test(gtest_xml_outfiles_test) |
609 | + |
610 | + cxx_executable(gtest_xml_output_unittest_ test gtest) |
611 | + py_test(gtest_xml_output_unittest) |
612 | +endif() |
613 | |
614 | === added file '3rd_party/gmock/gtest/CONTRIBUTORS' |
615 | --- 3rd_party/gmock/gtest/CONTRIBUTORS 1970-01-01 00:00:00 +0000 |
616 | +++ 3rd_party/gmock/gtest/CONTRIBUTORS 2014-04-08 15:07:37 +0000 |
617 | @@ -0,0 +1,37 @@ |
618 | +# This file contains a list of people who've made non-trivial |
619 | +# contribution to the Google C++ Testing Framework project. People |
620 | +# who commit code to the project are encouraged to add their names |
621 | +# here. Please keep the list sorted by first names. |
622 | + |
623 | +Ajay Joshi <jaj@google.com> |
624 | +Balázs Dán <balazs.dan@gmail.com> |
625 | +Bharat Mediratta <bharat@menalto.com> |
626 | +Chandler Carruth <chandlerc@google.com> |
627 | +Chris Prince <cprince@google.com> |
628 | +Chris Taylor <taylorc@google.com> |
629 | +Dan Egnor <egnor@google.com> |
630 | +Eric Roman <eroman@chromium.org> |
631 | +Hady Zalek <hady.zalek@gmail.com> |
632 | +Jeffrey Yasskin <jyasskin@google.com> |
633 | +Jói Sigurðsson <joi@google.com> |
634 | +Keir Mierle <mierle@gmail.com> |
635 | +Keith Ray <keith.ray@gmail.com> |
636 | +Kenton Varda <kenton@google.com> |
637 | +Manuel Klimek <klimek@google.com> |
638 | +Markus Heule <markus.heule@gmail.com> |
639 | +Mika Raento <mikie@iki.fi> |
640 | +Miklós Fazekas <mfazekas@szemafor.com> |
641 | +Pasi Valminen <pasi.valminen@gmail.com> |
642 | +Patrick Hanna <phanna@google.com> |
643 | +Patrick Riley <pfr@google.com> |
644 | +Peter Kaminski <piotrk@google.com> |
645 | +Preston Jackson <preston.a.jackson@gmail.com> |
646 | +Rainer Klaffenboeck <rainer.klaffenboeck@dynatrace.com> |
647 | +Russ Cox <rsc@google.com> |
648 | +Russ Rufer <russ@pentad.com> |
649 | +Sean Mcafee <eefacm@gmail.com> |
650 | +Sigurður Ásgeirsson <siggi@google.com> |
651 | +Tracy Bialik <tracy@pentad.com> |
652 | +Vadim Berman <vadimb@google.com> |
653 | +Vlad Losev <vladl@google.com> |
654 | +Zhanyong Wan <wan@google.com> |
655 | |
656 | === added file '3rd_party/gmock/gtest/Makefile.am' |
657 | --- 3rd_party/gmock/gtest/Makefile.am 1970-01-01 00:00:00 +0000 |
658 | +++ 3rd_party/gmock/gtest/Makefile.am 2014-04-08 15:07:37 +0000 |
659 | @@ -0,0 +1,305 @@ |
660 | +# Automake file |
661 | + |
662 | +ACLOCAL_AMFLAGS = -I m4 |
663 | + |
664 | +# Nonstandard package files for distribution |
665 | +EXTRA_DIST = \ |
666 | + CHANGES \ |
667 | + CONTRIBUTORS \ |
668 | + LICENSE \ |
669 | + include/gtest/gtest-param-test.h.pump \ |
670 | + include/gtest/internal/gtest-param-util-generated.h.pump \ |
671 | + include/gtest/internal/gtest-tuple.h.pump \ |
672 | + include/gtest/internal/gtest-type-util.h.pump \ |
673 | + make/Makefile \ |
674 | + scripts/fuse_gtest_files.py \ |
675 | + scripts/gen_gtest_pred_impl.py \ |
676 | + scripts/pump.py \ |
677 | + scripts/test/Makefile |
678 | + |
679 | +# gtest source files that we don't compile directly. They are |
680 | +# #included by gtest-all.cc. |
681 | +GTEST_SRC = \ |
682 | + src/gtest-death-test.cc \ |
683 | + src/gtest-filepath.cc \ |
684 | + src/gtest-internal-inl.h \ |
685 | + src/gtest-port.cc \ |
686 | + src/gtest-printers.cc \ |
687 | + src/gtest-test-part.cc \ |
688 | + src/gtest-typed-test.cc \ |
689 | + src/gtest.cc |
690 | + |
691 | +EXTRA_DIST += $(GTEST_SRC) |
692 | + |
693 | +# Sample files that we don't compile. |
694 | +EXTRA_DIST += \ |
695 | + samples/prime_tables.h \ |
696 | + samples/sample2_unittest.cc \ |
697 | + samples/sample3_unittest.cc \ |
698 | + samples/sample4_unittest.cc \ |
699 | + samples/sample5_unittest.cc \ |
700 | + samples/sample6_unittest.cc \ |
701 | + samples/sample7_unittest.cc \ |
702 | + samples/sample8_unittest.cc \ |
703 | + samples/sample9_unittest.cc |
704 | + |
705 | +# C++ test files that we don't compile directly. |
706 | +EXTRA_DIST += \ |
707 | + test/gtest-death-test_ex_test.cc \ |
708 | + test/gtest-death-test_test.cc \ |
709 | + test/gtest-filepath_test.cc \ |
710 | + test/gtest-linked_ptr_test.cc \ |
711 | + test/gtest-listener_test.cc \ |
712 | + test/gtest-message_test.cc \ |
713 | + test/gtest-options_test.cc \ |
714 | + test/gtest-param-test2_test.cc \ |
715 | + test/gtest-param-test2_test.cc \ |
716 | + test/gtest-param-test_test.cc \ |
717 | + test/gtest-param-test_test.cc \ |
718 | + test/gtest-param-test_test.h \ |
719 | + test/gtest-port_test.cc \ |
720 | + test/gtest-printers_test.cc \ |
721 | + test/gtest-test-part_test.cc \ |
722 | + test/gtest-tuple_test.cc \ |
723 | + test/gtest-typed-test2_test.cc \ |
724 | + test/gtest-typed-test_test.cc \ |
725 | + test/gtest-typed-test_test.h \ |
726 | + test/gtest-unittest-api_test.cc \ |
727 | + test/gtest_break_on_failure_unittest_.cc \ |
728 | + test/gtest_catch_exceptions_test_.cc \ |
729 | + test/gtest_color_test_.cc \ |
730 | + test/gtest_env_var_test_.cc \ |
731 | + test/gtest_environment_test.cc \ |
732 | + test/gtest_filter_unittest_.cc \ |
733 | + test/gtest_help_test_.cc \ |
734 | + test/gtest_list_tests_unittest_.cc \ |
735 | + test/gtest_main_unittest.cc \ |
736 | + test/gtest_no_test_unittest.cc \ |
737 | + test/gtest_output_test_.cc \ |
738 | + test/gtest_pred_impl_unittest.cc \ |
739 | + test/gtest_prod_test.cc \ |
740 | + test/gtest_repeat_test.cc \ |
741 | + test/gtest_shuffle_test_.cc \ |
742 | + test/gtest_sole_header_test.cc \ |
743 | + test/gtest_stress_test.cc \ |
744 | + test/gtest_throw_on_failure_ex_test.cc \ |
745 | + test/gtest_throw_on_failure_test_.cc \ |
746 | + test/gtest_uninitialized_test_.cc \ |
747 | + test/gtest_unittest.cc \ |
748 | + test/gtest_unittest.cc \ |
749 | + test/gtest_xml_outfile1_test_.cc \ |
750 | + test/gtest_xml_outfile2_test_.cc \ |
751 | + test/gtest_xml_output_unittest_.cc \ |
752 | + test/production.cc \ |
753 | + test/production.h |
754 | + |
755 | +# Python tests that we don't run. |
756 | +EXTRA_DIST += \ |
757 | + test/gtest_break_on_failure_unittest.py \ |
758 | + test/gtest_catch_exceptions_test.py \ |
759 | + test/gtest_color_test.py \ |
760 | + test/gtest_env_var_test.py \ |
761 | + test/gtest_filter_unittest.py \ |
762 | + test/gtest_help_test.py \ |
763 | + test/gtest_list_tests_unittest.py \ |
764 | + test/gtest_output_test.py \ |
765 | + test/gtest_output_test_golden_lin.txt \ |
766 | + test/gtest_shuffle_test.py \ |
767 | + test/gtest_test_utils.py \ |
768 | + test/gtest_throw_on_failure_test.py \ |
769 | + test/gtest_uninitialized_test.py \ |
770 | + test/gtest_xml_outfiles_test.py \ |
771 | + test/gtest_xml_output_unittest.py \ |
772 | + test/gtest_xml_test_utils.py |
773 | + |
774 | +# CMake script |
775 | +EXTRA_DIST += \ |
776 | + CMakeLists.txt \ |
777 | + cmake/internal_utils.cmake |
778 | + |
779 | +# MSVC project files |
780 | +EXTRA_DIST += \ |
781 | + msvc/gtest-md.sln \ |
782 | + msvc/gtest-md.vcproj \ |
783 | + msvc/gtest.sln \ |
784 | + msvc/gtest.vcproj \ |
785 | + msvc/gtest_main-md.vcproj \ |
786 | + msvc/gtest_main.vcproj \ |
787 | + msvc/gtest_prod_test-md.vcproj \ |
788 | + msvc/gtest_prod_test.vcproj \ |
789 | + msvc/gtest_unittest-md.vcproj \ |
790 | + msvc/gtest_unittest.vcproj |
791 | + |
792 | +# xcode project files |
793 | +EXTRA_DIST += \ |
794 | + xcode/Config/DebugProject.xcconfig \ |
795 | + xcode/Config/FrameworkTarget.xcconfig \ |
796 | + xcode/Config/General.xcconfig \ |
797 | + xcode/Config/ReleaseProject.xcconfig \ |
798 | + xcode/Config/StaticLibraryTarget.xcconfig \ |
799 | + xcode/Config/TestTarget.xcconfig \ |
800 | + xcode/Resources/Info.plist \ |
801 | + xcode/Scripts/runtests.sh \ |
802 | + xcode/Scripts/versiongenerate.py \ |
803 | + xcode/gtest.xcodeproj/project.pbxproj |
804 | + |
805 | +# xcode sample files |
806 | +EXTRA_DIST += \ |
807 | + xcode/Samples/FrameworkSample/Info.plist \ |
808 | + xcode/Samples/FrameworkSample/WidgetFramework.xcodeproj/project.pbxproj \ |
809 | + xcode/Samples/FrameworkSample/runtests.sh \ |
810 | + xcode/Samples/FrameworkSample/widget.cc \ |
811 | + xcode/Samples/FrameworkSample/widget.h \ |
812 | + xcode/Samples/FrameworkSample/widget_test.cc |
813 | + |
814 | +# C++Builder project files |
815 | +EXTRA_DIST += \ |
816 | + codegear/gtest.cbproj \ |
817 | + codegear/gtest.groupproj \ |
818 | + codegear/gtest_all.cc \ |
819 | + codegear/gtest_link.cc \ |
820 | + codegear/gtest_main.cbproj \ |
821 | + codegear/gtest_unittest.cbproj |
822 | + |
823 | +# Distribute and install M4 macro |
824 | +m4datadir = $(datadir)/aclocal |
825 | +m4data_DATA = m4/gtest.m4 |
826 | +EXTRA_DIST += $(m4data_DATA) |
827 | + |
828 | +# We define the global AM_CPPFLAGS as everything we compile includes from these |
829 | +# directories. |
830 | +AM_CPPFLAGS = -I$(srcdir) -I$(srcdir)/include |
831 | + |
832 | +# Modifies compiler and linker flags for pthreads compatibility. |
833 | +if HAVE_PTHREADS |
834 | + AM_CXXFLAGS = @PTHREAD_CFLAGS@ -DGTEST_HAS_PTHREAD=1 |
835 | + AM_LIBS = @PTHREAD_LIBS@ |
836 | +else |
837 | + AM_CXXFLAGS = -DGTEST_HAS_PTHREAD=0 |
838 | +endif |
839 | + |
840 | +# Build rules for libraries. |
841 | +lib_LTLIBRARIES = lib/libgtest.la lib/libgtest_main.la |
842 | + |
843 | +lib_libgtest_la_SOURCES = src/gtest-all.cc |
844 | + |
845 | +pkginclude_HEADERS = \ |
846 | + include/gtest/gtest-death-test.h \ |
847 | + include/gtest/gtest-message.h \ |
848 | + include/gtest/gtest-param-test.h \ |
849 | + include/gtest/gtest-printers.h \ |
850 | + include/gtest/gtest-spi.h \ |
851 | + include/gtest/gtest-test-part.h \ |
852 | + include/gtest/gtest-typed-test.h \ |
853 | + include/gtest/gtest.h \ |
854 | + include/gtest/gtest_pred_impl.h \ |
855 | + include/gtest/gtest_prod.h |
856 | + |
857 | +pkginclude_internaldir = $(pkgincludedir)/internal |
858 | +pkginclude_internal_HEADERS = \ |
859 | + include/gtest/internal/gtest-death-test-internal.h \ |
860 | + include/gtest/internal/gtest-filepath.h \ |
861 | + include/gtest/internal/gtest-internal.h \ |
862 | + include/gtest/internal/gtest-linked_ptr.h \ |
863 | + include/gtest/internal/gtest-param-util-generated.h \ |
864 | + include/gtest/internal/gtest-param-util.h \ |
865 | + include/gtest/internal/gtest-port.h \ |
866 | + include/gtest/internal/gtest-string.h \ |
867 | + include/gtest/internal/gtest-tuple.h \ |
868 | + include/gtest/internal/gtest-type-util.h |
869 | + |
870 | +lib_libgtest_main_la_SOURCES = src/gtest_main.cc |
871 | +lib_libgtest_main_la_LIBADD = lib/libgtest.la |
872 | + |
873 | +# Bulid rules for samples and tests. Automake's naming for some of |
874 | +# these variables isn't terribly obvious, so this is a brief |
875 | +# reference: |
876 | +# |
877 | +# TESTS -- Programs run automatically by "make check" |
878 | +# check_PROGRAMS -- Programs built by "make check" but not necessarily run |
879 | + |
880 | +noinst_LTLIBRARIES = samples/libsamples.la |
881 | + |
882 | +samples_libsamples_la_SOURCES = \ |
883 | + samples/sample1.cc \ |
884 | + samples/sample1.h \ |
885 | + samples/sample2.cc \ |
886 | + samples/sample2.h \ |
887 | + samples/sample3-inl.h \ |
888 | + samples/sample4.cc \ |
889 | + samples/sample4.h |
890 | + |
891 | +TESTS= |
892 | +TESTS_ENVIRONMENT = GTEST_SOURCE_DIR="$(srcdir)/test" \ |
893 | + GTEST_BUILD_DIR="$(top_builddir)/test" |
894 | +check_PROGRAMS= |
895 | + |
896 | +# A simple sample on using gtest. |
897 | +TESTS += samples/sample1_unittest |
898 | +check_PROGRAMS += samples/sample1_unittest |
899 | +samples_sample1_unittest_SOURCES = samples/sample1_unittest.cc |
900 | +samples_sample1_unittest_LDADD = lib/libgtest_main.la \ |
901 | + lib/libgtest.la \ |
902 | + samples/libsamples.la |
903 | + |
904 | +# Another sample. It also verifies that libgtest works. |
905 | +TESTS += samples/sample10_unittest |
906 | +check_PROGRAMS += samples/sample10_unittest |
907 | +samples_sample10_unittest_SOURCES = samples/sample10_unittest.cc |
908 | +samples_sample10_unittest_LDADD = lib/libgtest.la |
909 | + |
910 | +# This tests most constructs of gtest and verifies that libgtest_main |
911 | +# and libgtest work. |
912 | +TESTS += test/gtest_all_test |
913 | +check_PROGRAMS += test/gtest_all_test |
914 | +test_gtest_all_test_SOURCES = test/gtest_all_test.cc |
915 | +test_gtest_all_test_LDADD = lib/libgtest_main.la \ |
916 | + lib/libgtest.la |
917 | + |
918 | +# Tests that fused gtest files compile and work. |
919 | +FUSED_GTEST_SRC = \ |
920 | + fused-src/gtest/gtest-all.cc \ |
921 | + fused-src/gtest/gtest.h \ |
922 | + fused-src/gtest/gtest_main.cc |
923 | + |
924 | +if HAVE_PYTHON |
925 | +TESTS += test/fused_gtest_test |
926 | +check_PROGRAMS += test/fused_gtest_test |
927 | +test_fused_gtest_test_SOURCES = $(FUSED_GTEST_SRC) \ |
928 | + samples/sample1.cc samples/sample1_unittest.cc |
929 | +test_fused_gtest_test_CPPFLAGS = -I"$(srcdir)/fused-src" |
930 | + |
931 | +# Build rules for putting fused Google Test files into the distribution |
932 | +# package. The user can also create those files by manually running |
933 | +# scripts/fuse_gtest_files.py. |
934 | +$(test_fused_gtest_test_SOURCES): fused-gtest |
935 | + |
936 | +fused-gtest: $(pkginclude_HEADERS) $(pkginclude_internal_HEADERS) \ |
937 | + $(GTEST_SRC) src/gtest-all.cc src/gtest_main.cc \ |
938 | + scripts/fuse_gtest_files.py |
939 | + mkdir -p "$(srcdir)/fused-src" |
940 | + chmod -R u+w "$(srcdir)/fused-src" |
941 | + rm -f "$(srcdir)/fused-src/gtest/gtest-all.cc" |
942 | + rm -f "$(srcdir)/fused-src/gtest/gtest.h" |
943 | + "$(srcdir)/scripts/fuse_gtest_files.py" "$(srcdir)/fused-src" |
944 | + cp -f "$(srcdir)/src/gtest_main.cc" "$(srcdir)/fused-src/gtest/" |
945 | + |
946 | +maintainer-clean-local: |
947 | + rm -rf "$(srcdir)/fused-src" |
948 | +endif |
949 | + |
950 | +# Death tests may produce core dumps in the build directory. In case |
951 | +# this happens, clean them to keep distcleancheck happy. |
952 | +CLEANFILES = core |
953 | + |
954 | +# Disables 'make install' as installing a compiled version of Google |
955 | +# Test can lead to undefined behavior due to violation of the |
956 | +# One-Definition Rule. |
957 | + |
958 | +install-exec-local: |
959 | + echo "'make install' is dangerous and not supported. Instead, see README for how to integrate Google Test into your build system." |
960 | + false |
961 | + |
962 | +install-data-local: |
963 | + echo "'make install' is dangerous and not supported. Instead, see README for how to integrate Google Test into your build system." |
964 | + false |
965 | |
966 | === added file '3rd_party/gmock/gtest/README' |
967 | --- 3rd_party/gmock/gtest/README 1970-01-01 00:00:00 +0000 |
968 | +++ 3rd_party/gmock/gtest/README 2014-04-08 15:07:37 +0000 |
969 | @@ -0,0 +1,435 @@ |
970 | +Google C++ Testing Framework |
971 | +============================ |
972 | + |
973 | +http://code.google.com/p/googletest/ |
974 | + |
975 | +Overview |
976 | +-------- |
977 | + |
978 | +Google's framework for writing C++ tests on a variety of platforms |
979 | +(Linux, Mac OS X, Windows, Windows CE, Symbian, etc). Based on the |
980 | +xUnit architecture. Supports automatic test discovery, a rich set of |
981 | +assertions, user-defined assertions, death tests, fatal and non-fatal |
982 | +failures, various options for running the tests, and XML test report |
983 | +generation. |
984 | + |
985 | +Please see the project page above for more information as well as the |
986 | +mailing list for questions, discussions, and development. There is |
987 | +also an IRC channel on OFTC (irc.oftc.net) #gtest available. Please |
988 | +join us! |
989 | + |
990 | +Requirements for End Users |
991 | +-------------------------- |
992 | + |
993 | +Google Test is designed to have fairly minimal requirements to build |
994 | +and use with your projects, but there are some. Currently, we support |
995 | +Linux, Windows, Mac OS X, and Cygwin. We will also make our best |
996 | +effort to support other platforms (e.g. Solaris, AIX, and z/OS). |
997 | +However, since core members of the Google Test project have no access |
998 | +to these platforms, Google Test may have outstanding issues there. If |
999 | +you notice any problems on your platform, please notify |
1000 | +googletestframework@googlegroups.com. Patches for fixing them are |
1001 | +even more welcome! |
1002 | + |
1003 | +### Linux Requirements ### |
1004 | + |
1005 | +These are the base requirements to build and use Google Test from a source |
1006 | +package (as described below): |
1007 | + * GNU-compatible Make or gmake |
1008 | + * POSIX-standard shell |
1009 | + * POSIX(-2) Regular Expressions (regex.h) |
1010 | + * A C++98-standard-compliant compiler |
1011 | + |
1012 | +### Windows Requirements ### |
1013 | + |
1014 | + * Microsoft Visual C++ 7.1 or newer |
1015 | + |
1016 | +### Cygwin Requirements ### |
1017 | + |
1018 | + * Cygwin 1.5.25-14 or newer |
1019 | + |
1020 | +### Mac OS X Requirements ### |
1021 | + |
1022 | + * Mac OS X 10.4 Tiger or newer |
1023 | + * Developer Tools Installed |
1024 | + |
1025 | +Also, you'll need CMake 2.6.4 or higher if you want to build the |
1026 | +samples using the provided CMake script, regardless of the platform. |
1027 | + |
1028 | +Requirements for Contributors |
1029 | +----------------------------- |
1030 | + |
1031 | +We welcome patches. If you plan to contribute a patch, you need to |
1032 | +build Google Test and its own tests from an SVN checkout (described |
1033 | +below), which has further requirements: |
1034 | + |
1035 | + * Python version 2.3 or newer (for running some of the tests and |
1036 | + re-generating certain source files from templates) |
1037 | + * CMake 2.6.4 or newer |
1038 | + |
1039 | +Getting the Source |
1040 | +------------------ |
1041 | + |
1042 | +There are two primary ways of getting Google Test's source code: you |
1043 | +can download a stable source release in your preferred archive format, |
1044 | +or directly check out the source from our Subversion (SVN) repositary. |
1045 | +The SVN checkout requires a few extra steps and some extra software |
1046 | +packages on your system, but lets you track the latest development and |
1047 | +make patches much more easily, so we highly encourage it. |
1048 | + |
1049 | +### Source Package ### |
1050 | + |
1051 | +Google Test is released in versioned source packages which can be |
1052 | +downloaded from the download page [1]. Several different archive |
1053 | +formats are provided, but the only difference is the tools used to |
1054 | +manipulate them, and the size of the resulting file. Download |
1055 | +whichever you are most comfortable with. |
1056 | + |
1057 | + [1] http://code.google.com/p/googletest/downloads/list |
1058 | + |
1059 | +Once the package is downloaded, expand it using whichever tools you |
1060 | +prefer for that type. This will result in a new directory with the |
1061 | +name "gtest-X.Y.Z" which contains all of the source code. Here are |
1062 | +some examples on Linux: |
1063 | + |
1064 | + tar -xvzf gtest-X.Y.Z.tar.gz |
1065 | + tar -xvjf gtest-X.Y.Z.tar.bz2 |
1066 | + unzip gtest-X.Y.Z.zip |
1067 | + |
1068 | +### SVN Checkout ### |
1069 | + |
1070 | +To check out the main branch (also known as the "trunk") of Google |
1071 | +Test, run the following Subversion command: |
1072 | + |
1073 | + svn checkout http://googletest.googlecode.com/svn/trunk/ gtest-svn |
1074 | + |
1075 | +Setting up the Build |
1076 | +-------------------- |
1077 | + |
1078 | +To build Google Test and your tests that use it, you need to tell your |
1079 | +build system where to find its headers and source files. The exact |
1080 | +way to do it depends on which build system you use, and is usually |
1081 | +straightforward. |
1082 | + |
1083 | +### Generic Build Instructions ### |
1084 | + |
1085 | +Suppose you put Google Test in directory ${GTEST_DIR}. To build it, |
1086 | +create a library build target (or a project as called by Visual Studio |
1087 | +and Xcode) to compile |
1088 | + |
1089 | + ${GTEST_DIR}/src/gtest-all.cc |
1090 | + |
1091 | +with ${GTEST_DIR}/include in the system header search path and ${GTEST_DIR} |
1092 | +in the normal header search path. Assuming a Linux-like system and gcc, |
1093 | +something like the following will do: |
1094 | + |
1095 | + g++ -isystem ${GTEST_DIR}/include -I${GTEST_DIR} \ |
1096 | + -pthread -c ${GTEST_DIR}/src/gtest-all.cc |
1097 | + ar -rv libgtest.a gtest-all.o |
1098 | + |
1099 | +(We need -pthread as Google Test uses threads.) |
1100 | + |
1101 | +Next, you should compile your test source file with |
1102 | +${GTEST_DIR}/include in the system header search path, and link it |
1103 | +with gtest and any other necessary libraries: |
1104 | + |
1105 | + g++ -isystem ${GTEST_DIR}/include -pthread path/to/your_test.cc libgtest.a \ |
1106 | + -o your_test |
1107 | + |
1108 | +As an example, the make/ directory contains a Makefile that you can |
1109 | +use to build Google Test on systems where GNU make is available |
1110 | +(e.g. Linux, Mac OS X, and Cygwin). It doesn't try to build Google |
1111 | +Test's own tests. Instead, it just builds the Google Test library and |
1112 | +a sample test. You can use it as a starting point for your own build |
1113 | +script. |
1114 | + |
1115 | +If the default settings are correct for your environment, the |
1116 | +following commands should succeed: |
1117 | + |
1118 | + cd ${GTEST_DIR}/make |
1119 | + make |
1120 | + ./sample1_unittest |
1121 | + |
1122 | +If you see errors, try to tweak the contents of make/Makefile to make |
1123 | +them go away. There are instructions in make/Makefile on how to do |
1124 | +it. |
1125 | + |
1126 | +### Using CMake ### |
1127 | + |
1128 | +Google Test comes with a CMake build script (CMakeLists.txt) that can |
1129 | +be used on a wide range of platforms ("C" stands for cross-platofrm.). |
1130 | +If you don't have CMake installed already, you can download it for |
1131 | +free from http://www.cmake.org/. |
1132 | + |
1133 | +CMake works by generating native makefiles or build projects that can |
1134 | +be used in the compiler environment of your choice. The typical |
1135 | +workflow starts with: |
1136 | + |
1137 | + mkdir mybuild # Create a directory to hold the build output. |
1138 | + cd mybuild |
1139 | + cmake ${GTEST_DIR} # Generate native build scripts. |
1140 | + |
1141 | +If you want to build Google Test's samples, you should replace the |
1142 | +last command with |
1143 | + |
1144 | + cmake -Dgtest_build_samples=ON ${GTEST_DIR} |
1145 | + |
1146 | +If you are on a *nix system, you should now see a Makefile in the |
1147 | +current directory. Just type 'make' to build gtest. |
1148 | + |
1149 | +If you use Windows and have Vistual Studio installed, a gtest.sln file |
1150 | +and several .vcproj files will be created. You can then build them |
1151 | +using Visual Studio. |
1152 | + |
1153 | +On Mac OS X with Xcode installed, a .xcodeproj file will be generated. |
1154 | + |
1155 | +### Legacy Build Scripts ### |
1156 | + |
1157 | +Before settling on CMake, we have been providing hand-maintained build |
1158 | +projects/scripts for Visual Studio, Xcode, and Autotools. While we |
1159 | +continue to provide them for convenience, they are not actively |
1160 | +maintained any more. We highly recommend that you follow the |
1161 | +instructions in the previous two sections to integrate Google Test |
1162 | +with your existing build system. |
1163 | + |
1164 | +If you still need to use the legacy build scripts, here's how: |
1165 | + |
1166 | +The msvc\ folder contains two solutions with Visual C++ projects. |
1167 | +Open the gtest.sln or gtest-md.sln file using Visual Studio, and you |
1168 | +are ready to build Google Test the same way you build any Visual |
1169 | +Studio project. Files that have names ending with -md use DLL |
1170 | +versions of Microsoft runtime libraries (the /MD or the /MDd compiler |
1171 | +option). Files without that suffix use static versions of the runtime |
1172 | +libraries (the /MT or the /MTd option). Please note that one must use |
1173 | +the same option to compile both gtest and the test code. If you use |
1174 | +Visual Studio 2005 or above, we recommend the -md version as /MD is |
1175 | +the default for new projects in these versions of Visual Studio. |
1176 | + |
1177 | +On Mac OS X, open the gtest.xcodeproj in the xcode/ folder using |
1178 | +Xcode. Build the "gtest" target. The universal binary framework will |
1179 | +end up in your selected build directory (selected in the Xcode |
1180 | +"Preferences..." -> "Building" pane and defaults to xcode/build). |
1181 | +Alternatively, at the command line, enter: |
1182 | + |
1183 | + xcodebuild |
1184 | + |
1185 | +This will build the "Release" configuration of gtest.framework in your |
1186 | +default build location. See the "xcodebuild" man page for more |
1187 | +information about building different configurations and building in |
1188 | +different locations. |
1189 | + |
1190 | +If you wish to use the Google Test Xcode project with Xcode 4.x and |
1191 | +above, you need to either: |
1192 | + * update the SDK configuration options in xcode/Config/General.xconfig. |
1193 | + Comment options SDKROOT, MACOS_DEPLOYMENT_TARGET, and GCC_VERSION. If |
1194 | + you choose this route you lose the ability to target earlier versions |
1195 | + of MacOS X. |
1196 | + * Install an SDK for an earlier version. This doesn't appear to be |
1197 | + supported by Apple, but has been reported to work |
1198 | + (http://stackoverflow.com/questions/5378518). |
1199 | + |
1200 | +Tweaking Google Test |
1201 | +-------------------- |
1202 | + |
1203 | +Google Test can be used in diverse environments. The default |
1204 | +configuration may not work (or may not work well) out of the box in |
1205 | +some environments. However, you can easily tweak Google Test by |
1206 | +defining control macros on the compiler command line. Generally, |
1207 | +these macros are named like GTEST_XYZ and you define them to either 1 |
1208 | +or 0 to enable or disable a certain feature. |
1209 | + |
1210 | +We list the most frequently used macros below. For a complete list, |
1211 | +see file include/gtest/internal/gtest-port.h. |
1212 | + |
1213 | +### Choosing a TR1 Tuple Library ### |
1214 | + |
1215 | +Some Google Test features require the C++ Technical Report 1 (TR1) |
1216 | +tuple library, which is not yet available with all compilers. The |
1217 | +good news is that Google Test implements a subset of TR1 tuple that's |
1218 | +enough for its own need, and will automatically use this when the |
1219 | +compiler doesn't provide TR1 tuple. |
1220 | + |
1221 | +Usually you don't need to care about which tuple library Google Test |
1222 | +uses. However, if your project already uses TR1 tuple, you need to |
1223 | +tell Google Test to use the same TR1 tuple library the rest of your |
1224 | +project uses, or the two tuple implementations will clash. To do |
1225 | +that, add |
1226 | + |
1227 | + -DGTEST_USE_OWN_TR1_TUPLE=0 |
1228 | + |
1229 | +to the compiler flags while compiling Google Test and your tests. If |
1230 | +you want to force Google Test to use its own tuple library, just add |
1231 | + |
1232 | + -DGTEST_USE_OWN_TR1_TUPLE=1 |
1233 | + |
1234 | +to the compiler flags instead. |
1235 | + |
1236 | +If you don't want Google Test to use tuple at all, add |
1237 | + |
1238 | + -DGTEST_HAS_TR1_TUPLE=0 |
1239 | + |
1240 | +and all features using tuple will be disabled. |
1241 | + |
1242 | +### Multi-threaded Tests ### |
1243 | + |
1244 | +Google Test is thread-safe where the pthread library is available. |
1245 | +After #include "gtest/gtest.h", you can check the GTEST_IS_THREADSAFE |
1246 | +macro to see whether this is the case (yes if the macro is #defined to |
1247 | +1, no if it's undefined.). |
1248 | + |
1249 | +If Google Test doesn't correctly detect whether pthread is available |
1250 | +in your environment, you can force it with |
1251 | + |
1252 | + -DGTEST_HAS_PTHREAD=1 |
1253 | + |
1254 | +or |
1255 | + |
1256 | + -DGTEST_HAS_PTHREAD=0 |
1257 | + |
1258 | +When Google Test uses pthread, you may need to add flags to your |
1259 | +compiler and/or linker to select the pthread library, or you'll get |
1260 | +link errors. If you use the CMake script or the deprecated Autotools |
1261 | +script, this is taken care of for you. If you use your own build |
1262 | +script, you'll need to read your compiler and linker's manual to |
1263 | +figure out what flags to add. |
1264 | + |
1265 | +### As a Shared Library (DLL) ### |
1266 | + |
1267 | +Google Test is compact, so most users can build and link it as a |
1268 | +static library for the simplicity. You can choose to use Google Test |
1269 | +as a shared library (known as a DLL on Windows) if you prefer. |
1270 | + |
1271 | +To compile *gtest* as a shared library, add |
1272 | + |
1273 | + -DGTEST_CREATE_SHARED_LIBRARY=1 |
1274 | + |
1275 | +to the compiler flags. You'll also need to tell the linker to produce |
1276 | +a shared library instead - consult your linker's manual for how to do |
1277 | +it. |
1278 | + |
1279 | +To compile your *tests* that use the gtest shared library, add |
1280 | + |
1281 | + -DGTEST_LINKED_AS_SHARED_LIBRARY=1 |
1282 | + |
1283 | +to the compiler flags. |
1284 | + |
1285 | +Note: while the above steps aren't technically necessary today when |
1286 | +using some compilers (e.g. GCC), they may become necessary in the |
1287 | +future, if we decide to improve the speed of loading the library (see |
1288 | +http://gcc.gnu.org/wiki/Visibility for details). Therefore you are |
1289 | +recommended to always add the above flags when using Google Test as a |
1290 | +shared library. Otherwise a future release of Google Test may break |
1291 | +your build script. |
1292 | + |
1293 | +### Avoiding Macro Name Clashes ### |
1294 | + |
1295 | +In C++, macros don't obey namespaces. Therefore two libraries that |
1296 | +both define a macro of the same name will clash if you #include both |
1297 | +definitions. In case a Google Test macro clashes with another |
1298 | +library, you can force Google Test to rename its macro to avoid the |
1299 | +conflict. |
1300 | + |
1301 | +Specifically, if both Google Test and some other code define macro |
1302 | +FOO, you can add |
1303 | + |
1304 | + -DGTEST_DONT_DEFINE_FOO=1 |
1305 | + |
1306 | +to the compiler flags to tell Google Test to change the macro's name |
1307 | +from FOO to GTEST_FOO. Currently FOO can be FAIL, SUCCEED, or TEST. |
1308 | +For example, with -DGTEST_DONT_DEFINE_TEST=1, you'll need to write |
1309 | + |
1310 | + GTEST_TEST(SomeTest, DoesThis) { ... } |
1311 | + |
1312 | +instead of |
1313 | + |
1314 | + TEST(SomeTest, DoesThis) { ... } |
1315 | + |
1316 | +in order to define a test. |
1317 | + |
1318 | +Upgrating from an Earlier Version |
1319 | +--------------------------------- |
1320 | + |
1321 | +We strive to keep Google Test releases backward compatible. |
1322 | +Sometimes, though, we have to make some breaking changes for the |
1323 | +users' long-term benefits. This section describes what you'll need to |
1324 | +do if you are upgrading from an earlier version of Google Test. |
1325 | + |
1326 | +### Upgrading from 1.3.0 or Earlier ### |
1327 | + |
1328 | +You may need to explicitly enable or disable Google Test's own TR1 |
1329 | +tuple library. See the instructions in section "Choosing a TR1 Tuple |
1330 | +Library". |
1331 | + |
1332 | +### Upgrading from 1.4.0 or Earlier ### |
1333 | + |
1334 | +The Autotools build script (configure + make) is no longer officially |
1335 | +supportted. You are encouraged to migrate to your own build system or |
1336 | +use CMake. If you still need to use Autotools, you can find |
1337 | +instructions in the README file from Google Test 1.4.0. |
1338 | + |
1339 | +On platforms where the pthread library is available, Google Test uses |
1340 | +it in order to be thread-safe. See the "Multi-threaded Tests" section |
1341 | +for what this means to your build script. |
1342 | + |
1343 | +If you use Microsoft Visual C++ 7.1 with exceptions disabled, Google |
1344 | +Test will no longer compile. This should affect very few people, as a |
1345 | +large portion of STL (including <string>) doesn't compile in this mode |
1346 | +anyway. We decided to stop supporting it in order to greatly simplify |
1347 | +Google Test's implementation. |
1348 | + |
1349 | +Developing Google Test |
1350 | +---------------------- |
1351 | + |
1352 | +This section discusses how to make your own changes to Google Test. |
1353 | + |
1354 | +### Testing Google Test Itself ### |
1355 | + |
1356 | +To make sure your changes work as intended and don't break existing |
1357 | +functionality, you'll want to compile and run Google Test's own tests. |
1358 | +For that you can use CMake: |
1359 | + |
1360 | + mkdir mybuild |
1361 | + cd mybuild |
1362 | + cmake -Dgtest_build_tests=ON ${GTEST_DIR} |
1363 | + |
1364 | +Make sure you have Python installed, as some of Google Test's tests |
1365 | +are written in Python. If the cmake command complains about not being |
1366 | +able to find Python ("Could NOT find PythonInterp (missing: |
1367 | +PYTHON_EXECUTABLE)"), try telling it explicitly where your Python |
1368 | +executable can be found: |
1369 | + |
1370 | + cmake -DPYTHON_EXECUTABLE=path/to/python -Dgtest_build_tests=ON ${GTEST_DIR} |
1371 | + |
1372 | +Next, you can build Google Test and all of its own tests. On *nix, |
1373 | +this is usually done by 'make'. To run the tests, do |
1374 | + |
1375 | + make test |
1376 | + |
1377 | +All tests should pass. |
1378 | + |
1379 | +### Regenerating Source Files ### |
1380 | + |
1381 | +Some of Google Test's source files are generated from templates (not |
1382 | +in the C++ sense) using a script. A template file is named FOO.pump, |
1383 | +where FOO is the name of the file it will generate. For example, the |
1384 | +file include/gtest/internal/gtest-type-util.h.pump is used to generate |
1385 | +gtest-type-util.h in the same directory. |
1386 | + |
1387 | +Normally you don't need to worry about regenerating the source files, |
1388 | +unless you need to modify them. In that case, you should modify the |
1389 | +corresponding .pump files instead and run the pump.py Python script to |
1390 | +regenerate them. You can find pump.py in the scripts/ directory. |
1391 | +Read the Pump manual [2] for how to use it. |
1392 | + |
1393 | + [2] http://code.google.com/p/googletest/wiki/PumpManual |
1394 | + |
1395 | +### Contributing a Patch ### |
1396 | + |
1397 | +We welcome patches. Please read the Google Test developer's guide [3] |
1398 | +for how you can contribute. In particular, make sure you have signed |
1399 | +the Contributor License Agreement, or we won't be able to accept the |
1400 | +patch. |
1401 | + |
1402 | + [3] http://code.google.com/p/googletest/wiki/GoogleTestDevGuide |
1403 | + |
1404 | +Happy testing! |
1405 | |
1406 | === added directory '3rd_party/gmock/gtest/build-aux' |
1407 | === added file '3rd_party/gmock/gtest/build-aux/.keep' |
1408 | === added directory '3rd_party/gmock/gtest/cmake' |
1409 | === added file '3rd_party/gmock/gtest/cmake/internal_utils.cmake' |
1410 | --- 3rd_party/gmock/gtest/cmake/internal_utils.cmake 1970-01-01 00:00:00 +0000 |
1411 | +++ 3rd_party/gmock/gtest/cmake/internal_utils.cmake 2014-04-08 15:07:37 +0000 |
1412 | @@ -0,0 +1,227 @@ |
1413 | +# Defines functions and macros useful for building Google Test and |
1414 | +# Google Mock. |
1415 | +# |
1416 | +# Note: |
1417 | +# |
1418 | +# - This file will be run twice when building Google Mock (once via |
1419 | +# Google Test's CMakeLists.txt, and once via Google Mock's). |
1420 | +# Therefore it shouldn't have any side effects other than defining |
1421 | +# the functions and macros. |
1422 | +# |
1423 | +# - The functions/macros defined in this file may depend on Google |
1424 | +# Test and Google Mock's option() definitions, and thus must be |
1425 | +# called *after* the options have been defined. |
1426 | + |
1427 | +# Tweaks CMake's default compiler/linker settings to suit Google Test's needs. |
1428 | +# |
1429 | +# This must be a macro(), as inside a function string() can only |
1430 | +# update variables in the function scope. |
1431 | +macro(fix_default_compiler_settings_) |
1432 | + if (MSVC) |
1433 | + # For MSVC, CMake sets certain flags to defaults we want to override. |
1434 | + # This replacement code is taken from sample in the CMake Wiki at |
1435 | + # http://www.cmake.org/Wiki/CMake_FAQ#Dynamic_Replace. |
1436 | + foreach (flag_var |
1437 | + CMAKE_CXX_FLAGS CMAKE_CXX_FLAGS_DEBUG CMAKE_CXX_FLAGS_RELEASE |
1438 | + CMAKE_CXX_FLAGS_MINSIZEREL CMAKE_CXX_FLAGS_RELWITHDEBINFO) |
1439 | + if (NOT BUILD_SHARED_LIBS AND NOT gtest_force_shared_crt) |
1440 | + # When Google Test is built as a shared library, it should also use |
1441 | + # shared runtime libraries. Otherwise, it may end up with multiple |
1442 | + # copies of runtime library data in different modules, resulting in |
1443 | + # hard-to-find crashes. When it is built as a static library, it is |
1444 | + # preferable to use CRT as static libraries, as we don't have to rely |
1445 | + # on CRT DLLs being available. CMake always defaults to using shared |
1446 | + # CRT libraries, so we override that default here. |
1447 | + string(REPLACE "/MD" "-MT" ${flag_var} "${${flag_var}}") |
1448 | + endif() |
1449 | + |
1450 | + # We prefer more strict warning checking for building Google Test. |
1451 | + # Replaces /W3 with /W4 in defaults. |
1452 | + string(REPLACE "/W3" "-W4" ${flag_var} "${${flag_var}}") |
1453 | + endforeach() |
1454 | + endif() |
1455 | +endmacro() |
1456 | + |
1457 | +# Defines the compiler/linker flags used to build Google Test and |
1458 | +# Google Mock. You can tweak these definitions to suit your need. A |
1459 | +# variable's value is empty before it's explicitly assigned to. |
1460 | +macro(config_compiler_and_linker) |
1461 | + if (NOT gtest_disable_pthreads) |
1462 | + # Defines CMAKE_USE_PTHREADS_INIT and CMAKE_THREAD_LIBS_INIT. |
1463 | + find_package(Threads) |
1464 | + endif() |
1465 | + |
1466 | + fix_default_compiler_settings_() |
1467 | + if (MSVC) |
1468 | + # Newlines inside flags variables break CMake's NMake generator. |
1469 | + # TODO(vladl@google.com): Add -RTCs and -RTCu to debug builds. |
1470 | + set(cxx_base_flags "-GS -W4 -WX -wd4127 -wd4251 -wd4275 -nologo -J -Zi") |
1471 | + if (MSVC_VERSION LESS 1400) |
1472 | + # Suppress spurious warnings MSVC 7.1 sometimes issues. |
1473 | + # Forcing value to bool. |
1474 | + set(cxx_base_flags "${cxx_base_flags} -wd4800") |
1475 | + # Copy constructor and assignment operator could not be generated. |
1476 | + set(cxx_base_flags "${cxx_base_flags} -wd4511 -wd4512") |
1477 | + # Compatibility warnings not applicable to Google Test. |
1478 | + # Resolved overload was found by argument-dependent lookup. |
1479 | + set(cxx_base_flags "${cxx_base_flags} -wd4675") |
1480 | + endif() |
1481 | + set(cxx_base_flags "${cxx_base_flags} -D_UNICODE -DUNICODE -DWIN32 -D_WIN32") |
1482 | + set(cxx_base_flags "${cxx_base_flags} -DSTRICT -DWIN32_LEAN_AND_MEAN") |
1483 | + set(cxx_exception_flags "-EHsc -D_HAS_EXCEPTIONS=1") |
1484 | + set(cxx_no_exception_flags "-D_HAS_EXCEPTIONS=0") |
1485 | + set(cxx_no_rtti_flags "-GR-") |
1486 | + elseif (CMAKE_COMPILER_IS_GNUCXX) |
1487 | + set(cxx_base_flags "-Wall -Wshadow") |
1488 | + set(cxx_exception_flags "-fexceptions") |
1489 | + set(cxx_no_exception_flags "-fno-exceptions") |
1490 | + # Until version 4.3.2, GCC doesn't define a macro to indicate |
1491 | + # whether RTTI is enabled. Therefore we define GTEST_HAS_RTTI |
1492 | + # explicitly. |
1493 | + set(cxx_no_rtti_flags "-fno-rtti -DGTEST_HAS_RTTI=0") |
1494 | + set(cxx_strict_flags |
1495 | + "-Wextra -Wno-unused-parameter -Wno-missing-field-initializers") |
1496 | + elseif (CMAKE_CXX_COMPILER_ID STREQUAL "SunPro") |
1497 | + set(cxx_exception_flags "-features=except") |
1498 | + # Sun Pro doesn't provide macros to indicate whether exceptions and |
1499 | + # RTTI are enabled, so we define GTEST_HAS_* explicitly. |
1500 | + set(cxx_no_exception_flags "-features=no%except -DGTEST_HAS_EXCEPTIONS=0") |
1501 | + set(cxx_no_rtti_flags "-features=no%rtti -DGTEST_HAS_RTTI=0") |
1502 | + elseif (CMAKE_CXX_COMPILER_ID STREQUAL "VisualAge" OR |
1503 | + CMAKE_CXX_COMPILER_ID STREQUAL "XL") |
1504 | + # CMake 2.8 changes Visual Age's compiler ID to "XL". |
1505 | + set(cxx_exception_flags "-qeh") |
1506 | + set(cxx_no_exception_flags "-qnoeh") |
1507 | + # Until version 9.0, Visual Age doesn't define a macro to indicate |
1508 | + # whether RTTI is enabled. Therefore we define GTEST_HAS_RTTI |
1509 | + # explicitly. |
1510 | + set(cxx_no_rtti_flags "-qnortti -DGTEST_HAS_RTTI=0") |
1511 | + elseif (CMAKE_CXX_COMPILER_ID STREQUAL "HP") |
1512 | + set(cxx_base_flags "-AA -mt") |
1513 | + set(cxx_exception_flags "-DGTEST_HAS_EXCEPTIONS=1") |
1514 | + set(cxx_no_exception_flags "+noeh -DGTEST_HAS_EXCEPTIONS=0") |
1515 | + # RTTI can not be disabled in HP aCC compiler. |
1516 | + set(cxx_no_rtti_flags "") |
1517 | + endif() |
1518 | + |
1519 | + if (CMAKE_USE_PTHREADS_INIT) # The pthreads library is available and allowed. |
1520 | + set(cxx_base_flags "${cxx_base_flags} -DGTEST_HAS_PTHREAD=1") |
1521 | + else() |
1522 | + set(cxx_base_flags "${cxx_base_flags} -DGTEST_HAS_PTHREAD=0") |
1523 | + endif() |
1524 | + |
1525 | + # For building gtest's own tests and samples. |
1526 | + set(cxx_exception "${CMAKE_CXX_FLAGS} ${cxx_base_flags} ${cxx_exception_flags}") |
1527 | + set(cxx_no_exception |
1528 | + "${CMAKE_CXX_FLAGS} ${cxx_base_flags} ${cxx_no_exception_flags}") |
1529 | + set(cxx_default "${cxx_exception}") |
1530 | + set(cxx_no_rtti "${cxx_default} ${cxx_no_rtti_flags}") |
1531 | + set(cxx_use_own_tuple "${cxx_default} -DGTEST_USE_OWN_TR1_TUPLE=1") |
1532 | + |
1533 | + # For building the gtest libraries. |
1534 | + set(cxx_strict "${cxx_default} ${cxx_strict_flags}") |
1535 | +endmacro() |
1536 | + |
1537 | +# Defines the gtest & gtest_main libraries. User tests should link |
1538 | +# with one of them. |
1539 | +function(cxx_library_with_type name type cxx_flags) |
1540 | + # type can be either STATIC or SHARED to denote a static or shared library. |
1541 | + # ARGN refers to additional arguments after 'cxx_flags'. |
1542 | + add_library(${name} ${type} ${ARGN}) |
1543 | + set_target_properties(${name} |
1544 | + PROPERTIES |
1545 | + COMPILE_FLAGS "${cxx_flags}") |
1546 | + if (BUILD_SHARED_LIBS OR type STREQUAL "SHARED") |
1547 | + set_target_properties(${name} |
1548 | + PROPERTIES |
1549 | + COMPILE_DEFINITIONS "GTEST_CREATE_SHARED_LIBRARY=1") |
1550 | + endif() |
1551 | + if (CMAKE_USE_PTHREADS_INIT) |
1552 | + target_link_libraries(${name} ${CMAKE_THREAD_LIBS_INIT}) |
1553 | + endif() |
1554 | +endfunction() |
1555 | + |
1556 | +######################################################################## |
1557 | +# |
1558 | +# Helper functions for creating build targets. |
1559 | + |
1560 | +function(cxx_shared_library name cxx_flags) |
1561 | + cxx_library_with_type(${name} SHARED "${cxx_flags}" ${ARGN}) |
1562 | +endfunction() |
1563 | + |
1564 | +function(cxx_library name cxx_flags) |
1565 | + cxx_library_with_type(${name} "" "${cxx_flags}" ${ARGN}) |
1566 | +endfunction() |
1567 | + |
1568 | +# cxx_executable_with_flags(name cxx_flags libs srcs...) |
1569 | +# |
1570 | +# creates a named C++ executable that depends on the given libraries and |
1571 | +# is built from the given source files with the given compiler flags. |
1572 | +function(cxx_executable_with_flags name cxx_flags libs) |
1573 | + add_executable(${name} ${ARGN}) |
1574 | + if (cxx_flags) |
1575 | + set_target_properties(${name} |
1576 | + PROPERTIES |
1577 | + COMPILE_FLAGS "${cxx_flags}") |
1578 | + endif() |
1579 | + if (BUILD_SHARED_LIBS) |
1580 | + set_target_properties(${name} |
1581 | + PROPERTIES |
1582 | + COMPILE_DEFINITIONS "GTEST_LINKED_AS_SHARED_LIBRARY=1") |
1583 | + endif() |
1584 | + # To support mixing linking in static and dynamic libraries, link each |
1585 | + # library in with an extra call to target_link_libraries. |
1586 | + foreach (lib "${libs}") |
1587 | + target_link_libraries(${name} ${lib}) |
1588 | + endforeach() |
1589 | +endfunction() |
1590 | + |
1591 | +# cxx_executable(name dir lib srcs...) |
1592 | +# |
1593 | +# creates a named target that depends on the given libs and is built |
1594 | +# from the given source files. dir/name.cc is implicitly included in |
1595 | +# the source file list. |
1596 | +function(cxx_executable name dir libs) |
1597 | + cxx_executable_with_flags( |
1598 | + ${name} "${cxx_default}" "${libs}" "${dir}/${name}.cc" ${ARGN}) |
1599 | +endfunction() |
1600 | + |
1601 | +# Sets PYTHONINTERP_FOUND and PYTHON_EXECUTABLE. |
1602 | +find_package(PythonInterp) |
1603 | + |
1604 | +# cxx_test_with_flags(name cxx_flags libs srcs...) |
1605 | +# |
1606 | +# creates a named C++ test that depends on the given libs and is built |
1607 | +# from the given source files with the given compiler flags. |
1608 | +function(cxx_test_with_flags name cxx_flags libs) |
1609 | + cxx_executable_with_flags(${name} "${cxx_flags}" "${libs}" ${ARGN}) |
1610 | + add_test(${name} ${name}) |
1611 | +endfunction() |
1612 | + |
1613 | +# cxx_test(name libs srcs...) |
1614 | +# |
1615 | +# creates a named test target that depends on the given libs and is |
1616 | +# built from the given source files. Unlike cxx_test_with_flags, |
1617 | +# test/name.cc is already implicitly included in the source file list. |
1618 | +function(cxx_test name libs) |
1619 | + cxx_test_with_flags("${name}" "${cxx_default}" "${libs}" |
1620 | + "test/${name}.cc" ${ARGN}) |
1621 | +endfunction() |
1622 | + |
1623 | +# py_test(name) |
1624 | +# |
1625 | +# creates a Python test with the given name whose main module is in |
1626 | +# test/name.py. It does nothing if Python is not installed. |
1627 | +function(py_test name) |
1628 | + # We are not supporting Python tests on Linux yet as they consider |
1629 | + # all Linux environments to be google3 and try to use google3 features. |
1630 | + if (PYTHONINTERP_FOUND) |
1631 | + # ${CMAKE_BINARY_DIR} is known at configuration time, so we can |
1632 | + # directly bind it from cmake. ${CTEST_CONFIGURATION_TYPE} is known |
1633 | + # only at ctest runtime (by calling ctest -c <Configuration>), so |
1634 | + # we have to escape $ to delay variable substitution here. |
1635 | + add_test(${name} |
1636 | + ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/test/${name}.py |
1637 | + --build_dir=${CMAKE_CURRENT_BINARY_DIR}/\${CTEST_CONFIGURATION_TYPE}) |
1638 | + endif() |
1639 | +endfunction() |
1640 | |
1641 | === added directory '3rd_party/gmock/gtest/codegear' |
1642 | === added file '3rd_party/gmock/gtest/codegear/gtest_all.cc' |
1643 | --- 3rd_party/gmock/gtest/codegear/gtest_all.cc 1970-01-01 00:00:00 +0000 |
1644 | +++ 3rd_party/gmock/gtest/codegear/gtest_all.cc 2014-04-08 15:07:37 +0000 |
1645 | @@ -0,0 +1,38 @@ |
1646 | +// Copyright 2009, Google Inc. |
1647 | +// All rights reserved. |
1648 | +// |
1649 | +// Redistribution and use in source and binary forms, with or without |
1650 | +// modification, are permitted provided that the following conditions are |
1651 | +// met: |
1652 | +// |
1653 | +// * Redistributions of source code must retain the above copyright |
1654 | +// notice, this list of conditions and the following disclaimer. |
1655 | +// * Redistributions in binary form must reproduce the above |
1656 | +// copyright notice, this list of conditions and the following disclaimer |
1657 | +// in the documentation and/or other materials provided with the |
1658 | +// distribution. |
1659 | +// * Neither the name of Google Inc. nor the names of its |
1660 | +// contributors may be used to endorse or promote products derived from |
1661 | +// this software without specific prior written permission. |
1662 | +// |
1663 | +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS |
1664 | +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT |
1665 | +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR |
1666 | +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT |
1667 | +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, |
1668 | +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT |
1669 | +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
1670 | +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
1671 | +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
1672 | +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
1673 | +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
1674 | +// |
1675 | +// Author: Josh Kelley (joshkel@gmail.com) |
1676 | +// |
1677 | +// Google C++ Testing Framework (Google Test) |
1678 | +// |
1679 | +// C++Builder's IDE cannot build a static library from files with hyphens |
1680 | +// in their name. See http://qc.codegear.com/wc/qcmain.aspx?d=70977 . |
1681 | +// This file serves as a workaround. |
1682 | + |
1683 | +#include "src/gtest-all.cc" |
1684 | |
1685 | === added file '3rd_party/gmock/gtest/codegear/gtest_link.cc' |
1686 | --- 3rd_party/gmock/gtest/codegear/gtest_link.cc 1970-01-01 00:00:00 +0000 |
1687 | +++ 3rd_party/gmock/gtest/codegear/gtest_link.cc 2014-04-08 15:07:37 +0000 |
1688 | @@ -0,0 +1,40 @@ |
1689 | +// Copyright 2009, Google Inc. |
1690 | +// All rights reserved. |
1691 | +// |
1692 | +// Redistribution and use in source and binary forms, with or without |
1693 | +// modification, are permitted provided that the following conditions are |
1694 | +// met: |
1695 | +// |
1696 | +// * Redistributions of source code must retain the above copyright |
1697 | +// notice, this list of conditions and the following disclaimer. |
1698 | +// * Redistributions in binary form must reproduce the above |
1699 | +// copyright notice, this list of conditions and the following disclaimer |
1700 | +// in the documentation and/or other materials provided with the |
1701 | +// distribution. |
1702 | +// * Neither the name of Google Inc. nor the names of its |
1703 | +// contributors may be used to endorse or promote products derived from |
1704 | +// this software without specific prior written permission. |
1705 | +// |
1706 | +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS |
1707 | +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT |
1708 | +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR |
1709 | +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT |
1710 | +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, |
1711 | +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT |
1712 | +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
1713 | +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
1714 | +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
1715 | +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
1716 | +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
1717 | +// |
1718 | +// Author: Josh Kelley (joshkel@gmail.com) |
1719 | +// |
1720 | +// Google C++ Testing Framework (Google Test) |
1721 | +// |
1722 | +// Links gtest.lib and gtest_main.lib into the current project in C++Builder. |
1723 | +// This means that these libraries can't be renamed, but it's the only way to |
1724 | +// ensure that Debug versus Release test builds are linked against the |
1725 | +// appropriate Debug or Release build of the libraries. |
1726 | + |
1727 | +#pragma link "gtest.lib" |
1728 | +#pragma link "gtest_main.lib" |
1729 | |
1730 | === added file '3rd_party/gmock/gtest/configure.ac' |
1731 | --- 3rd_party/gmock/gtest/configure.ac 1970-01-01 00:00:00 +0000 |
1732 | +++ 3rd_party/gmock/gtest/configure.ac 2014-04-08 15:07:37 +0000 |
1733 | @@ -0,0 +1,68 @@ |
1734 | +m4_include(m4/acx_pthread.m4) |
1735 | + |
1736 | +# At this point, the Xcode project assumes the version string will be three |
1737 | +# integers separated by periods and surrounded by square brackets (e.g. |
1738 | +# "[1.0.1]"). It also asumes that there won't be any closing parenthesis |
1739 | +# between "AC_INIT(" and the closing ")" including comments and strings. |
1740 | +AC_INIT([Google C++ Testing Framework], |
1741 | + [1.7.0], |
1742 | + [googletestframework@googlegroups.com], |
1743 | + [gtest]) |
1744 | + |
1745 | +# Provide various options to initialize the Autoconf and configure processes. |
1746 | +AC_PREREQ([2.59]) |
1747 | +AC_CONFIG_SRCDIR([./LICENSE]) |
1748 | +AC_CONFIG_MACRO_DIR([m4]) |
1749 | +AC_CONFIG_AUX_DIR([build-aux]) |
1750 | +AC_CONFIG_HEADERS([build-aux/config.h]) |
1751 | +AC_CONFIG_FILES([Makefile]) |
1752 | +AC_CONFIG_FILES([scripts/gtest-config], [chmod +x scripts/gtest-config]) |
1753 | + |
1754 | +# Initialize Automake with various options. We require at least v1.9, prevent |
1755 | +# pedantic complaints about package files, and enable various distribution |
1756 | +# targets. |
1757 | +AM_INIT_AUTOMAKE([1.9 dist-bzip2 dist-zip foreign subdir-objects]) |
1758 | + |
1759 | +# Check for programs used in building Google Test. |
1760 | +AC_PROG_CC |
1761 | +AC_PROG_CXX |
1762 | +AC_LANG([C++]) |
1763 | +AC_PROG_LIBTOOL |
1764 | + |
1765 | +# TODO(chandlerc@google.com): Currently we aren't running the Python tests |
1766 | +# against the interpreter detected by AM_PATH_PYTHON, and so we condition |
1767 | +# HAVE_PYTHON by requiring "python" to be in the PATH, and that interpreter's |
1768 | +# version to be >= 2.3. This will allow the scripts to use a "/usr/bin/env" |
1769 | +# hashbang. |
1770 | +PYTHON= # We *do not* allow the user to specify a python interpreter |
1771 | +AC_PATH_PROG([PYTHON],[python],[:]) |
1772 | +AS_IF([test "$PYTHON" != ":"], |
1773 | + [AM_PYTHON_CHECK_VERSION([$PYTHON],[2.3],[:],[PYTHON=":"])]) |
1774 | +AM_CONDITIONAL([HAVE_PYTHON],[test "$PYTHON" != ":"]) |
1775 | + |
1776 | +# Configure pthreads. |
1777 | +AC_ARG_WITH([pthreads], |
1778 | + [AS_HELP_STRING([--with-pthreads], |
1779 | + [use pthreads (default is yes)])], |
1780 | + [with_pthreads=$withval], |
1781 | + [with_pthreads=check]) |
1782 | + |
1783 | +have_pthreads=no |
1784 | +AS_IF([test "x$with_pthreads" != "xno"], |
1785 | + [ACX_PTHREAD( |
1786 | + [], |
1787 | + [AS_IF([test "x$with_pthreads" != "xcheck"], |
1788 | + [AC_MSG_FAILURE( |
1789 | + [--with-pthreads was specified, but unable to be used])])]) |
1790 | + have_pthreads="$acx_pthread_ok"]) |
1791 | +AM_CONDITIONAL([HAVE_PTHREADS],[test "x$have_pthreads" = "xyes"]) |
1792 | +AC_SUBST(PTHREAD_CFLAGS) |
1793 | +AC_SUBST(PTHREAD_LIBS) |
1794 | + |
1795 | +# TODO(chandlerc@google.com) Check for the necessary system headers. |
1796 | + |
1797 | +# TODO(chandlerc@google.com) Check the types, structures, and other compiler |
1798 | +# and architecture characteristics. |
1799 | + |
1800 | +# Output the generated files. No further autoconf macros may be used. |
1801 | +AC_OUTPUT |
1802 | |
1803 | === added directory '3rd_party/gmock/gtest/include' |
1804 | === added directory '3rd_party/gmock/gtest/include/gtest' |
1805 | === added file '3rd_party/gmock/gtest/include/gtest/gtest-death-test.h' |
1806 | --- 3rd_party/gmock/gtest/include/gtest/gtest-death-test.h 1970-01-01 00:00:00 +0000 |
1807 | +++ 3rd_party/gmock/gtest/include/gtest/gtest-death-test.h 2014-04-08 15:07:37 +0000 |
1808 | @@ -0,0 +1,294 @@ |
1809 | +// Copyright 2005, Google Inc. |
1810 | +// All rights reserved. |
1811 | +// |
1812 | +// Redistribution and use in source and binary forms, with or without |
1813 | +// modification, are permitted provided that the following conditions are |
1814 | +// met: |
1815 | +// |
1816 | +// * Redistributions of source code must retain the above copyright |
1817 | +// notice, this list of conditions and the following disclaimer. |
1818 | +// * Redistributions in binary form must reproduce the above |
1819 | +// copyright notice, this list of conditions and the following disclaimer |
1820 | +// in the documentation and/or other materials provided with the |
1821 | +// distribution. |
1822 | +// * Neither the name of Google Inc. nor the names of its |
1823 | +// contributors may be used to endorse or promote products derived from |
1824 | +// this software without specific prior written permission. |
1825 | +// |
1826 | +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS |
1827 | +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT |
1828 | +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR |
1829 | +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT |
1830 | +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, |
1831 | +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT |
1832 | +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
1833 | +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
1834 | +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
1835 | +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
1836 | +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
1837 | +// |
1838 | +// Author: wan@google.com (Zhanyong Wan) |
1839 | +// |
1840 | +// The Google C++ Testing Framework (Google Test) |
1841 | +// |
1842 | +// This header file defines the public API for death tests. It is |
1843 | +// #included by gtest.h so a user doesn't need to include this |
1844 | +// directly. |
1845 | + |
1846 | +#ifndef GTEST_INCLUDE_GTEST_GTEST_DEATH_TEST_H_ |
1847 | +#define GTEST_INCLUDE_GTEST_GTEST_DEATH_TEST_H_ |
1848 | + |
1849 | +#include "gtest/internal/gtest-death-test-internal.h" |
1850 | + |
1851 | +namespace testing { |
1852 | + |
1853 | +// This flag controls the style of death tests. Valid values are "threadsafe", |
1854 | +// meaning that the death test child process will re-execute the test binary |
1855 | +// from the start, running only a single death test, or "fast", |
1856 | +// meaning that the child process will execute the test logic immediately |
1857 | +// after forking. |
1858 | +GTEST_DECLARE_string_(death_test_style); |
1859 | + |
1860 | +#if GTEST_HAS_DEATH_TEST |
1861 | + |
1862 | +namespace internal { |
1863 | + |
1864 | +// Returns a Boolean value indicating whether the caller is currently |
1865 | +// executing in the context of the death test child process. Tools such as |
1866 | +// Valgrind heap checkers may need this to modify their behavior in death |
1867 | +// tests. IMPORTANT: This is an internal utility. Using it may break the |
1868 | +// implementation of death tests. User code MUST NOT use it. |
1869 | +GTEST_API_ bool InDeathTestChild(); |
1870 | + |
1871 | +} // namespace internal |
1872 | + |
1873 | +// The following macros are useful for writing death tests. |
1874 | + |
1875 | +// Here's what happens when an ASSERT_DEATH* or EXPECT_DEATH* is |
1876 | +// executed: |
1877 | +// |
1878 | +// 1. It generates a warning if there is more than one active |
1879 | +// thread. This is because it's safe to fork() or clone() only |
1880 | +// when there is a single thread. |
1881 | +// |
1882 | +// 2. The parent process clone()s a sub-process and runs the death |
1883 | +// test in it; the sub-process exits with code 0 at the end of the |
1884 | +// death test, if it hasn't exited already. |
1885 | +// |
1886 | +// 3. The parent process waits for the sub-process to terminate. |
1887 | +// |
1888 | +// 4. The parent process checks the exit code and error message of |
1889 | +// the sub-process. |
1890 | +// |
1891 | +// Examples: |
1892 | +// |
1893 | +// ASSERT_DEATH(server.SendMessage(56, "Hello"), "Invalid port number"); |
1894 | +// for (int i = 0; i < 5; i++) { |
1895 | +// EXPECT_DEATH(server.ProcessRequest(i), |
1896 | +// "Invalid request .* in ProcessRequest()") |
1897 | +// << "Failed to die on request " << i; |
1898 | +// } |
1899 | +// |
1900 | +// ASSERT_EXIT(server.ExitNow(), ::testing::ExitedWithCode(0), "Exiting"); |
1901 | +// |
1902 | +// bool KilledBySIGHUP(int exit_code) { |
1903 | +// return WIFSIGNALED(exit_code) && WTERMSIG(exit_code) == SIGHUP; |
1904 | +// } |
1905 | +// |
1906 | +// ASSERT_EXIT(client.HangUpServer(), KilledBySIGHUP, "Hanging up!"); |
1907 | +// |
1908 | +// On the regular expressions used in death tests: |
1909 | +// |
1910 | +// On POSIX-compliant systems (*nix), we use the <regex.h> library, |
1911 | +// which uses the POSIX extended regex syntax. |
1912 | +// |
1913 | +// On other platforms (e.g. Windows), we only support a simple regex |
1914 | +// syntax implemented as part of Google Test. This limited |
1915 | +// implementation should be enough most of the time when writing |
1916 | +// death tests; though it lacks many features you can find in PCRE |
1917 | +// or POSIX extended regex syntax. For example, we don't support |
1918 | +// union ("x|y"), grouping ("(xy)"), brackets ("[xy]"), and |
1919 | +// repetition count ("x{5,7}"), among others. |
1920 | +// |
1921 | +// Below is the syntax that we do support. We chose it to be a |
1922 | +// subset of both PCRE and POSIX extended regex, so it's easy to |
1923 | +// learn wherever you come from. In the following: 'A' denotes a |
1924 | +// literal character, period (.), or a single \\ escape sequence; |
1925 | +// 'x' and 'y' denote regular expressions; 'm' and 'n' are for |
1926 | +// natural numbers. |
1927 | +// |
1928 | +// c matches any literal character c |
1929 | +// \\d matches any decimal digit |
1930 | +// \\D matches any character that's not a decimal digit |
1931 | +// \\f matches \f |
1932 | +// \\n matches \n |
1933 | +// \\r matches \r |
1934 | +// \\s matches any ASCII whitespace, including \n |
1935 | +// \\S matches any character that's not a whitespace |
1936 | +// \\t matches \t |
1937 | +// \\v matches \v |
1938 | +// \\w matches any letter, _, or decimal digit |
1939 | +// \\W matches any character that \\w doesn't match |
1940 | +// \\c matches any literal character c, which must be a punctuation |
1941 | +// . matches any single character except \n |
1942 | +// A? matches 0 or 1 occurrences of A |
1943 | +// A* matches 0 or many occurrences of A |
1944 | +// A+ matches 1 or many occurrences of A |
1945 | +// ^ matches the beginning of a string (not that of each line) |
1946 | +// $ matches the end of a string (not that of each line) |
1947 | +// xy matches x followed by y |
1948 | +// |
1949 | +// If you accidentally use PCRE or POSIX extended regex features |
1950 | +// not implemented by us, you will get a run-time failure. In that |
1951 | +// case, please try to rewrite your regular expression within the |
1952 | +// above syntax. |
1953 | +// |
1954 | +// This implementation is *not* meant to be as highly tuned or robust |
1955 | +// as a compiled regex library, but should perform well enough for a |
1956 | +// death test, which already incurs significant overhead by launching |
1957 | +// a child process. |
1958 | +// |
1959 | +// Known caveats: |
1960 | +// |
1961 | +// A "threadsafe" style death test obtains the path to the test |
1962 | +// program from argv[0] and re-executes it in the sub-process. For |
1963 | +// simplicity, the current implementation doesn't search the PATH |
1964 | +// when launching the sub-process. This means that the user must |
1965 | +// invoke the test program via a path that contains at least one |
1966 | +// path separator (e.g. path/to/foo_test and |
1967 | +// /absolute/path/to/bar_test are fine, but foo_test is not). This |
1968 | +// is rarely a problem as people usually don't put the test binary |
1969 | +// directory in PATH. |
1970 | +// |
1971 | +// TODO(wan@google.com): make thread-safe death tests search the PATH. |
1972 | + |
1973 | +// Asserts that a given statement causes the program to exit, with an |
1974 | +// integer exit status that satisfies predicate, and emitting error output |
1975 | +// that matches regex. |
1976 | +# define ASSERT_EXIT(statement, predicate, regex) \ |
1977 | + GTEST_DEATH_TEST_(statement, predicate, regex, GTEST_FATAL_FAILURE_) |
1978 | + |
1979 | +// Like ASSERT_EXIT, but continues on to successive tests in the |
1980 | +// test case, if any: |
1981 | +# define EXPECT_EXIT(statement, predicate, regex) \ |
1982 | + GTEST_DEATH_TEST_(statement, predicate, regex, GTEST_NONFATAL_FAILURE_) |
1983 | + |
1984 | +// Asserts that a given statement causes the program to exit, either by |
1985 | +// explicitly exiting with a nonzero exit code or being killed by a |
1986 | +// signal, and emitting error output that matches regex. |
1987 | +# define ASSERT_DEATH(statement, regex) \ |
1988 | + ASSERT_EXIT(statement, ::testing::internal::ExitedUnsuccessfully, regex) |
1989 | + |
1990 | +// Like ASSERT_DEATH, but continues on to successive tests in the |
1991 | +// test case, if any: |
1992 | +# define EXPECT_DEATH(statement, regex) \ |
1993 | + EXPECT_EXIT(statement, ::testing::internal::ExitedUnsuccessfully, regex) |
1994 | + |
1995 | +// Two predicate classes that can be used in {ASSERT,EXPECT}_EXIT*: |
1996 | + |
1997 | +// Tests that an exit code describes a normal exit with a given exit code. |
1998 | +class GTEST_API_ ExitedWithCode { |
1999 | + public: |
2000 | + explicit ExitedWithCode(int exit_code); |
2001 | + bool operator()(int exit_status) const; |
2002 | + private: |
2003 | + // No implementation - assignment is unsupported. |
2004 | + void operator=(const ExitedWithCode& other); |
2005 | + |
2006 | + const int exit_code_; |
2007 | +}; |
2008 | + |
2009 | +# if !GTEST_OS_WINDOWS |
2010 | +// Tests that an exit code describes an exit due to termination by a |
2011 | +// given signal. |
2012 | +class GTEST_API_ KilledBySignal { |
2013 | + public: |
2014 | + explicit KilledBySignal(int signum); |
2015 | + bool operator()(int exit_status) const; |
2016 | + private: |
2017 | + const int signum_; |
2018 | +}; |
2019 | +# endif // !GTEST_OS_WINDOWS |
2020 | + |
2021 | +// EXPECT_DEBUG_DEATH asserts that the given statements die in debug mode. |
2022 | +// The death testing framework causes this to have interesting semantics, |
2023 | +// since the sideeffects of the call are only visible in opt mode, and not |
2024 | +// in debug mode. |
2025 | +// |
2026 | +// In practice, this can be used to test functions that utilize the |
2027 | +// LOG(DFATAL) macro using the following style: |
2028 | +// |
2029 | +// int DieInDebugOr12(int* sideeffect) { |
2030 | +// if (sideeffect) { |
2031 | +// *sideeffect = 12; |
2032 | +// } |
2033 | +// LOG(DFATAL) << "death"; |
2034 | +// return 12; |
2035 | +// } |
2036 | +// |
2037 | +// TEST(TestCase, TestDieOr12WorksInDgbAndOpt) { |
2038 | +// int sideeffect = 0; |
2039 | +// // Only asserts in dbg. |
2040 | +// EXPECT_DEBUG_DEATH(DieInDebugOr12(&sideeffect), "death"); |
2041 | +// |
2042 | +// #ifdef NDEBUG |
2043 | +// // opt-mode has sideeffect visible. |
2044 | +// EXPECT_EQ(12, sideeffect); |
2045 | +// #else |
2046 | +// // dbg-mode no visible sideeffect. |
2047 | +// EXPECT_EQ(0, sideeffect); |
2048 | +// #endif |
2049 | +// } |
2050 | +// |
2051 | +// This will assert that DieInDebugReturn12InOpt() crashes in debug |
2052 | +// mode, usually due to a DCHECK or LOG(DFATAL), but returns the |
2053 | +// appropriate fallback value (12 in this case) in opt mode. If you |
2054 | +// need to test that a function has appropriate side-effects in opt |
2055 | +// mode, include assertions against the side-effects. A general |
2056 | +// pattern for this is: |
2057 | +// |
2058 | +// EXPECT_DEBUG_DEATH({ |
2059 | +// // Side-effects here will have an effect after this statement in |
2060 | +// // opt mode, but none in debug mode. |
2061 | +// EXPECT_EQ(12, DieInDebugOr12(&sideeffect)); |
2062 | +// }, "death"); |
2063 | +// |
2064 | +# ifdef NDEBUG |
2065 | + |
2066 | +# define EXPECT_DEBUG_DEATH(statement, regex) \ |
2067 | + GTEST_EXECUTE_STATEMENT_(statement, regex) |
2068 | + |
2069 | +# define ASSERT_DEBUG_DEATH(statement, regex) \ |
2070 | + GTEST_EXECUTE_STATEMENT_(statement, regex) |
2071 | + |
2072 | +# else |
2073 | + |
2074 | +# define EXPECT_DEBUG_DEATH(statement, regex) \ |
2075 | + EXPECT_DEATH(statement, regex) |
2076 | + |
2077 | +# define ASSERT_DEBUG_DEATH(statement, regex) \ |
2078 | + ASSERT_DEATH(statement, regex) |
2079 | + |
2080 | +# endif // NDEBUG for EXPECT_DEBUG_DEATH |
2081 | +#endif // GTEST_HAS_DEATH_TEST |
2082 | + |
2083 | +// EXPECT_DEATH_IF_SUPPORTED(statement, regex) and |
2084 | +// ASSERT_DEATH_IF_SUPPORTED(statement, regex) expand to real death tests if |
2085 | +// death tests are supported; otherwise they just issue a warning. This is |
2086 | +// useful when you are combining death test assertions with normal test |
2087 | +// assertions in one test. |
2088 | +#if GTEST_HAS_DEATH_TEST |
2089 | +# define EXPECT_DEATH_IF_SUPPORTED(statement, regex) \ |
2090 | + EXPECT_DEATH(statement, regex) |
2091 | +# define ASSERT_DEATH_IF_SUPPORTED(statement, regex) \ |
2092 | + ASSERT_DEATH(statement, regex) |
2093 | +#else |
2094 | +# define EXPECT_DEATH_IF_SUPPORTED(statement, regex) \ |
2095 | + GTEST_UNSUPPORTED_DEATH_TEST_(statement, regex, ) |
2096 | +# define ASSERT_DEATH_IF_SUPPORTED(statement, regex) \ |
2097 | + GTEST_UNSUPPORTED_DEATH_TEST_(statement, regex, return) |
2098 | +#endif |
2099 | + |
2100 | +} // namespace testing |
2101 | + |
2102 | +#endif // GTEST_INCLUDE_GTEST_GTEST_DEATH_TEST_H_ |
2103 | |
2104 | === added file '3rd_party/gmock/gtest/include/gtest/gtest-message.h' |
2105 | --- 3rd_party/gmock/gtest/include/gtest/gtest-message.h 1970-01-01 00:00:00 +0000 |
2106 | +++ 3rd_party/gmock/gtest/include/gtest/gtest-message.h 2014-04-08 15:07:37 +0000 |
2107 | @@ -0,0 +1,250 @@ |
2108 | +// Copyright 2005, Google Inc. |
2109 | +// All rights reserved. |
2110 | +// |
2111 | +// Redistribution and use in source and binary forms, with or without |
2112 | +// modification, are permitted provided that the following conditions are |
2113 | +// met: |
2114 | +// |
2115 | +// * Redistributions of source code must retain the above copyright |
2116 | +// notice, this list of conditions and the following disclaimer. |
2117 | +// * Redistributions in binary form must reproduce the above |
2118 | +// copyright notice, this list of conditions and the following disclaimer |
2119 | +// in the documentation and/or other materials provided with the |
2120 | +// distribution. |
2121 | +// * Neither the name of Google Inc. nor the names of its |
2122 | +// contributors may be used to endorse or promote products derived from |
2123 | +// this software without specific prior written permission. |
2124 | +// |
2125 | +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS |
2126 | +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT |
2127 | +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR |
2128 | +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT |
2129 | +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, |
2130 | +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT |
2131 | +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
2132 | +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
2133 | +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
2134 | +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
2135 | +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
2136 | +// |
2137 | +// Author: wan@google.com (Zhanyong Wan) |
2138 | +// |
2139 | +// The Google C++ Testing Framework (Google Test) |
2140 | +// |
2141 | +// This header file defines the Message class. |
2142 | +// |
2143 | +// IMPORTANT NOTE: Due to limitation of the C++ language, we have to |
2144 | +// leave some internal implementation details in this header file. |
2145 | +// They are clearly marked by comments like this: |
2146 | +// |
2147 | +// // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM. |
2148 | +// |
2149 | +// Such code is NOT meant to be used by a user directly, and is subject |
2150 | +// to CHANGE WITHOUT NOTICE. Therefore DO NOT DEPEND ON IT in a user |
2151 | +// program! |
2152 | + |
2153 | +#ifndef GTEST_INCLUDE_GTEST_GTEST_MESSAGE_H_ |
2154 | +#define GTEST_INCLUDE_GTEST_GTEST_MESSAGE_H_ |
2155 | + |
2156 | +#include <limits> |
2157 | + |
2158 | +#include "gtest/internal/gtest-port.h" |
2159 | + |
2160 | +// Ensures that there is at least one operator<< in the global namespace. |
2161 | +// See Message& operator<<(...) below for why. |
2162 | +void operator<<(const testing::internal::Secret&, int); |
2163 | + |
2164 | +namespace testing { |
2165 | + |
2166 | +// The Message class works like an ostream repeater. |
2167 | +// |
2168 | +// Typical usage: |
2169 | +// |
2170 | +// 1. You stream a bunch of values to a Message object. |
2171 | +// It will remember the text in a stringstream. |
2172 | +// 2. Then you stream the Message object to an ostream. |
2173 | +// This causes the text in the Message to be streamed |
2174 | +// to the ostream. |
2175 | +// |
2176 | +// For example; |
2177 | +// |
2178 | +// testing::Message foo; |
2179 | +// foo << 1 << " != " << 2; |
2180 | +// std::cout << foo; |
2181 | +// |
2182 | +// will print "1 != 2". |
2183 | +// |
2184 | +// Message is not intended to be inherited from. In particular, its |
2185 | +// destructor is not virtual. |
2186 | +// |
2187 | +// Note that stringstream behaves differently in gcc and in MSVC. You |
2188 | +// can stream a NULL char pointer to it in the former, but not in the |
2189 | +// latter (it causes an access violation if you do). The Message |
2190 | +// class hides this difference by treating a NULL char pointer as |
2191 | +// "(null)". |
2192 | +class GTEST_API_ Message { |
2193 | + private: |
2194 | + // The type of basic IO manipulators (endl, ends, and flush) for |
2195 | + // narrow streams. |
2196 | + typedef std::ostream& (*BasicNarrowIoManip)(std::ostream&); |
2197 | + |
2198 | + public: |
2199 | + // Constructs an empty Message. |
2200 | + Message(); |
2201 | + |
2202 | + // Copy constructor. |
2203 | + Message(const Message& msg) : ss_(new ::std::stringstream) { // NOLINT |
2204 | + *ss_ << msg.GetString(); |
2205 | + } |
2206 | + |
2207 | + // Constructs a Message from a C-string. |
2208 | + explicit Message(const char* str) : ss_(new ::std::stringstream) { |
2209 | + *ss_ << str; |
2210 | + } |
2211 | + |
2212 | +#if GTEST_OS_SYMBIAN |
2213 | + // Streams a value (either a pointer or not) to this object. |
2214 | + template <typename T> |
2215 | + inline Message& operator <<(const T& value) { |
2216 | + StreamHelper(typename internal::is_pointer<T>::type(), value); |
2217 | + return *this; |
2218 | + } |
2219 | +#else |
2220 | + // Streams a non-pointer value to this object. |
2221 | + template <typename T> |
2222 | + inline Message& operator <<(const T& val) { |
2223 | + // Some libraries overload << for STL containers. These |
2224 | + // overloads are defined in the global namespace instead of ::std. |
2225 | + // |
2226 | + // C++'s symbol lookup rule (i.e. Koenig lookup) says that these |
2227 | + // overloads are visible in either the std namespace or the global |
2228 | + // namespace, but not other namespaces, including the testing |
2229 | + // namespace which Google Test's Message class is in. |
2230 | + // |
2231 | + // To allow STL containers (and other types that has a << operator |
2232 | + // defined in the global namespace) to be used in Google Test |
2233 | + // assertions, testing::Message must access the custom << operator |
2234 | + // from the global namespace. With this using declaration, |
2235 | + // overloads of << defined in the global namespace and those |
2236 | + // visible via Koenig lookup are both exposed in this function. |
2237 | + using ::operator <<; |
2238 | + *ss_ << val; |
2239 | + return *this; |
2240 | + } |
2241 | + |
2242 | + // Streams a pointer value to this object. |
2243 | + // |
2244 | + // This function is an overload of the previous one. When you |
2245 | + // stream a pointer to a Message, this definition will be used as it |
2246 | + // is more specialized. (The C++ Standard, section |
2247 | + // [temp.func.order].) If you stream a non-pointer, then the |
2248 | + // previous definition will be used. |
2249 | + // |
2250 | + // The reason for this overload is that streaming a NULL pointer to |
2251 | + // ostream is undefined behavior. Depending on the compiler, you |
2252 | + // may get "0", "(nil)", "(null)", or an access violation. To |
2253 | + // ensure consistent result across compilers, we always treat NULL |
2254 | + // as "(null)". |
2255 | + template <typename T> |
2256 | + inline Message& operator <<(T* const& pointer) { // NOLINT |
2257 | + if (pointer == NULL) { |
2258 | + *ss_ << "(null)"; |
2259 | + } else { |
2260 | + *ss_ << pointer; |
2261 | + } |
2262 | + return *this; |
2263 | + } |
2264 | +#endif // GTEST_OS_SYMBIAN |
2265 | + |
2266 | + // Since the basic IO manipulators are overloaded for both narrow |
2267 | + // and wide streams, we have to provide this specialized definition |
2268 | + // of operator <<, even though its body is the same as the |
2269 | + // templatized version above. Without this definition, streaming |
2270 | + // endl or other basic IO manipulators to Message will confuse the |
2271 | + // compiler. |
2272 | + Message& operator <<(BasicNarrowIoManip val) { |
2273 | + *ss_ << val; |
2274 | + return *this; |
2275 | + } |
2276 | + |
2277 | + // Instead of 1/0, we want to see true/false for bool values. |
2278 | + Message& operator <<(bool b) { |
2279 | + return *this << (b ? "true" : "false"); |
2280 | + } |
2281 | + |
2282 | + // These two overloads allow streaming a wide C string to a Message |
2283 | + // using the UTF-8 encoding. |
2284 | + Message& operator <<(const wchar_t* wide_c_str); |
2285 | + Message& operator <<(wchar_t* wide_c_str); |
2286 | + |
2287 | +#if GTEST_HAS_STD_WSTRING |
2288 | + // Converts the given wide string to a narrow string using the UTF-8 |
2289 | + // encoding, and streams the result to this Message object. |
2290 | + Message& operator <<(const ::std::wstring& wstr); |
2291 | +#endif // GTEST_HAS_STD_WSTRING |
2292 | + |
2293 | +#if GTEST_HAS_GLOBAL_WSTRING |
2294 | + // Converts the given wide string to a narrow string using the UTF-8 |
2295 | + // encoding, and streams the result to this Message object. |
2296 | + Message& operator <<(const ::wstring& wstr); |
2297 | +#endif // GTEST_HAS_GLOBAL_WSTRING |
2298 | + |
2299 | + // Gets the text streamed to this object so far as an std::string. |
2300 | + // Each '\0' character in the buffer is replaced with "\\0". |
2301 | + // |
2302 | + // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM. |
2303 | + std::string GetString() const; |
2304 | + |
2305 | + private: |
2306 | + |
2307 | +#if GTEST_OS_SYMBIAN |
2308 | + // These are needed as the Nokia Symbian Compiler cannot decide between |
2309 | + // const T& and const T* in a function template. The Nokia compiler _can_ |
2310 | + // decide between class template specializations for T and T*, so a |
2311 | + // tr1::type_traits-like is_pointer works, and we can overload on that. |
2312 | + template <typename T> |
2313 | + inline void StreamHelper(internal::true_type /*is_pointer*/, T* pointer) { |
2314 | + if (pointer == NULL) { |
2315 | + *ss_ << "(null)"; |
2316 | + } else { |
2317 | + *ss_ << pointer; |
2318 | + } |
2319 | + } |
2320 | + template <typename T> |
2321 | + inline void StreamHelper(internal::false_type /*is_pointer*/, |
2322 | + const T& value) { |
2323 | + // See the comments in Message& operator <<(const T&) above for why |
2324 | + // we need this using statement. |
2325 | + using ::operator <<; |
2326 | + *ss_ << value; |
2327 | + } |
2328 | +#endif // GTEST_OS_SYMBIAN |
2329 | + |
2330 | + // We'll hold the text streamed to this object here. |
2331 | + const internal::scoped_ptr< ::std::stringstream> ss_; |
2332 | + |
2333 | + // We declare (but don't implement) this to prevent the compiler |
2334 | + // from implementing the assignment operator. |
2335 | + void operator=(const Message&); |
2336 | +}; |
2337 | + |
2338 | +// Streams a Message to an ostream. |
2339 | +inline std::ostream& operator <<(std::ostream& os, const Message& sb) { |
2340 | + return os << sb.GetString(); |
2341 | +} |
2342 | + |
2343 | +namespace internal { |
2344 | + |
2345 | +// Converts a streamable value to an std::string. A NULL pointer is |
2346 | +// converted to "(null)". When the input value is a ::string, |
2347 | +// ::std::string, ::wstring, or ::std::wstring object, each NUL |
2348 | +// character in it is replaced with "\\0". |
2349 | +template <typename T> |
2350 | +std::string StreamableToString(const T& streamable) { |
2351 | + return (Message() << streamable).GetString(); |
2352 | +} |
2353 | + |
2354 | +} // namespace internal |
2355 | +} // namespace testing |
2356 | + |
2357 | +#endif // GTEST_INCLUDE_GTEST_GTEST_MESSAGE_H_ |
2358 | |
2359 | === added file '3rd_party/gmock/gtest/include/gtest/gtest-param-test.h' |
2360 | --- 3rd_party/gmock/gtest/include/gtest/gtest-param-test.h 1970-01-01 00:00:00 +0000 |
2361 | +++ 3rd_party/gmock/gtest/include/gtest/gtest-param-test.h 2014-04-08 15:07:37 +0000 |
2362 | @@ -0,0 +1,1421 @@ |
2363 | +// This file was GENERATED by command: |
2364 | +// pump.py gtest-param-test.h.pump |
2365 | +// DO NOT EDIT BY HAND!!! |
2366 | + |
2367 | +// Copyright 2008, Google Inc. |
2368 | +// All rights reserved. |
2369 | +// |
2370 | +// Redistribution and use in source and binary forms, with or without |
2371 | +// modification, are permitted provided that the following conditions are |
2372 | +// met: |
2373 | +// |
2374 | +// * Redistributions of source code must retain the above copyright |
2375 | +// notice, this list of conditions and the following disclaimer. |
2376 | +// * Redistributions in binary form must reproduce the above |
2377 | +// copyright notice, this list of conditions and the following disclaimer |
2378 | +// in the documentation and/or other materials provided with the |
2379 | +// distribution. |
2380 | +// * Neither the name of Google Inc. nor the names of its |
2381 | +// contributors may be used to endorse or promote products derived from |
2382 | +// this software without specific prior written permission. |
2383 | +// |
2384 | +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS |
2385 | +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT |
2386 | +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR |
2387 | +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT |
2388 | +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, |
2389 | +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT |
2390 | +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
2391 | +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
2392 | +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
2393 | +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
2394 | +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
2395 | +// |
2396 | +// Authors: vladl@google.com (Vlad Losev) |
2397 | +// |
2398 | +// Macros and functions for implementing parameterized tests |
2399 | +// in Google C++ Testing Framework (Google Test) |
2400 | +// |
2401 | +// This file is generated by a SCRIPT. DO NOT EDIT BY HAND! |
2402 | +// |
2403 | +#ifndef GTEST_INCLUDE_GTEST_GTEST_PARAM_TEST_H_ |
2404 | +#define GTEST_INCLUDE_GTEST_GTEST_PARAM_TEST_H_ |
2405 | + |
2406 | + |
2407 | +// Value-parameterized tests allow you to test your code with different |
2408 | +// parameters without writing multiple copies of the same test. |
2409 | +// |
2410 | +// Here is how you use value-parameterized tests: |
2411 | + |
2412 | +#if 0 |
2413 | + |
2414 | +// To write value-parameterized tests, first you should define a fixture |
2415 | +// class. It is usually derived from testing::TestWithParam<T> (see below for |
2416 | +// another inheritance scheme that's sometimes useful in more complicated |
2417 | +// class hierarchies), where the type of your parameter values. |
2418 | +// TestWithParam<T> is itself derived from testing::Test. T can be any |
2419 | +// copyable type. If it's a raw pointer, you are responsible for managing the |
2420 | +// lifespan of the pointed values. |
2421 | + |
2422 | +class FooTest : public ::testing::TestWithParam<const char*> { |
2423 | + // You can implement all the usual class fixture members here. |
2424 | +}; |
2425 | + |
2426 | +// Then, use the TEST_P macro to define as many parameterized tests |
2427 | +// for this fixture as you want. The _P suffix is for "parameterized" |
2428 | +// or "pattern", whichever you prefer to think. |
2429 | + |
2430 | +TEST_P(FooTest, DoesBlah) { |
2431 | + // Inside a test, access the test parameter with the GetParam() method |
2432 | + // of the TestWithParam<T> class: |
2433 | + EXPECT_TRUE(foo.Blah(GetParam())); |
2434 | + ... |
2435 | +} |
2436 | + |
2437 | +TEST_P(FooTest, HasBlahBlah) { |
2438 | + ... |
2439 | +} |
2440 | + |
2441 | +// Finally, you can use INSTANTIATE_TEST_CASE_P to instantiate the test |
2442 | +// case with any set of parameters you want. Google Test defines a number |
2443 | +// of functions for generating test parameters. They return what we call |
2444 | +// (surprise!) parameter generators. Here is a summary of them, which |
2445 | +// are all in the testing namespace: |
2446 | +// |
2447 | +// |
2448 | +// Range(begin, end [, step]) - Yields values {begin, begin+step, |
2449 | +// begin+step+step, ...}. The values do not |
2450 | +// include end. step defaults to 1. |
2451 | +// Values(v1, v2, ..., vN) - Yields values {v1, v2, ..., vN}. |
2452 | +// ValuesIn(container) - Yields values from a C-style array, an STL |
2453 | +// ValuesIn(begin,end) container, or an iterator range [begin, end). |
2454 | +// Bool() - Yields sequence {false, true}. |
2455 | +// Combine(g1, g2, ..., gN) - Yields all combinations (the Cartesian product |
2456 | +// for the math savvy) of the values generated |
2457 | +// by the N generators. |
2458 | +// |
2459 | +// For more details, see comments at the definitions of these functions below |
2460 | +// in this file. |
2461 | +// |
2462 | +// The following statement will instantiate tests from the FooTest test case |
2463 | +// each with parameter values "meeny", "miny", and "moe". |
2464 | + |
2465 | +INSTANTIATE_TEST_CASE_P(InstantiationName, |
2466 | + FooTest, |
2467 | + Values("meeny", "miny", "moe")); |
2468 | + |
2469 | +// To distinguish different instances of the pattern, (yes, you |
2470 | +// can instantiate it more then once) the first argument to the |
2471 | +// INSTANTIATE_TEST_CASE_P macro is a prefix that will be added to the |
2472 | +// actual test case name. Remember to pick unique prefixes for different |
2473 | +// instantiations. The tests from the instantiation above will have |
2474 | +// these names: |
2475 | +// |
2476 | +// * InstantiationName/FooTest.DoesBlah/0 for "meeny" |
2477 | +// * InstantiationName/FooTest.DoesBlah/1 for "miny" |
2478 | +// * InstantiationName/FooTest.DoesBlah/2 for "moe" |
2479 | +// * InstantiationName/FooTest.HasBlahBlah/0 for "meeny" |
2480 | +// * InstantiationName/FooTest.HasBlahBlah/1 for "miny" |
2481 | +// * InstantiationName/FooTest.HasBlahBlah/2 for "moe" |
2482 | +// |
2483 | +// You can use these names in --gtest_filter. |
2484 | +// |
2485 | +// This statement will instantiate all tests from FooTest again, each |
2486 | +// with parameter values "cat" and "dog": |
2487 | + |
2488 | +const char* pets[] = {"cat", "dog"}; |
2489 | +INSTANTIATE_TEST_CASE_P(AnotherInstantiationName, FooTest, ValuesIn(pets)); |
2490 | + |
2491 | +// The tests from the instantiation above will have these names: |
2492 | +// |
2493 | +// * AnotherInstantiationName/FooTest.DoesBlah/0 for "cat" |
2494 | +// * AnotherInstantiationName/FooTest.DoesBlah/1 for "dog" |
2495 | +// * AnotherInstantiationName/FooTest.HasBlahBlah/0 for "cat" |
2496 | +// * AnotherInstantiationName/FooTest.HasBlahBlah/1 for "dog" |
2497 | +// |
2498 | +// Please note that INSTANTIATE_TEST_CASE_P will instantiate all tests |
2499 | +// in the given test case, whether their definitions come before or |
2500 | +// AFTER the INSTANTIATE_TEST_CASE_P statement. |
2501 | +// |
2502 | +// Please also note that generator expressions (including parameters to the |
2503 | +// generators) are evaluated in InitGoogleTest(), after main() has started. |
2504 | +// This allows the user on one hand, to adjust generator parameters in order |
2505 | +// to dynamically determine a set of tests to run and on the other hand, |
2506 | +// give the user a chance to inspect the generated tests with Google Test |
2507 | +// reflection API before RUN_ALL_TESTS() is executed. |
2508 | +// |
2509 | +// You can see samples/sample7_unittest.cc and samples/sample8_unittest.cc |
2510 | +// for more examples. |
2511 | +// |
2512 | +// In the future, we plan to publish the API for defining new parameter |
2513 | +// generators. But for now this interface remains part of the internal |
2514 | +// implementation and is subject to change. |
2515 | +// |
2516 | +// |
2517 | +// A parameterized test fixture must be derived from testing::Test and from |
2518 | +// testing::WithParamInterface<T>, where T is the type of the parameter |
2519 | +// values. Inheriting from TestWithParam<T> satisfies that requirement because |
2520 | +// TestWithParam<T> inherits from both Test and WithParamInterface. In more |
2521 | +// complicated hierarchies, however, it is occasionally useful to inherit |
2522 | +// separately from Test and WithParamInterface. For example: |
2523 | + |
2524 | +class BaseTest : public ::testing::Test { |
2525 | + // You can inherit all the usual members for a non-parameterized test |
2526 | + // fixture here. |
2527 | +}; |
2528 | + |
2529 | +class DerivedTest : public BaseTest, public ::testing::WithParamInterface<int> { |
2530 | + // The usual test fixture members go here too. |
2531 | +}; |
2532 | + |
2533 | +TEST_F(BaseTest, HasFoo) { |
2534 | + // This is an ordinary non-parameterized test. |
2535 | +} |
2536 | + |
2537 | +TEST_P(DerivedTest, DoesBlah) { |
2538 | + // GetParam works just the same here as if you inherit from TestWithParam. |
2539 | + EXPECT_TRUE(foo.Blah(GetParam())); |
2540 | +} |
2541 | + |
2542 | +#endif // 0 |
2543 | + |
2544 | +#include "gtest/internal/gtest-port.h" |
2545 | + |
2546 | +#if !GTEST_OS_SYMBIAN |
2547 | +# include <utility> |
2548 | +#endif |
2549 | + |
2550 | +// scripts/fuse_gtest.py depends on gtest's own header being #included |
2551 | +// *unconditionally*. Therefore these #includes cannot be moved |
2552 | +// inside #if GTEST_HAS_PARAM_TEST. |
2553 | +#include "gtest/internal/gtest-internal.h" |
2554 | +#include "gtest/internal/gtest-param-util.h" |
2555 | +#include "gtest/internal/gtest-param-util-generated.h" |
2556 | + |
2557 | +#if GTEST_HAS_PARAM_TEST |
2558 | + |
2559 | +namespace testing { |
2560 | + |
2561 | +// Functions producing parameter generators. |
2562 | +// |
2563 | +// Google Test uses these generators to produce parameters for value- |
2564 | +// parameterized tests. When a parameterized test case is instantiated |
2565 | +// with a particular generator, Google Test creates and runs tests |
2566 | +// for each element in the sequence produced by the generator. |
2567 | +// |
2568 | +// In the following sample, tests from test case FooTest are instantiated |
2569 | +// each three times with parameter values 3, 5, and 8: |
2570 | +// |
2571 | +// class FooTest : public TestWithParam<int> { ... }; |
2572 | +// |
2573 | +// TEST_P(FooTest, TestThis) { |
2574 | +// } |
2575 | +// TEST_P(FooTest, TestThat) { |
2576 | +// } |
2577 | +// INSTANTIATE_TEST_CASE_P(TestSequence, FooTest, Values(3, 5, 8)); |
2578 | +// |
2579 | + |
2580 | +// Range() returns generators providing sequences of values in a range. |
2581 | +// |
2582 | +// Synopsis: |
2583 | +// Range(start, end) |
2584 | +// - returns a generator producing a sequence of values {start, start+1, |
2585 | +// start+2, ..., }. |
2586 | +// Range(start, end, step) |
2587 | +// - returns a generator producing a sequence of values {start, start+step, |
2588 | +// start+step+step, ..., }. |
2589 | +// Notes: |
2590 | +// * The generated sequences never include end. For example, Range(1, 5) |
2591 | +// returns a generator producing a sequence {1, 2, 3, 4}. Range(1, 9, 2) |
2592 | +// returns a generator producing {1, 3, 5, 7}. |
2593 | +// * start and end must have the same type. That type may be any integral or |
2594 | +// floating-point type or a user defined type satisfying these conditions: |
2595 | +// * It must be assignable (have operator=() defined). |
2596 | +// * It must have operator+() (operator+(int-compatible type) for |
2597 | +// two-operand version). |
2598 | +// * It must have operator<() defined. |
2599 | +// Elements in the resulting sequences will also have that type. |
2600 | +// * Condition start < end must be satisfied in order for resulting sequences |
2601 | +// to contain any elements. |
2602 | +// |
2603 | +template <typename T, typename IncrementT> |
2604 | +internal::ParamGenerator<T> Range(T start, T end, IncrementT step) { |
2605 | + return internal::ParamGenerator<T>( |
2606 | + new internal::RangeGenerator<T, IncrementT>(start, end, step)); |
2607 | +} |
2608 | + |
2609 | +template <typename T> |
2610 | +internal::ParamGenerator<T> Range(T start, T end) { |
2611 | + return Range(start, end, 1); |
2612 | +} |
2613 | + |
2614 | +// ValuesIn() function allows generation of tests with parameters coming from |
2615 | +// a container. |
2616 | +// |
2617 | +// Synopsis: |
2618 | +// ValuesIn(const T (&array)[N]) |
2619 | +// - returns a generator producing sequences with elements from |
2620 | +// a C-style array. |
2621 | +// ValuesIn(const Container& container) |
2622 | +// - returns a generator producing sequences with elements from |
2623 | +// an STL-style container. |
2624 | +// ValuesIn(Iterator begin, Iterator end) |
2625 | +// - returns a generator producing sequences with elements from |
2626 | +// a range [begin, end) defined by a pair of STL-style iterators. These |
2627 | +// iterators can also be plain C pointers. |
2628 | +// |
2629 | +// Please note that ValuesIn copies the values from the containers |
2630 | +// passed in and keeps them to generate tests in RUN_ALL_TESTS(). |
2631 | +// |
2632 | +// Examples: |
2633 | +// |
2634 | +// This instantiates tests from test case StringTest |
2635 | +// each with C-string values of "foo", "bar", and "baz": |
2636 | +// |
2637 | +// const char* strings[] = {"foo", "bar", "baz"}; |
2638 | +// INSTANTIATE_TEST_CASE_P(StringSequence, SrtingTest, ValuesIn(strings)); |
2639 | +// |
2640 | +// This instantiates tests from test case StlStringTest |
2641 | +// each with STL strings with values "a" and "b": |
2642 | +// |
2643 | +// ::std::vector< ::std::string> GetParameterStrings() { |
2644 | +// ::std::vector< ::std::string> v; |
2645 | +// v.push_back("a"); |
2646 | +// v.push_back("b"); |
2647 | +// return v; |
2648 | +// } |
2649 | +// |
2650 | +// INSTANTIATE_TEST_CASE_P(CharSequence, |
2651 | +// StlStringTest, |
2652 | +// ValuesIn(GetParameterStrings())); |
2653 | +// |
2654 | +// |
2655 | +// This will also instantiate tests from CharTest |
2656 | +// each with parameter values 'a' and 'b': |
2657 | +// |
2658 | +// ::std::list<char> GetParameterChars() { |
2659 | +// ::std::list<char> list; |
2660 | +// list.push_back('a'); |
2661 | +// list.push_back('b'); |
2662 | +// return list; |
2663 | +// } |
2664 | +// ::std::list<char> l = GetParameterChars(); |
2665 | +// INSTANTIATE_TEST_CASE_P(CharSequence2, |
2666 | +// CharTest, |
2667 | +// ValuesIn(l.begin(), l.end())); |
2668 | +// |
2669 | +template <typename ForwardIterator> |
2670 | +internal::ParamGenerator< |
2671 | + typename ::testing::internal::IteratorTraits<ForwardIterator>::value_type> |
2672 | +ValuesIn(ForwardIterator begin, ForwardIterator end) { |
2673 | + typedef typename ::testing::internal::IteratorTraits<ForwardIterator> |
2674 | + ::value_type ParamType; |
2675 | + return internal::ParamGenerator<ParamType>( |
2676 | + new internal::ValuesInIteratorRangeGenerator<ParamType>(begin, end)); |
2677 | +} |
2678 | + |
2679 | +template <typename T, size_t N> |
2680 | +internal::ParamGenerator<T> ValuesIn(const T (&array)[N]) { |
2681 | + return ValuesIn(array, array + N); |
2682 | +} |
2683 | + |
2684 | +template <class Container> |
2685 | +internal::ParamGenerator<typename Container::value_type> ValuesIn( |
2686 | + const Container& container) { |
2687 | + return ValuesIn(container.begin(), container.end()); |
2688 | +} |
2689 | + |
2690 | +// Values() allows generating tests from explicitly specified list of |
2691 | +// parameters. |
2692 | +// |
2693 | +// Synopsis: |
2694 | +// Values(T v1, T v2, ..., T vN) |
2695 | +// - returns a generator producing sequences with elements v1, v2, ..., vN. |
2696 | +// |
2697 | +// For example, this instantiates tests from test case BarTest each |
2698 | +// with values "one", "two", and "three": |
2699 | +// |
2700 | +// INSTANTIATE_TEST_CASE_P(NumSequence, BarTest, Values("one", "two", "three")); |
2701 | +// |
2702 | +// This instantiates tests from test case BazTest each with values 1, 2, 3.5. |
2703 | +// The exact type of values will depend on the type of parameter in BazTest. |
2704 | +// |
2705 | +// INSTANTIATE_TEST_CASE_P(FloatingNumbers, BazTest, Values(1, 2, 3.5)); |
2706 | +// |
2707 | +// Currently, Values() supports from 1 to 50 parameters. |
2708 | +// |
2709 | +template <typename T1> |
2710 | +internal::ValueArray1<T1> Values(T1 v1) { |
2711 | + return internal::ValueArray1<T1>(v1); |
2712 | +} |
2713 | + |
2714 | +template <typename T1, typename T2> |
2715 | +internal::ValueArray2<T1, T2> Values(T1 v1, T2 v2) { |
2716 | + return internal::ValueArray2<T1, T2>(v1, v2); |
2717 | +} |
2718 | + |
2719 | +template <typename T1, typename T2, typename T3> |
2720 | +internal::ValueArray3<T1, T2, T3> Values(T1 v1, T2 v2, T3 v3) { |
2721 | + return internal::ValueArray3<T1, T2, T3>(v1, v2, v3); |
2722 | +} |
2723 | + |
2724 | +template <typename T1, typename T2, typename T3, typename T4> |
2725 | +internal::ValueArray4<T1, T2, T3, T4> Values(T1 v1, T2 v2, T3 v3, T4 v4) { |
2726 | + return internal::ValueArray4<T1, T2, T3, T4>(v1, v2, v3, v4); |
2727 | +} |
2728 | + |
2729 | +template <typename T1, typename T2, typename T3, typename T4, typename T5> |
2730 | +internal::ValueArray5<T1, T2, T3, T4, T5> Values(T1 v1, T2 v2, T3 v3, T4 v4, |
2731 | + T5 v5) { |
2732 | + return internal::ValueArray5<T1, T2, T3, T4, T5>(v1, v2, v3, v4, v5); |
2733 | +} |
2734 | + |
2735 | +template <typename T1, typename T2, typename T3, typename T4, typename T5, |
2736 | + typename T6> |
2737 | +internal::ValueArray6<T1, T2, T3, T4, T5, T6> Values(T1 v1, T2 v2, T3 v3, |
2738 | + T4 v4, T5 v5, T6 v6) { |
2739 | + return internal::ValueArray6<T1, T2, T3, T4, T5, T6>(v1, v2, v3, v4, v5, v6); |
2740 | +} |
2741 | + |
2742 | +template <typename T1, typename T2, typename T3, typename T4, typename T5, |
2743 | + typename T6, typename T7> |
2744 | +internal::ValueArray7<T1, T2, T3, T4, T5, T6, T7> Values(T1 v1, T2 v2, T3 v3, |
2745 | + T4 v4, T5 v5, T6 v6, T7 v7) { |
2746 | + return internal::ValueArray7<T1, T2, T3, T4, T5, T6, T7>(v1, v2, v3, v4, v5, |
2747 | + v6, v7); |
2748 | +} |
2749 | + |
2750 | +template <typename T1, typename T2, typename T3, typename T4, typename T5, |
2751 | + typename T6, typename T7, typename T8> |
2752 | +internal::ValueArray8<T1, T2, T3, T4, T5, T6, T7, T8> Values(T1 v1, T2 v2, |
2753 | + T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8) { |
2754 | + return internal::ValueArray8<T1, T2, T3, T4, T5, T6, T7, T8>(v1, v2, v3, v4, |
2755 | + v5, v6, v7, v8); |
2756 | +} |
2757 | + |
2758 | +template <typename T1, typename T2, typename T3, typename T4, typename T5, |
2759 | + typename T6, typename T7, typename T8, typename T9> |
2760 | +internal::ValueArray9<T1, T2, T3, T4, T5, T6, T7, T8, T9> Values(T1 v1, T2 v2, |
2761 | + T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9) { |
2762 | + return internal::ValueArray9<T1, T2, T3, T4, T5, T6, T7, T8, T9>(v1, v2, v3, |
2763 | + v4, v5, v6, v7, v8, v9); |
2764 | +} |
2765 | + |
2766 | +template <typename T1, typename T2, typename T3, typename T4, typename T5, |
2767 | + typename T6, typename T7, typename T8, typename T9, typename T10> |
2768 | +internal::ValueArray10<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10> Values(T1 v1, |
2769 | + T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10) { |
2770 | + return internal::ValueArray10<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>(v1, |
2771 | + v2, v3, v4, v5, v6, v7, v8, v9, v10); |
2772 | +} |
2773 | + |
2774 | +template <typename T1, typename T2, typename T3, typename T4, typename T5, |
2775 | + typename T6, typename T7, typename T8, typename T9, typename T10, |
2776 | + typename T11> |
2777 | +internal::ValueArray11<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, |
2778 | + T11> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, |
2779 | + T10 v10, T11 v11) { |
2780 | + return internal::ValueArray11<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, |
2781 | + T11>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11); |
2782 | +} |
2783 | + |
2784 | +template <typename T1, typename T2, typename T3, typename T4, typename T5, |
2785 | + typename T6, typename T7, typename T8, typename T9, typename T10, |
2786 | + typename T11, typename T12> |
2787 | +internal::ValueArray12<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, |
2788 | + T12> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, |
2789 | + T10 v10, T11 v11, T12 v12) { |
2790 | + return internal::ValueArray12<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, |
2791 | + T12>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12); |
2792 | +} |
2793 | + |
2794 | +template <typename T1, typename T2, typename T3, typename T4, typename T5, |
2795 | + typename T6, typename T7, typename T8, typename T9, typename T10, |
2796 | + typename T11, typename T12, typename T13> |
2797 | +internal::ValueArray13<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, |
2798 | + T13> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, |
2799 | + T10 v10, T11 v11, T12 v12, T13 v13) { |
2800 | + return internal::ValueArray13<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, |
2801 | + T12, T13>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13); |
2802 | +} |
2803 | + |
2804 | +template <typename T1, typename T2, typename T3, typename T4, typename T5, |
2805 | + typename T6, typename T7, typename T8, typename T9, typename T10, |
2806 | + typename T11, typename T12, typename T13, typename T14> |
2807 | +internal::ValueArray14<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, |
2808 | + T14> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, |
2809 | + T10 v10, T11 v11, T12 v12, T13 v13, T14 v14) { |
2810 | + return internal::ValueArray14<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, |
2811 | + T12, T13, T14>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, |
2812 | + v14); |
2813 | +} |
2814 | + |
2815 | +template <typename T1, typename T2, typename T3, typename T4, typename T5, |
2816 | + typename T6, typename T7, typename T8, typename T9, typename T10, |
2817 | + typename T11, typename T12, typename T13, typename T14, typename T15> |
2818 | +internal::ValueArray15<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, |
2819 | + T14, T15> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, |
2820 | + T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15) { |
2821 | + return internal::ValueArray15<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, |
2822 | + T12, T13, T14, T15>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, |
2823 | + v13, v14, v15); |
2824 | +} |
2825 | + |
2826 | +template <typename T1, typename T2, typename T3, typename T4, typename T5, |
2827 | + typename T6, typename T7, typename T8, typename T9, typename T10, |
2828 | + typename T11, typename T12, typename T13, typename T14, typename T15, |
2829 | + typename T16> |
2830 | +internal::ValueArray16<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, |
2831 | + T14, T15, T16> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, |
2832 | + T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, |
2833 | + T16 v16) { |
2834 | + return internal::ValueArray16<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, |
2835 | + T12, T13, T14, T15, T16>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, |
2836 | + v12, v13, v14, v15, v16); |
2837 | +} |
2838 | + |
2839 | +template <typename T1, typename T2, typename T3, typename T4, typename T5, |
2840 | + typename T6, typename T7, typename T8, typename T9, typename T10, |
2841 | + typename T11, typename T12, typename T13, typename T14, typename T15, |
2842 | + typename T16, typename T17> |
2843 | +internal::ValueArray17<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, |
2844 | + T14, T15, T16, T17> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, |
2845 | + T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, |
2846 | + T16 v16, T17 v17) { |
2847 | + return internal::ValueArray17<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, |
2848 | + T12, T13, T14, T15, T16, T17>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, |
2849 | + v11, v12, v13, v14, v15, v16, v17); |
2850 | +} |
2851 | + |
2852 | +template <typename T1, typename T2, typename T3, typename T4, typename T5, |
2853 | + typename T6, typename T7, typename T8, typename T9, typename T10, |
2854 | + typename T11, typename T12, typename T13, typename T14, typename T15, |
2855 | + typename T16, typename T17, typename T18> |
2856 | +internal::ValueArray18<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, |
2857 | + T14, T15, T16, T17, T18> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, |
2858 | + T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, |
2859 | + T16 v16, T17 v17, T18 v18) { |
2860 | + return internal::ValueArray18<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, |
2861 | + T12, T13, T14, T15, T16, T17, T18>(v1, v2, v3, v4, v5, v6, v7, v8, v9, |
2862 | + v10, v11, v12, v13, v14, v15, v16, v17, v18); |
2863 | +} |
2864 | + |
2865 | +template <typename T1, typename T2, typename T3, typename T4, typename T5, |
2866 | + typename T6, typename T7, typename T8, typename T9, typename T10, |
2867 | + typename T11, typename T12, typename T13, typename T14, typename T15, |
2868 | + typename T16, typename T17, typename T18, typename T19> |
2869 | +internal::ValueArray19<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, |
2870 | + T14, T15, T16, T17, T18, T19> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, |
2871 | + T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, |
2872 | + T15 v15, T16 v16, T17 v17, T18 v18, T19 v19) { |
2873 | + return internal::ValueArray19<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, |
2874 | + T12, T13, T14, T15, T16, T17, T18, T19>(v1, v2, v3, v4, v5, v6, v7, v8, |
2875 | + v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19); |
2876 | +} |
2877 | + |
2878 | +template <typename T1, typename T2, typename T3, typename T4, typename T5, |
2879 | + typename T6, typename T7, typename T8, typename T9, typename T10, |
2880 | + typename T11, typename T12, typename T13, typename T14, typename T15, |
2881 | + typename T16, typename T17, typename T18, typename T19, typename T20> |
2882 | +internal::ValueArray20<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, |
2883 | + T14, T15, T16, T17, T18, T19, T20> Values(T1 v1, T2 v2, T3 v3, T4 v4, |
2884 | + T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, |
2885 | + T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20) { |
2886 | + return internal::ValueArray20<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, |
2887 | + T12, T13, T14, T15, T16, T17, T18, T19, T20>(v1, v2, v3, v4, v5, v6, v7, |
2888 | + v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20); |
2889 | +} |
2890 | + |
2891 | +template <typename T1, typename T2, typename T3, typename T4, typename T5, |
2892 | + typename T6, typename T7, typename T8, typename T9, typename T10, |
2893 | + typename T11, typename T12, typename T13, typename T14, typename T15, |
2894 | + typename T16, typename T17, typename T18, typename T19, typename T20, |
2895 | + typename T21> |
2896 | +internal::ValueArray21<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, |
2897 | + T14, T15, T16, T17, T18, T19, T20, T21> Values(T1 v1, T2 v2, T3 v3, T4 v4, |
2898 | + T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, |
2899 | + T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21) { |
2900 | + return internal::ValueArray21<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, |
2901 | + T12, T13, T14, T15, T16, T17, T18, T19, T20, T21>(v1, v2, v3, v4, v5, v6, |
2902 | + v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21); |
2903 | +} |
2904 | + |
2905 | +template <typename T1, typename T2, typename T3, typename T4, typename T5, |
2906 | + typename T6, typename T7, typename T8, typename T9, typename T10, |
2907 | + typename T11, typename T12, typename T13, typename T14, typename T15, |
2908 | + typename T16, typename T17, typename T18, typename T19, typename T20, |
2909 | + typename T21, typename T22> |
2910 | +internal::ValueArray22<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, |
2911 | + T14, T15, T16, T17, T18, T19, T20, T21, T22> Values(T1 v1, T2 v2, T3 v3, |
2912 | + T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, |
2913 | + T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, |
2914 | + T21 v21, T22 v22) { |
2915 | + return internal::ValueArray22<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, |
2916 | + T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22>(v1, v2, v3, v4, |
2917 | + v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, |
2918 | + v20, v21, v22); |
2919 | +} |
2920 | + |
2921 | +template <typename T1, typename T2, typename T3, typename T4, typename T5, |
2922 | + typename T6, typename T7, typename T8, typename T9, typename T10, |
2923 | + typename T11, typename T12, typename T13, typename T14, typename T15, |
2924 | + typename T16, typename T17, typename T18, typename T19, typename T20, |
2925 | + typename T21, typename T22, typename T23> |
2926 | +internal::ValueArray23<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, |
2927 | + T14, T15, T16, T17, T18, T19, T20, T21, T22, T23> Values(T1 v1, T2 v2, |
2928 | + T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, |
2929 | + T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, |
2930 | + T21 v21, T22 v22, T23 v23) { |
2931 | + return internal::ValueArray23<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, |
2932 | + T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23>(v1, v2, v3, |
2933 | + v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, |
2934 | + v20, v21, v22, v23); |
2935 | +} |
2936 | + |
2937 | +template <typename T1, typename T2, typename T3, typename T4, typename T5, |
2938 | + typename T6, typename T7, typename T8, typename T9, typename T10, |
2939 | + typename T11, typename T12, typename T13, typename T14, typename T15, |
2940 | + typename T16, typename T17, typename T18, typename T19, typename T20, |
2941 | + typename T21, typename T22, typename T23, typename T24> |
2942 | +internal::ValueArray24<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, |
2943 | + T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24> Values(T1 v1, T2 v2, |
2944 | + T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, |
2945 | + T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, |
2946 | + T21 v21, T22 v22, T23 v23, T24 v24) { |
2947 | + return internal::ValueArray24<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, |
2948 | + T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24>(v1, v2, |
2949 | + v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, |
2950 | + v19, v20, v21, v22, v23, v24); |
2951 | +} |
2952 | + |
2953 | +template <typename T1, typename T2, typename T3, typename T4, typename T5, |
2954 | + typename T6, typename T7, typename T8, typename T9, typename T10, |
2955 | + typename T11, typename T12, typename T13, typename T14, typename T15, |
2956 | + typename T16, typename T17, typename T18, typename T19, typename T20, |
2957 | + typename T21, typename T22, typename T23, typename T24, typename T25> |
2958 | +internal::ValueArray25<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, |
2959 | + T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25> Values(T1 v1, |
2960 | + T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, |
2961 | + T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, |
2962 | + T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25) { |
2963 | + return internal::ValueArray25<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, |
2964 | + T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25>(v1, |
2965 | + v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, |
2966 | + v18, v19, v20, v21, v22, v23, v24, v25); |
2967 | +} |
2968 | + |
2969 | +template <typename T1, typename T2, typename T3, typename T4, typename T5, |
2970 | + typename T6, typename T7, typename T8, typename T9, typename T10, |
2971 | + typename T11, typename T12, typename T13, typename T14, typename T15, |
2972 | + typename T16, typename T17, typename T18, typename T19, typename T20, |
2973 | + typename T21, typename T22, typename T23, typename T24, typename T25, |
2974 | + typename T26> |
2975 | +internal::ValueArray26<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, |
2976 | + T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, |
2977 | + T26> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, |
2978 | + T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, |
2979 | + T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, |
2980 | + T26 v26) { |
2981 | + return internal::ValueArray26<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, |
2982 | + T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, |
2983 | + T26>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, |
2984 | + v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26); |
2985 | +} |
2986 | + |
2987 | +template <typename T1, typename T2, typename T3, typename T4, typename T5, |
2988 | + typename T6, typename T7, typename T8, typename T9, typename T10, |
2989 | + typename T11, typename T12, typename T13, typename T14, typename T15, |
2990 | + typename T16, typename T17, typename T18, typename T19, typename T20, |
2991 | + typename T21, typename T22, typename T23, typename T24, typename T25, |
2992 | + typename T26, typename T27> |
2993 | +internal::ValueArray27<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, |
2994 | + T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, |
2995 | + T27> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, |
2996 | + T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, |
2997 | + T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, |
2998 | + T26 v26, T27 v27) { |
2999 | + return internal::ValueArray27<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, |
3000 | + T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, |
3001 | + T26, T27>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, |
3002 | + v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27); |
3003 | +} |
3004 | + |
3005 | +template <typename T1, typename T2, typename T3, typename T4, typename T5, |
3006 | + typename T6, typename T7, typename T8, typename T9, typename T10, |
3007 | + typename T11, typename T12, typename T13, typename T14, typename T15, |
3008 | + typename T16, typename T17, typename T18, typename T19, typename T20, |
3009 | + typename T21, typename T22, typename T23, typename T24, typename T25, |
3010 | + typename T26, typename T27, typename T28> |
3011 | +internal::ValueArray28<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, |
3012 | + T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, |
3013 | + T28> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, |
3014 | + T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, |
3015 | + T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, |
3016 | + T26 v26, T27 v27, T28 v28) { |
3017 | + return internal::ValueArray28<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, |
3018 | + T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, |
3019 | + T26, T27, T28>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, |
3020 | + v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, |
3021 | + v28); |
3022 | +} |
3023 | + |
3024 | +template <typename T1, typename T2, typename T3, typename T4, typename T5, |
3025 | + typename T6, typename T7, typename T8, typename T9, typename T10, |
3026 | + typename T11, typename T12, typename T13, typename T14, typename T15, |
3027 | + typename T16, typename T17, typename T18, typename T19, typename T20, |
3028 | + typename T21, typename T22, typename T23, typename T24, typename T25, |
3029 | + typename T26, typename T27, typename T28, typename T29> |
3030 | +internal::ValueArray29<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, |
3031 | + T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, |
3032 | + T29> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, |
3033 | + T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, |
3034 | + T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, |
3035 | + T26 v26, T27 v27, T28 v28, T29 v29) { |
3036 | + return internal::ValueArray29<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, |
3037 | + T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, |
3038 | + T26, T27, T28, T29>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, |
3039 | + v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, |
3040 | + v27, v28, v29); |
3041 | +} |
3042 | + |
3043 | +template <typename T1, typename T2, typename T3, typename T4, typename T5, |
3044 | + typename T6, typename T7, typename T8, typename T9, typename T10, |
3045 | + typename T11, typename T12, typename T13, typename T14, typename T15, |
3046 | + typename T16, typename T17, typename T18, typename T19, typename T20, |
3047 | + typename T21, typename T22, typename T23, typename T24, typename T25, |
3048 | + typename T26, typename T27, typename T28, typename T29, typename T30> |
3049 | +internal::ValueArray30<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, |
3050 | + T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, |
3051 | + T29, T30> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, |
3052 | + T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, |
3053 | + T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, |
3054 | + T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30) { |
3055 | + return internal::ValueArray30<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, |
3056 | + T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, |
3057 | + T26, T27, T28, T29, T30>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, |
3058 | + v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, |
3059 | + v26, v27, v28, v29, v30); |
3060 | +} |
3061 | + |
3062 | +template <typename T1, typename T2, typename T3, typename T4, typename T5, |
3063 | + typename T6, typename T7, typename T8, typename T9, typename T10, |
3064 | + typename T11, typename T12, typename T13, typename T14, typename T15, |
3065 | + typename T16, typename T17, typename T18, typename T19, typename T20, |
3066 | + typename T21, typename T22, typename T23, typename T24, typename T25, |
3067 | + typename T26, typename T27, typename T28, typename T29, typename T30, |
3068 | + typename T31> |
3069 | +internal::ValueArray31<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, |
3070 | + T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, |
3071 | + T29, T30, T31> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, |
3072 | + T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, |
3073 | + T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, |
3074 | + T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31) { |
3075 | + return internal::ValueArray31<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, |
3076 | + T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, |
3077 | + T26, T27, T28, T29, T30, T31>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, |
3078 | + v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, |
3079 | + v25, v26, v27, v28, v29, v30, v31); |
3080 | +} |
3081 | + |
3082 | +template <typename T1, typename T2, typename T3, typename T4, typename T5, |
3083 | + typename T6, typename T7, typename T8, typename T9, typename T10, |
3084 | + typename T11, typename T12, typename T13, typename T14, typename T15, |
3085 | + typename T16, typename T17, typename T18, typename T19, typename T20, |
3086 | + typename T21, typename T22, typename T23, typename T24, typename T25, |
3087 | + typename T26, typename T27, typename T28, typename T29, typename T30, |
3088 | + typename T31, typename T32> |
3089 | +internal::ValueArray32<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, |
3090 | + T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, |
3091 | + T29, T30, T31, T32> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, |
3092 | + T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, |
3093 | + T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, |
3094 | + T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, |
3095 | + T32 v32) { |
3096 | + return internal::ValueArray32<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, |
3097 | + T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, |
3098 | + T26, T27, T28, T29, T30, T31, T32>(v1, v2, v3, v4, v5, v6, v7, v8, v9, |
3099 | + v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, |
3100 | + v24, v25, v26, v27, v28, v29, v30, v31, v32); |
3101 | +} |
3102 | + |
3103 | +template <typename T1, typename T2, typename T3, typename T4, typename T5, |
3104 | + typename T6, typename T7, typename T8, typename T9, typename T10, |
3105 | + typename T11, typename T12, typename T13, typename T14, typename T15, |
3106 | + typename T16, typename T17, typename T18, typename T19, typename T20, |
3107 | + typename T21, typename T22, typename T23, typename T24, typename T25, |
3108 | + typename T26, typename T27, typename T28, typename T29, typename T30, |
3109 | + typename T31, typename T32, typename T33> |
3110 | +internal::ValueArray33<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, |
3111 | + T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, |
3112 | + T29, T30, T31, T32, T33> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, |
3113 | + T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, |
3114 | + T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, |
3115 | + T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, |
3116 | + T32 v32, T33 v33) { |
3117 | + return internal::ValueArray33<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, |
3118 | + T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, |
3119 | + T26, T27, T28, T29, T30, T31, T32, T33>(v1, v2, v3, v4, v5, v6, v7, v8, |
3120 | + v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, |
3121 | + v24, v25, v26, v27, v28, v29, v30, v31, v32, v33); |
3122 | +} |
3123 | + |
3124 | +template <typename T1, typename T2, typename T3, typename T4, typename T5, |
3125 | + typename T6, typename T7, typename T8, typename T9, typename T10, |
3126 | + typename T11, typename T12, typename T13, typename T14, typename T15, |
3127 | + typename T16, typename T17, typename T18, typename T19, typename T20, |
3128 | + typename T21, typename T22, typename T23, typename T24, typename T25, |
3129 | + typename T26, typename T27, typename T28, typename T29, typename T30, |
3130 | + typename T31, typename T32, typename T33, typename T34> |
3131 | +internal::ValueArray34<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, |
3132 | + T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, |
3133 | + T29, T30, T31, T32, T33, T34> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, |
3134 | + T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, |
3135 | + T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, |
3136 | + T23 v23, T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, |
3137 | + T31 v31, T32 v32, T33 v33, T34 v34) { |
3138 | + return internal::ValueArray34<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, |
3139 | + T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, |
3140 | + T26, T27, T28, T29, T30, T31, T32, T33, T34>(v1, v2, v3, v4, v5, v6, v7, |
3141 | + v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, |
3142 | + v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34); |
3143 | +} |
3144 | + |
3145 | +template <typename T1, typename T2, typename T3, typename T4, typename T5, |
3146 | + typename T6, typename T7, typename T8, typename T9, typename T10, |
3147 | + typename T11, typename T12, typename T13, typename T14, typename T15, |
3148 | + typename T16, typename T17, typename T18, typename T19, typename T20, |
3149 | + typename T21, typename T22, typename T23, typename T24, typename T25, |
3150 | + typename T26, typename T27, typename T28, typename T29, typename T30, |
3151 | + typename T31, typename T32, typename T33, typename T34, typename T35> |
3152 | +internal::ValueArray35<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, |
3153 | + T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, |
3154 | + T29, T30, T31, T32, T33, T34, T35> Values(T1 v1, T2 v2, T3 v3, T4 v4, |
3155 | + T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, |
3156 | + T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, |
3157 | + T22 v22, T23 v23, T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, |
3158 | + T30 v30, T31 v31, T32 v32, T33 v33, T34 v34, T35 v35) { |
3159 | + return internal::ValueArray35<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, |
3160 | + T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, |
3161 | + T26, T27, T28, T29, T30, T31, T32, T33, T34, T35>(v1, v2, v3, v4, v5, v6, |
3162 | + v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, |
3163 | + v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35); |
3164 | +} |
3165 | + |
3166 | +template <typename T1, typename T2, typename T3, typename T4, typename T5, |
3167 | + typename T6, typename T7, typename T8, typename T9, typename T10, |
3168 | + typename T11, typename T12, typename T13, typename T14, typename T15, |
3169 | + typename T16, typename T17, typename T18, typename T19, typename T20, |
3170 | + typename T21, typename T22, typename T23, typename T24, typename T25, |
3171 | + typename T26, typename T27, typename T28, typename T29, typename T30, |
3172 | + typename T31, typename T32, typename T33, typename T34, typename T35, |
3173 | + typename T36> |
3174 | +internal::ValueArray36<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, |
3175 | + T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, |
3176 | + T29, T30, T31, T32, T33, T34, T35, T36> Values(T1 v1, T2 v2, T3 v3, T4 v4, |
3177 | + T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, |
3178 | + T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, |
3179 | + T22 v22, T23 v23, T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, |
3180 | + T30 v30, T31 v31, T32 v32, T33 v33, T34 v34, T35 v35, T36 v36) { |
3181 | + return internal::ValueArray36<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, |
3182 | + T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, |
3183 | + T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36>(v1, v2, v3, v4, |
3184 | + v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, |
3185 | + v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, |
3186 | + v34, v35, v36); |
3187 | +} |
3188 | + |
3189 | +template <typename T1, typename T2, typename T3, typename T4, typename T5, |
3190 | + typename T6, typename T7, typename T8, typename T9, typename T10, |
3191 | + typename T11, typename T12, typename T13, typename T14, typename T15, |
3192 | + typename T16, typename T17, typename T18, typename T19, typename T20, |
3193 | + typename T21, typename T22, typename T23, typename T24, typename T25, |
3194 | + typename T26, typename T27, typename T28, typename T29, typename T30, |
3195 | + typename T31, typename T32, typename T33, typename T34, typename T35, |
3196 | + typename T36, typename T37> |
3197 | +internal::ValueArray37<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, |
3198 | + T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, |
3199 | + T29, T30, T31, T32, T33, T34, T35, T36, T37> Values(T1 v1, T2 v2, T3 v3, |
3200 | + T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, |
3201 | + T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, |
3202 | + T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, |
3203 | + T29 v29, T30 v30, T31 v31, T32 v32, T33 v33, T34 v34, T35 v35, T36 v36, |
3204 | + T37 v37) { |
3205 | + return internal::ValueArray37<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, |
3206 | + T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, |
3207 | + T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37>(v1, v2, v3, |
3208 | + v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, |
3209 | + v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, |
3210 | + v34, v35, v36, v37); |
3211 | +} |
3212 | + |
3213 | +template <typename T1, typename T2, typename T3, typename T4, typename T5, |
3214 | + typename T6, typename T7, typename T8, typename T9, typename T10, |
3215 | + typename T11, typename T12, typename T13, typename T14, typename T15, |
3216 | + typename T16, typename T17, typename T18, typename T19, typename T20, |
3217 | + typename T21, typename T22, typename T23, typename T24, typename T25, |
3218 | + typename T26, typename T27, typename T28, typename T29, typename T30, |
3219 | + typename T31, typename T32, typename T33, typename T34, typename T35, |
3220 | + typename T36, typename T37, typename T38> |
3221 | +internal::ValueArray38<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, |
3222 | + T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, |
3223 | + T29, T30, T31, T32, T33, T34, T35, T36, T37, T38> Values(T1 v1, T2 v2, |
3224 | + T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, |
3225 | + T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, |
3226 | + T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, |
3227 | + T29 v29, T30 v30, T31 v31, T32 v32, T33 v33, T34 v34, T35 v35, T36 v36, |
3228 | + T37 v37, T38 v38) { |
3229 | + return internal::ValueArray38<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, |
3230 | + T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, |
3231 | + T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38>(v1, v2, |
3232 | + v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, |
3233 | + v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, |
3234 | + v33, v34, v35, v36, v37, v38); |
3235 | +} |
3236 | + |
3237 | +template <typename T1, typename T2, typename T3, typename T4, typename T5, |
3238 | + typename T6, typename T7, typename T8, typename T9, typename T10, |
3239 | + typename T11, typename T12, typename T13, typename T14, typename T15, |
3240 | + typename T16, typename T17, typename T18, typename T19, typename T20, |
3241 | + typename T21, typename T22, typename T23, typename T24, typename T25, |
3242 | + typename T26, typename T27, typename T28, typename T29, typename T30, |
3243 | + typename T31, typename T32, typename T33, typename T34, typename T35, |
3244 | + typename T36, typename T37, typename T38, typename T39> |
3245 | +internal::ValueArray39<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, |
3246 | + T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, |
3247 | + T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39> Values(T1 v1, T2 v2, |
3248 | + T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, |
3249 | + T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, |
3250 | + T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, |
3251 | + T29 v29, T30 v30, T31 v31, T32 v32, T33 v33, T34 v34, T35 v35, T36 v36, |
3252 | + T37 v37, T38 v38, T39 v39) { |
3253 | + return internal::ValueArray39<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, |
3254 | + T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, |
3255 | + T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39>(v1, |
3256 | + v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, |
3257 | + v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, |
3258 | + v32, v33, v34, v35, v36, v37, v38, v39); |
3259 | +} |
3260 | + |
3261 | +template <typename T1, typename T2, typename T3, typename T4, typename T5, |
3262 | + typename T6, typename T7, typename T8, typename T9, typename T10, |
3263 | + typename T11, typename T12, typename T13, typename T14, typename T15, |
3264 | + typename T16, typename T17, typename T18, typename T19, typename T20, |
3265 | + typename T21, typename T22, typename T23, typename T24, typename T25, |
3266 | + typename T26, typename T27, typename T28, typename T29, typename T30, |
3267 | + typename T31, typename T32, typename T33, typename T34, typename T35, |
3268 | + typename T36, typename T37, typename T38, typename T39, typename T40> |
3269 | +internal::ValueArray40<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, |
3270 | + T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, |
3271 | + T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40> Values(T1 v1, |
3272 | + T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, |
3273 | + T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, |
3274 | + T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, T26 v26, T27 v27, |
3275 | + T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33, T34 v34, T35 v35, |
3276 | + T36 v36, T37 v37, T38 v38, T39 v39, T40 v40) { |
3277 | + return internal::ValueArray40<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, |
3278 | + T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, |
3279 | + T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, |
3280 | + T40>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, |
3281 | + v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, |
3282 | + v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40); |
3283 | +} |
3284 | + |
3285 | +template <typename T1, typename T2, typename T3, typename T4, typename T5, |
3286 | + typename T6, typename T7, typename T8, typename T9, typename T10, |
3287 | + typename T11, typename T12, typename T13, typename T14, typename T15, |
3288 | + typename T16, typename T17, typename T18, typename T19, typename T20, |
3289 | + typename T21, typename T22, typename T23, typename T24, typename T25, |
3290 | + typename T26, typename T27, typename T28, typename T29, typename T30, |
3291 | + typename T31, typename T32, typename T33, typename T34, typename T35, |
3292 | + typename T36, typename T37, typename T38, typename T39, typename T40, |
3293 | + typename T41> |
3294 | +internal::ValueArray41<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, |
3295 | + T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, |
3296 | + T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, |
3297 | + T41> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, |
3298 | + T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, |
3299 | + T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, |
3300 | + T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33, |
3301 | + T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41) { |
3302 | + return internal::ValueArray41<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, |
3303 | + T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, |
3304 | + T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, |
3305 | + T40, T41>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, |
3306 | + v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, |
3307 | + v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41); |
3308 | +} |
3309 | + |
3310 | +template <typename T1, typename T2, typename T3, typename T4, typename T5, |
3311 | + typename T6, typename T7, typename T8, typename T9, typename T10, |
3312 | + typename T11, typename T12, typename T13, typename T14, typename T15, |
3313 | + typename T16, typename T17, typename T18, typename T19, typename T20, |
3314 | + typename T21, typename T22, typename T23, typename T24, typename T25, |
3315 | + typename T26, typename T27, typename T28, typename T29, typename T30, |
3316 | + typename T31, typename T32, typename T33, typename T34, typename T35, |
3317 | + typename T36, typename T37, typename T38, typename T39, typename T40, |
3318 | + typename T41, typename T42> |
3319 | +internal::ValueArray42<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, |
3320 | + T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, |
3321 | + T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, |
3322 | + T42> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, |
3323 | + T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, |
3324 | + T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, |
3325 | + T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33, |
3326 | + T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41, |
3327 | + T42 v42) { |
3328 | + return internal::ValueArray42<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, |
3329 | + T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, |
3330 | + T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, |
3331 | + T40, T41, T42>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, |
3332 | + v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, |
3333 | + v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, |
3334 | + v42); |
3335 | +} |
3336 | + |
3337 | +template <typename T1, typename T2, typename T3, typename T4, typename T5, |
3338 | + typename T6, typename T7, typename T8, typename T9, typename T10, |
3339 | + typename T11, typename T12, typename T13, typename T14, typename T15, |
3340 | + typename T16, typename T17, typename T18, typename T19, typename T20, |
3341 | + typename T21, typename T22, typename T23, typename T24, typename T25, |
3342 | + typename T26, typename T27, typename T28, typename T29, typename T30, |
3343 | + typename T31, typename T32, typename T33, typename T34, typename T35, |
3344 | + typename T36, typename T37, typename T38, typename T39, typename T40, |
3345 | + typename T41, typename T42, typename T43> |
3346 | +internal::ValueArray43<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, |
3347 | + T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, |
3348 | + T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, |
3349 | + T43> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, |
3350 | + T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, |
3351 | + T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, |
3352 | + T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33, |
3353 | + T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41, |
3354 | + T42 v42, T43 v43) { |
3355 | + return internal::ValueArray43<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, |
3356 | + T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, |
3357 | + T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, |
3358 | + T40, T41, T42, T43>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, |
3359 | + v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, |
3360 | + v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, |
3361 | + v41, v42, v43); |
3362 | +} |
3363 | + |
3364 | +template <typename T1, typename T2, typename T3, typename T4, typename T5, |
3365 | + typename T6, typename T7, typename T8, typename T9, typename T10, |
3366 | + typename T11, typename T12, typename T13, typename T14, typename T15, |
3367 | + typename T16, typename T17, typename T18, typename T19, typename T20, |
3368 | + typename T21, typename T22, typename T23, typename T24, typename T25, |
3369 | + typename T26, typename T27, typename T28, typename T29, typename T30, |
3370 | + typename T31, typename T32, typename T33, typename T34, typename T35, |
3371 | + typename T36, typename T37, typename T38, typename T39, typename T40, |
3372 | + typename T41, typename T42, typename T43, typename T44> |
3373 | +internal::ValueArray44<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, |
3374 | + T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, |
3375 | + T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, |
3376 | + T44> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, |
3377 | + T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, |
3378 | + T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, |
3379 | + T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33, |
3380 | + T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41, |
3381 | + T42 v42, T43 v43, T44 v44) { |
3382 | + return internal::ValueArray44<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, |
3383 | + T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, |
3384 | + T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, |
3385 | + T40, T41, T42, T43, T44>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, |
3386 | + v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, |
3387 | + v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, |
3388 | + v40, v41, v42, v43, v44); |
3389 | +} |
3390 | + |
3391 | +template <typename T1, typename T2, typename T3, typename T4, typename T5, |
3392 | + typename T6, typename T7, typename T8, typename T9, typename T10, |
3393 | + typename T11, typename T12, typename T13, typename T14, typename T15, |
3394 | + typename T16, typename T17, typename T18, typename T19, typename T20, |
3395 | + typename T21, typename T22, typename T23, typename T24, typename T25, |
3396 | + typename T26, typename T27, typename T28, typename T29, typename T30, |
3397 | + typename T31, typename T32, typename T33, typename T34, typename T35, |
3398 | + typename T36, typename T37, typename T38, typename T39, typename T40, |
3399 | + typename T41, typename T42, typename T43, typename T44, typename T45> |
3400 | +internal::ValueArray45<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, |
3401 | + T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, |
3402 | + T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, |
3403 | + T44, T45> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, |
3404 | + T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, |
3405 | + T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, |
3406 | + T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, |
3407 | + T33 v33, T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, |
3408 | + T41 v41, T42 v42, T43 v43, T44 v44, T45 v45) { |
3409 | + return internal::ValueArray45<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, |
3410 | + T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, |
3411 | + T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, |
3412 | + T40, T41, T42, T43, T44, T45>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, |
3413 | + v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, |
3414 | + v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, |
3415 | + v39, v40, v41, v42, v43, v44, v45); |
3416 | +} |
3417 | + |
3418 | +template <typename T1, typename T2, typename T3, typename T4, typename T5, |
3419 | + typename T6, typename T7, typename T8, typename T9, typename T10, |
3420 | + typename T11, typename T12, typename T13, typename T14, typename T15, |
3421 | + typename T16, typename T17, typename T18, typename T19, typename T20, |
3422 | + typename T21, typename T22, typename T23, typename T24, typename T25, |
3423 | + typename T26, typename T27, typename T28, typename T29, typename T30, |
3424 | + typename T31, typename T32, typename T33, typename T34, typename T35, |
3425 | + typename T36, typename T37, typename T38, typename T39, typename T40, |
3426 | + typename T41, typename T42, typename T43, typename T44, typename T45, |
3427 | + typename T46> |
3428 | +internal::ValueArray46<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, |
3429 | + T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, |
3430 | + T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, |
3431 | + T44, T45, T46> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, |
3432 | + T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, |
3433 | + T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, |
3434 | + T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, |
3435 | + T32 v32, T33 v33, T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, |
3436 | + T40 v40, T41 v41, T42 v42, T43 v43, T44 v44, T45 v45, T46 v46) { |
3437 | + return internal::ValueArray46<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, |
3438 | + T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, |
3439 | + T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, |
3440 | + T40, T41, T42, T43, T44, T45, T46>(v1, v2, v3, v4, v5, v6, v7, v8, v9, |
3441 | + v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, |
3442 | + v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, |
3443 | + v38, v39, v40, v41, v42, v43, v44, v45, v46); |
3444 | +} |
3445 | + |
3446 | +template <typename T1, typename T2, typename T3, typename T4, typename T5, |
3447 | + typename T6, typename T7, typename T8, typename T9, typename T10, |
3448 | + typename T11, typename T12, typename T13, typename T14, typename T15, |
3449 | + typename T16, typename T17, typename T18, typename T19, typename T20, |
3450 | + typename T21, typename T22, typename T23, typename T24, typename T25, |
3451 | + typename T26, typename T27, typename T28, typename T29, typename T30, |
3452 | + typename T31, typename T32, typename T33, typename T34, typename T35, |
3453 | + typename T36, typename T37, typename T38, typename T39, typename T40, |
3454 | + typename T41, typename T42, typename T43, typename T44, typename T45, |
3455 | + typename T46, typename T47> |
3456 | +internal::ValueArray47<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, |
3457 | + T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, |
3458 | + T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, |
3459 | + T44, T45, T46, T47> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, |
3460 | + T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, |
3461 | + T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, |
3462 | + T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, |
3463 | + T32 v32, T33 v33, T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, |
3464 | + T40 v40, T41 v41, T42 v42, T43 v43, T44 v44, T45 v45, T46 v46, T47 v47) { |
3465 | + return internal::ValueArray47<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, |
3466 | + T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, |
3467 | + T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, |
3468 | + T40, T41, T42, T43, T44, T45, T46, T47>(v1, v2, v3, v4, v5, v6, v7, v8, |
3469 | + v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, |
3470 | + v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, |
3471 | + v38, v39, v40, v41, v42, v43, v44, v45, v46, v47); |
3472 | +} |
3473 | + |
3474 | +template <typename T1, typename T2, typename T3, typename T4, typename T5, |
3475 | + typename T6, typename T7, typename T8, typename T9, typename T10, |
3476 | + typename T11, typename T12, typename T13, typename T14, typename T15, |
3477 | + typename T16, typename T17, typename T18, typename T19, typename T20, |
3478 | + typename T21, typename T22, typename T23, typename T24, typename T25, |
3479 | + typename T26, typename T27, typename T28, typename T29, typename T30, |
3480 | + typename T31, typename T32, typename T33, typename T34, typename T35, |
3481 | + typename T36, typename T37, typename T38, typename T39, typename T40, |
3482 | + typename T41, typename T42, typename T43, typename T44, typename T45, |
3483 | + typename T46, typename T47, typename T48> |
3484 | +internal::ValueArray48<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, |
3485 | + T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, |
3486 | + T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, |
3487 | + T44, T45, T46, T47, T48> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, |
3488 | + T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, |
3489 | + T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, |
3490 | + T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, |
3491 | + T32 v32, T33 v33, T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, |
3492 | + T40 v40, T41 v41, T42 v42, T43 v43, T44 v44, T45 v45, T46 v46, T47 v47, |
3493 | + T48 v48) { |
3494 | + return internal::ValueArray48<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, |
3495 | + T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, |
3496 | + T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, |
3497 | + T40, T41, T42, T43, T44, T45, T46, T47, T48>(v1, v2, v3, v4, v5, v6, v7, |
3498 | + v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, |
3499 | + v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, |
3500 | + v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47, v48); |
3501 | +} |
3502 | + |
3503 | +template <typename T1, typename T2, typename T3, typename T4, typename T5, |
3504 | + typename T6, typename T7, typename T8, typename T9, typename T10, |
3505 | + typename T11, typename T12, typename T13, typename T14, typename T15, |
3506 | + typename T16, typename T17, typename T18, typename T19, typename T20, |
3507 | + typename T21, typename T22, typename T23, typename T24, typename T25, |
3508 | + typename T26, typename T27, typename T28, typename T29, typename T30, |
3509 | + typename T31, typename T32, typename T33, typename T34, typename T35, |
3510 | + typename T36, typename T37, typename T38, typename T39, typename T40, |
3511 | + typename T41, typename T42, typename T43, typename T44, typename T45, |
3512 | + typename T46, typename T47, typename T48, typename T49> |
3513 | +internal::ValueArray49<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, |
3514 | + T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, |
3515 | + T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, |
3516 | + T44, T45, T46, T47, T48, T49> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, |
3517 | + T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, |
3518 | + T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, |
3519 | + T23 v23, T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, |
3520 | + T31 v31, T32 v32, T33 v33, T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, |
3521 | + T39 v39, T40 v40, T41 v41, T42 v42, T43 v43, T44 v44, T45 v45, T46 v46, |
3522 | + T47 v47, T48 v48, T49 v49) { |
3523 | + return internal::ValueArray49<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, |
3524 | + T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, |
3525 | + T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, |
3526 | + T40, T41, T42, T43, T44, T45, T46, T47, T48, T49>(v1, v2, v3, v4, v5, v6, |
3527 | + v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, |
3528 | + v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, |
3529 | + v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47, v48, v49); |
3530 | +} |
3531 | + |
3532 | +template <typename T1, typename T2, typename T3, typename T4, typename T5, |
3533 | + typename T6, typename T7, typename T8, typename T9, typename T10, |
3534 | + typename T11, typename T12, typename T13, typename T14, typename T15, |
3535 | + typename T16, typename T17, typename T18, typename T19, typename T20, |
3536 | + typename T21, typename T22, typename T23, typename T24, typename T25, |
3537 | + typename T26, typename T27, typename T28, typename T29, typename T30, |
3538 | + typename T31, typename T32, typename T33, typename T34, typename T35, |
3539 | + typename T36, typename T37, typename T38, typename T39, typename T40, |
3540 | + typename T41, typename T42, typename T43, typename T44, typename T45, |
3541 | + typename T46, typename T47, typename T48, typename T49, typename T50> |
3542 | +internal::ValueArray50<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, |
3543 | + T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, |
3544 | + T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, |
3545 | + T44, T45, T46, T47, T48, T49, T50> Values(T1 v1, T2 v2, T3 v3, T4 v4, |
3546 | + T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, |
3547 | + T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, |
3548 | + T22 v22, T23 v23, T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, |
3549 | + T30 v30, T31 v31, T32 v32, T33 v33, T34 v34, T35 v35, T36 v36, T37 v37, |
3550 | + T38 v38, T39 v39, T40 v40, T41 v41, T42 v42, T43 v43, T44 v44, T45 v45, |
3551 | + T46 v46, T47 v47, T48 v48, T49 v49, T50 v50) { |
3552 | + return internal::ValueArray50<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, |
3553 | + T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, |
3554 | + T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, |
3555 | + T40, T41, T42, T43, T44, T45, T46, T47, T48, T49, T50>(v1, v2, v3, v4, |
3556 | + v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, |
3557 | + v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, |
3558 | + v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47, |
3559 | + v48, v49, v50); |
3560 | +} |
3561 | + |
3562 | +// Bool() allows generating tests with parameters in a set of (false, true). |
3563 | +// |
3564 | +// Synopsis: |
3565 | +// Bool() |
3566 | +// - returns a generator producing sequences with elements {false, true}. |
3567 | +// |
3568 | +// It is useful when testing code that depends on Boolean flags. Combinations |
3569 | +// of multiple flags can be tested when several Bool()'s are combined using |
3570 | +// Combine() function. |
3571 | +// |
3572 | +// In the following example all tests in the test case FlagDependentTest |
3573 | +// will be instantiated twice with parameters false and true. |
3574 | +// |
3575 | +// class FlagDependentTest : public testing::TestWithParam<bool> { |
3576 | +// virtual void SetUp() { |
3577 | +// external_flag = GetParam(); |
3578 | +// } |
3579 | +// } |
3580 | +// INSTANTIATE_TEST_CASE_P(BoolSequence, FlagDependentTest, Bool()); |
3581 | +// |
3582 | +inline internal::ParamGenerator<bool> Bool() { |
3583 | + return Values(false, true); |
3584 | +} |
3585 | + |
3586 | +# if GTEST_HAS_COMBINE |
3587 | +// Combine() allows the user to combine two or more sequences to produce |
3588 | +// values of a Cartesian product of those sequences' elements. |
3589 | +// |
3590 | +// Synopsis: |
3591 | +// Combine(gen1, gen2, ..., genN) |
3592 | +// - returns a generator producing sequences with elements coming from |
3593 | +// the Cartesian product of elements from the sequences generated by |
3594 | +// gen1, gen2, ..., genN. The sequence elements will have a type of |
3595 | +// tuple<T1, T2, ..., TN> where T1, T2, ..., TN are the types |
3596 | +// of elements from sequences produces by gen1, gen2, ..., genN. |
3597 | +// |
3598 | +// Combine can have up to 10 arguments. This number is currently limited |
3599 | +// by the maximum number of elements in the tuple implementation used by Google |
3600 | +// Test. |
3601 | +// |
3602 | +// Example: |
3603 | +// |
3604 | +// This will instantiate tests in test case AnimalTest each one with |
3605 | +// the parameter values tuple("cat", BLACK), tuple("cat", WHITE), |
3606 | +// tuple("dog", BLACK), and tuple("dog", WHITE): |
3607 | +// |
3608 | +// enum Color { BLACK, GRAY, WHITE }; |
3609 | +// class AnimalTest |
3610 | +// : public testing::TestWithParam<tuple<const char*, Color> > {...}; |
3611 | +// |
3612 | +// TEST_P(AnimalTest, AnimalLooksNice) {...} |
3613 | +// |
3614 | +// INSTANTIATE_TEST_CASE_P(AnimalVariations, AnimalTest, |
3615 | +// Combine(Values("cat", "dog"), |
3616 | +// Values(BLACK, WHITE))); |
3617 | +// |
3618 | +// This will instantiate tests in FlagDependentTest with all variations of two |
3619 | +// Boolean flags: |
3620 | +// |
3621 | +// class FlagDependentTest |
3622 | +// : public testing::TestWithParam<tuple<bool, bool> > { |
3623 | +// virtual void SetUp() { |
3624 | +// // Assigns external_flag_1 and external_flag_2 values from the tuple. |
3625 | +// tie(external_flag_1, external_flag_2) = GetParam(); |
3626 | +// } |
3627 | +// }; |
3628 | +// |
3629 | +// TEST_P(FlagDependentTest, TestFeature1) { |
3630 | +// // Test your code using external_flag_1 and external_flag_2 here. |
3631 | +// } |
3632 | +// INSTANTIATE_TEST_CASE_P(TwoBoolSequence, FlagDependentTest, |
3633 | +// Combine(Bool(), Bool())); |
3634 | +// |
3635 | +template <typename Generator1, typename Generator2> |
3636 | +internal::CartesianProductHolder2<Generator1, Generator2> Combine( |
3637 | + const Generator1& g1, const Generator2& g2) { |
3638 | + return internal::CartesianProductHolder2<Generator1, Generator2>( |
3639 | + g1, g2); |
3640 | +} |
3641 | + |
3642 | +template <typename Generator1, typename Generator2, typename Generator3> |
3643 | +internal::CartesianProductHolder3<Generator1, Generator2, Generator3> Combine( |
3644 | + const Generator1& g1, const Generator2& g2, const Generator3& g3) { |
3645 | + return internal::CartesianProductHolder3<Generator1, Generator2, Generator3>( |
3646 | + g1, g2, g3); |
3647 | +} |
3648 | + |
3649 | +template <typename Generator1, typename Generator2, typename Generator3, |
3650 | + typename Generator4> |
3651 | +internal::CartesianProductHolder4<Generator1, Generator2, Generator3, |
3652 | + Generator4> Combine( |
3653 | + const Generator1& g1, const Generator2& g2, const Generator3& g3, |
3654 | + const Generator4& g4) { |
3655 | + return internal::CartesianProductHolder4<Generator1, Generator2, Generator3, |
3656 | + Generator4>( |
3657 | + g1, g2, g3, g4); |
3658 | +} |
3659 | + |
3660 | +template <typename Generator1, typename Generator2, typename Generator3, |
3661 | + typename Generator4, typename Generator5> |
3662 | +internal::CartesianProductHolder5<Generator1, Generator2, Generator3, |
3663 | + Generator4, Generator5> Combine( |
3664 | + const Generator1& g1, const Generator2& g2, const Generator3& g3, |
3665 | + const Generator4& g4, const Generator5& g5) { |
3666 | + return internal::CartesianProductHolder5<Generator1, Generator2, Generator3, |
3667 | + Generator4, Generator5>( |
3668 | + g1, g2, g3, g4, g5); |
3669 | +} |
3670 | + |
3671 | +template <typename Generator1, typename Generator2, typename Generator3, |
3672 | + typename Generator4, typename Generator5, typename Generator6> |
3673 | +internal::CartesianProductHolder6<Generator1, Generator2, Generator3, |
3674 | + Generator4, Generator5, Generator6> Combine( |
3675 | + const Generator1& g1, const Generator2& g2, const Generator3& g3, |
3676 | + const Generator4& g4, const Generator5& g5, const Generator6& g6) { |
3677 | + return internal::CartesianProductHolder6<Generator1, Generator2, Generator3, |
3678 | + Generator4, Generator5, Generator6>( |
3679 | + g1, g2, g3, g4, g5, g6); |
3680 | +} |
3681 | + |
3682 | +template <typename Generator1, typename Generator2, typename Generator3, |
3683 | + typename Generator4, typename Generator5, typename Generator6, |
3684 | + typename Generator7> |
3685 | +internal::CartesianProductHolder7<Generator1, Generator2, Generator3, |
3686 | + Generator4, Generator5, Generator6, Generator7> Combine( |
3687 | + const Generator1& g1, const Generator2& g2, const Generator3& g3, |
3688 | + const Generator4& g4, const Generator5& g5, const Generator6& g6, |
3689 | + const Generator7& g7) { |
3690 | + return internal::CartesianProductHolder7<Generator1, Generator2, Generator3, |
3691 | + Generator4, Generator5, Generator6, Generator7>( |
3692 | + g1, g2, g3, g4, g5, g6, g7); |
3693 | +} |
3694 | + |
3695 | +template <typename Generator1, typename Generator2, typename Generator3, |
3696 | + typename Generator4, typename Generator5, typename Generator6, |
3697 | + typename Generator7, typename Generator8> |
3698 | +internal::CartesianProductHolder8<Generator1, Generator2, Generator3, |
3699 | + Generator4, Generator5, Generator6, Generator7, Generator8> Combine( |
3700 | + const Generator1& g1, const Generator2& g2, const Generator3& g3, |
3701 | + const Generator4& g4, const Generator5& g5, const Generator6& g6, |
3702 | + const Generator7& g7, const Generator8& g8) { |
3703 | + return internal::CartesianProductHolder8<Generator1, Generator2, Generator3, |
3704 | + Generator4, Generator5, Generator6, Generator7, Generator8>( |
3705 | + g1, g2, g3, g4, g5, g6, g7, g8); |
3706 | +} |
3707 | + |
3708 | +template <typename Generator1, typename Generator2, typename Generator3, |
3709 | + typename Generator4, typename Generator5, typename Generator6, |
3710 | + typename Generator7, typename Generator8, typename Generator9> |
3711 | +internal::CartesianProductHolder9<Generator1, Generator2, Generator3, |
3712 | + Generator4, Generator5, Generator6, Generator7, Generator8, |
3713 | + Generator9> Combine( |
3714 | + const Generator1& g1, const Generator2& g2, const Generator3& g3, |
3715 | + const Generator4& g4, const Generator5& g5, const Generator6& g6, |
3716 | + const Generator7& g7, const Generator8& g8, const Generator9& g9) { |
3717 | + return internal::CartesianProductHolder9<Generator1, Generator2, Generator3, |
3718 | + Generator4, Generator5, Generator6, Generator7, Generator8, Generator9>( |
3719 | + g1, g2, g3, g4, g5, g6, g7, g8, g9); |
3720 | +} |
3721 | + |
3722 | +template <typename Generator1, typename Generator2, typename Generator3, |
3723 | + typename Generator4, typename Generator5, typename Generator6, |
3724 | + typename Generator7, typename Generator8, typename Generator9, |
3725 | + typename Generator10> |
3726 | +internal::CartesianProductHolder10<Generator1, Generator2, Generator3, |
3727 | + Generator4, Generator5, Generator6, Generator7, Generator8, Generator9, |
3728 | + Generator10> Combine( |
3729 | + const Generator1& g1, const Generator2& g2, const Generator3& g3, |
3730 | + const Generator4& g4, const Generator5& g5, const Generator6& g6, |
3731 | + const Generator7& g7, const Generator8& g8, const Generator9& g9, |
3732 | + const Generator10& g10) { |
3733 | + return internal::CartesianProductHolder10<Generator1, Generator2, Generator3, |
3734 | + Generator4, Generator5, Generator6, Generator7, Generator8, Generator9, |
3735 | + Generator10>( |
3736 | + g1, g2, g3, g4, g5, g6, g7, g8, g9, g10); |
3737 | +} |
3738 | +# endif // GTEST_HAS_COMBINE |
3739 | + |
3740 | + |
3741 | + |
3742 | +# define TEST_P(test_case_name, test_name) \ |
3743 | + class GTEST_TEST_CLASS_NAME_(test_case_name, test_name) \ |
3744 | + : public test_case_name { \ |
3745 | + public: \ |
3746 | + GTEST_TEST_CLASS_NAME_(test_case_name, test_name)() {} \ |
3747 | + virtual void TestBody(); \ |
3748 | + private: \ |
3749 | + static int AddToRegistry() { \ |
3750 | + ::testing::UnitTest::GetInstance()->parameterized_test_registry(). \ |
3751 | + GetTestCasePatternHolder<test_case_name>(\ |
3752 | + #test_case_name, __FILE__, __LINE__)->AddTestPattern(\ |
3753 | + #test_case_name, \ |
3754 | + #test_name, \ |
3755 | + new ::testing::internal::TestMetaFactory< \ |
3756 | + GTEST_TEST_CLASS_NAME_(test_case_name, test_name)>()); \ |
3757 | + return 0; \ |
3758 | + } \ |
3759 | + static int gtest_registering_dummy_; \ |
3760 | + GTEST_DISALLOW_COPY_AND_ASSIGN_(\ |
3761 | + GTEST_TEST_CLASS_NAME_(test_case_name, test_name)); \ |
3762 | + }; \ |
3763 | + int GTEST_TEST_CLASS_NAME_(test_case_name, \ |
3764 | + test_name)::gtest_registering_dummy_ = \ |
3765 | + GTEST_TEST_CLASS_NAME_(test_case_name, test_name)::AddToRegistry(); \ |
3766 | + void GTEST_TEST_CLASS_NAME_(test_case_name, test_name)::TestBody() |
3767 | + |
3768 | +# define INSTANTIATE_TEST_CASE_P(prefix, test_case_name, generator) \ |
3769 | + ::testing::internal::ParamGenerator<test_case_name::ParamType> \ |
3770 | + gtest_##prefix##test_case_name##_EvalGenerator_() { return generator; } \ |
3771 | + int gtest_##prefix##test_case_name##_dummy_ = \ |
3772 | + ::testing::UnitTest::GetInstance()->parameterized_test_registry(). \ |
3773 | + GetTestCasePatternHolder<test_case_name>(\ |
3774 | + #test_case_name, __FILE__, __LINE__)->AddTestCaseInstantiation(\ |
3775 | + #prefix, \ |
3776 | + >est_##prefix##test_case_name##_EvalGenerator_, \ |
3777 | + __FILE__, __LINE__) |
3778 | + |
3779 | +} // namespace testing |
3780 | + |
3781 | +#endif // GTEST_HAS_PARAM_TEST |
3782 | + |
3783 | +#endif // GTEST_INCLUDE_GTEST_GTEST_PARAM_TEST_H_ |
3784 | |
3785 | === added file '3rd_party/gmock/gtest/include/gtest/gtest-param-test.h.pump' |
3786 | --- 3rd_party/gmock/gtest/include/gtest/gtest-param-test.h.pump 1970-01-01 00:00:00 +0000 |
3787 | +++ 3rd_party/gmock/gtest/include/gtest/gtest-param-test.h.pump 2014-04-08 15:07:37 +0000 |
3788 | @@ -0,0 +1,487 @@ |
3789 | +$$ -*- mode: c++; -*- |
3790 | +$var n = 50 $$ Maximum length of Values arguments we want to support. |
3791 | +$var maxtuple = 10 $$ Maximum number of Combine arguments we want to support. |
3792 | +// Copyright 2008, Google Inc. |
3793 | +// All rights reserved. |
3794 | +// |
3795 | +// Redistribution and use in source and binary forms, with or without |
3796 | +// modification, are permitted provided that the following conditions are |
3797 | +// met: |
3798 | +// |
3799 | +// * Redistributions of source code must retain the above copyright |
3800 | +// notice, this list of conditions and the following disclaimer. |
3801 | +// * Redistributions in binary form must reproduce the above |
3802 | +// copyright notice, this list of conditions and the following disclaimer |
3803 | +// in the documentation and/or other materials provided with the |
3804 | +// distribution. |
3805 | +// * Neither the name of Google Inc. nor the names of its |
3806 | +// contributors may be used to endorse or promote products derived from |
3807 | +// this software without specific prior written permission. |
3808 | +// |
3809 | +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS |
3810 | +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT |
3811 | +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR |
3812 | +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT |
3813 | +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, |
3814 | +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT |
3815 | +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
3816 | +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
3817 | +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
3818 | +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
3819 | +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
3820 | +// |
3821 | +// Authors: vladl@google.com (Vlad Losev) |
3822 | +// |
3823 | +// Macros and functions for implementing parameterized tests |
3824 | +// in Google C++ Testing Framework (Google Test) |
3825 | +// |
3826 | +// This file is generated by a SCRIPT. DO NOT EDIT BY HAND! |
3827 | +// |
3828 | +#ifndef GTEST_INCLUDE_GTEST_GTEST_PARAM_TEST_H_ |
3829 | +#define GTEST_INCLUDE_GTEST_GTEST_PARAM_TEST_H_ |
3830 | + |
3831 | + |
3832 | +// Value-parameterized tests allow you to test your code with different |
3833 | +// parameters without writing multiple copies of the same test. |
3834 | +// |
3835 | +// Here is how you use value-parameterized tests: |
3836 | + |
3837 | +#if 0 |
3838 | + |
3839 | +// To write value-parameterized tests, first you should define a fixture |
3840 | +// class. It is usually derived from testing::TestWithParam<T> (see below for |
3841 | +// another inheritance scheme that's sometimes useful in more complicated |
3842 | +// class hierarchies), where the type of your parameter values. |
3843 | +// TestWithParam<T> is itself derived from testing::Test. T can be any |
3844 | +// copyable type. If it's a raw pointer, you are responsible for managing the |
3845 | +// lifespan of the pointed values. |
3846 | + |
3847 | +class FooTest : public ::testing::TestWithParam<const char*> { |
3848 | + // You can implement all the usual class fixture members here. |
3849 | +}; |
3850 | + |
3851 | +// Then, use the TEST_P macro to define as many parameterized tests |
3852 | +// for this fixture as you want. The _P suffix is for "parameterized" |
3853 | +// or "pattern", whichever you prefer to think. |
3854 | + |
3855 | +TEST_P(FooTest, DoesBlah) { |
3856 | + // Inside a test, access the test parameter with the GetParam() method |
3857 | + // of the TestWithParam<T> class: |
3858 | + EXPECT_TRUE(foo.Blah(GetParam())); |
3859 | + ... |
3860 | +} |
3861 | + |
3862 | +TEST_P(FooTest, HasBlahBlah) { |
3863 | + ... |
3864 | +} |
3865 | + |
3866 | +// Finally, you can use INSTANTIATE_TEST_CASE_P to instantiate the test |
3867 | +// case with any set of parameters you want. Google Test defines a number |
3868 | +// of functions for generating test parameters. They return what we call |
3869 | +// (surprise!) parameter generators. Here is a summary of them, which |
3870 | +// are all in the testing namespace: |
3871 | +// |
3872 | +// |
3873 | +// Range(begin, end [, step]) - Yields values {begin, begin+step, |
3874 | +// begin+step+step, ...}. The values do not |
3875 | +// include end. step defaults to 1. |
3876 | +// Values(v1, v2, ..., vN) - Yields values {v1, v2, ..., vN}. |
3877 | +// ValuesIn(container) - Yields values from a C-style array, an STL |
3878 | +// ValuesIn(begin,end) container, or an iterator range [begin, end). |
3879 | +// Bool() - Yields sequence {false, true}. |
3880 | +// Combine(g1, g2, ..., gN) - Yields all combinations (the Cartesian product |
3881 | +// for the math savvy) of the values generated |
3882 | +// by the N generators. |
3883 | +// |
3884 | +// For more details, see comments at the definitions of these functions below |
3885 | +// in this file. |
3886 | +// |
3887 | +// The following statement will instantiate tests from the FooTest test case |
3888 | +// each with parameter values "meeny", "miny", and "moe". |
3889 | + |
3890 | +INSTANTIATE_TEST_CASE_P(InstantiationName, |
3891 | + FooTest, |
3892 | + Values("meeny", "miny", "moe")); |
3893 | + |
3894 | +// To distinguish different instances of the pattern, (yes, you |
3895 | +// can instantiate it more then once) the first argument to the |
3896 | +// INSTANTIATE_TEST_CASE_P macro is a prefix that will be added to the |
3897 | +// actual test case name. Remember to pick unique prefixes for different |
3898 | +// instantiations. The tests from the instantiation above will have |
3899 | +// these names: |
3900 | +// |
3901 | +// * InstantiationName/FooTest.DoesBlah/0 for "meeny" |
3902 | +// * InstantiationName/FooTest.DoesBlah/1 for "miny" |
3903 | +// * InstantiationName/FooTest.DoesBlah/2 for "moe" |
3904 | +// * InstantiationName/FooTest.HasBlahBlah/0 for "meeny" |
3905 | +// * InstantiationName/FooTest.HasBlahBlah/1 for "miny" |
3906 | +// * InstantiationName/FooTest.HasBlahBlah/2 for "moe" |
3907 | +// |
3908 | +// You can use these names in --gtest_filter. |
3909 | +// |
3910 | +// This statement will instantiate all tests from FooTest again, each |
3911 | +// with parameter values "cat" and "dog": |
3912 | + |
3913 | +const char* pets[] = {"cat", "dog"}; |
3914 | +INSTANTIATE_TEST_CASE_P(AnotherInstantiationName, FooTest, ValuesIn(pets)); |
3915 | + |
3916 | +// The tests from the instantiation above will have these names: |
3917 | +// |
3918 | +// * AnotherInstantiationName/FooTest.DoesBlah/0 for "cat" |
3919 | +// * AnotherInstantiationName/FooTest.DoesBlah/1 for "dog" |
3920 | +// * AnotherInstantiationName/FooTest.HasBlahBlah/0 for "cat" |
3921 | +// * AnotherInstantiationName/FooTest.HasBlahBlah/1 for "dog" |
3922 | +// |
3923 | +// Please note that INSTANTIATE_TEST_CASE_P will instantiate all tests |
3924 | +// in the given test case, whether their definitions come before or |
3925 | +// AFTER the INSTANTIATE_TEST_CASE_P statement. |
3926 | +// |
3927 | +// Please also note that generator expressions (including parameters to the |
3928 | +// generators) are evaluated in InitGoogleTest(), after main() has started. |
3929 | +// This allows the user on one hand, to adjust generator parameters in order |
3930 | +// to dynamically determine a set of tests to run and on the other hand, |
3931 | +// give the user a chance to inspect the generated tests with Google Test |
3932 | +// reflection API before RUN_ALL_TESTS() is executed. |
3933 | +// |
3934 | +// You can see samples/sample7_unittest.cc and samples/sample8_unittest.cc |
3935 | +// for more examples. |
3936 | +// |
3937 | +// In the future, we plan to publish the API for defining new parameter |
3938 | +// generators. But for now this interface remains part of the internal |
3939 | +// implementation and is subject to change. |
3940 | +// |
3941 | +// |
3942 | +// A parameterized test fixture must be derived from testing::Test and from |
3943 | +// testing::WithParamInterface<T>, where T is the type of the parameter |
3944 | +// values. Inheriting from TestWithParam<T> satisfies that requirement because |
3945 | +// TestWithParam<T> inherits from both Test and WithParamInterface. In more |
3946 | +// complicated hierarchies, however, it is occasionally useful to inherit |
3947 | +// separately from Test and WithParamInterface. For example: |
3948 | + |
3949 | +class BaseTest : public ::testing::Test { |
3950 | + // You can inherit all the usual members for a non-parameterized test |
3951 | + // fixture here. |
3952 | +}; |
3953 | + |
3954 | +class DerivedTest : public BaseTest, public ::testing::WithParamInterface<int> { |
3955 | + // The usual test fixture members go here too. |
3956 | +}; |
3957 | + |
3958 | +TEST_F(BaseTest, HasFoo) { |
3959 | + // This is an ordinary non-parameterized test. |
3960 | +} |
3961 | + |
3962 | +TEST_P(DerivedTest, DoesBlah) { |
3963 | + // GetParam works just the same here as if you inherit from TestWithParam. |
3964 | + EXPECT_TRUE(foo.Blah(GetParam())); |
3965 | +} |
3966 | + |
3967 | +#endif // 0 |
3968 | + |
3969 | +#include "gtest/internal/gtest-port.h" |
3970 | + |
3971 | +#if !GTEST_OS_SYMBIAN |
3972 | +# include <utility> |
3973 | +#endif |
3974 | + |
3975 | +// scripts/fuse_gtest.py depends on gtest's own header being #included |
3976 | +// *unconditionally*. Therefore these #includes cannot be moved |
3977 | +// inside #if GTEST_HAS_PARAM_TEST. |
3978 | +#include "gtest/internal/gtest-internal.h" |
3979 | +#include "gtest/internal/gtest-param-util.h" |
3980 | +#include "gtest/internal/gtest-param-util-generated.h" |
3981 | + |
3982 | +#if GTEST_HAS_PARAM_TEST |
3983 | + |
3984 | +namespace testing { |
3985 | + |
3986 | +// Functions producing parameter generators. |
3987 | +// |
3988 | +// Google Test uses these generators to produce parameters for value- |
3989 | +// parameterized tests. When a parameterized test case is instantiated |
3990 | +// with a particular generator, Google Test creates and runs tests |
3991 | +// for each element in the sequence produced by the generator. |
3992 | +// |
3993 | +// In the following sample, tests from test case FooTest are instantiated |
3994 | +// each three times with parameter values 3, 5, and 8: |
3995 | +// |
3996 | +// class FooTest : public TestWithParam<int> { ... }; |
3997 | +// |
3998 | +// TEST_P(FooTest, TestThis) { |
3999 | +// } |
4000 | +// TEST_P(FooTest, TestThat) { |
4001 | +// } |
4002 | +// INSTANTIATE_TEST_CASE_P(TestSequence, FooTest, Values(3, 5, 8)); |
4003 | +// |
4004 | + |
4005 | +// Range() returns generators providing sequences of values in a range. |
4006 | +// |
4007 | +// Synopsis: |
4008 | +// Range(start, end) |
4009 | +// - returns a generator producing a sequence of values {start, start+1, |
4010 | +// start+2, ..., }. |
4011 | +// Range(start, end, step) |
4012 | +// - returns a generator producing a sequence of values {start, start+step, |
4013 | +// start+step+step, ..., }. |
4014 | +// Notes: |
4015 | +// * The generated sequences never include end. For example, Range(1, 5) |
4016 | +// returns a generator producing a sequence {1, 2, 3, 4}. Range(1, 9, 2) |
4017 | +// returns a generator producing {1, 3, 5, 7}. |
4018 | +// * start and end must have the same type. That type may be any integral or |
4019 | +// floating-point type or a user defined type satisfying these conditions: |
4020 | +// * It must be assignable (have operator=() defined). |
4021 | +// * It must have operator+() (operator+(int-compatible type) for |
4022 | +// two-operand version). |
4023 | +// * It must have operator<() defined. |
4024 | +// Elements in the resulting sequences will also have that type. |
4025 | +// * Condition start < end must be satisfied in order for resulting sequences |
4026 | +// to contain any elements. |
4027 | +// |
4028 | +template <typename T, typename IncrementT> |
4029 | +internal::ParamGenerator<T> Range(T start, T end, IncrementT step) { |
4030 | + return internal::ParamGenerator<T>( |
4031 | + new internal::RangeGenerator<T, IncrementT>(start, end, step)); |
4032 | +} |
4033 | + |
4034 | +template <typename T> |
4035 | +internal::ParamGenerator<T> Range(T start, T end) { |
4036 | + return Range(start, end, 1); |
4037 | +} |
4038 | + |
4039 | +// ValuesIn() function allows generation of tests with parameters coming from |
4040 | +// a container. |
4041 | +// |
4042 | +// Synopsis: |
4043 | +// ValuesIn(const T (&array)[N]) |
4044 | +// - returns a generator producing sequences with elements from |
4045 | +// a C-style array. |
4046 | +// ValuesIn(const Container& container) |
4047 | +// - returns a generator producing sequences with elements from |
4048 | +// an STL-style container. |
4049 | +// ValuesIn(Iterator begin, Iterator end) |
4050 | +// - returns a generator producing sequences with elements from |
4051 | +// a range [begin, end) defined by a pair of STL-style iterators. These |
4052 | +// iterators can also be plain C pointers. |
4053 | +// |
4054 | +// Please note that ValuesIn copies the values from the containers |
4055 | +// passed in and keeps them to generate tests in RUN_ALL_TESTS(). |
4056 | +// |
4057 | +// Examples: |
4058 | +// |
4059 | +// This instantiates tests from test case StringTest |
4060 | +// each with C-string values of "foo", "bar", and "baz": |
4061 | +// |
4062 | +// const char* strings[] = {"foo", "bar", "baz"}; |
4063 | +// INSTANTIATE_TEST_CASE_P(StringSequence, SrtingTest, ValuesIn(strings)); |
4064 | +// |
4065 | +// This instantiates tests from test case StlStringTest |
4066 | +// each with STL strings with values "a" and "b": |
4067 | +// |
4068 | +// ::std::vector< ::std::string> GetParameterStrings() { |
4069 | +// ::std::vector< ::std::string> v; |
4070 | +// v.push_back("a"); |
4071 | +// v.push_back("b"); |
4072 | +// return v; |
4073 | +// } |
4074 | +// |
4075 | +// INSTANTIATE_TEST_CASE_P(CharSequence, |
4076 | +// StlStringTest, |
4077 | +// ValuesIn(GetParameterStrings())); |
4078 | +// |
4079 | +// |
4080 | +// This will also instantiate tests from CharTest |
4081 | +// each with parameter values 'a' and 'b': |
4082 | +// |
4083 | +// ::std::list<char> GetParameterChars() { |
4084 | +// ::std::list<char> list; |
4085 | +// list.push_back('a'); |
4086 | +// list.push_back('b'); |
4087 | +// return list; |
4088 | +// } |
4089 | +// ::std::list<char> l = GetParameterChars(); |
4090 | +// INSTANTIATE_TEST_CASE_P(CharSequence2, |
4091 | +// CharTest, |
4092 | +// ValuesIn(l.begin(), l.end())); |
4093 | +// |
4094 | +template <typename ForwardIterator> |
4095 | +internal::ParamGenerator< |
4096 | + typename ::testing::internal::IteratorTraits<ForwardIterator>::value_type> |
4097 | +ValuesIn(ForwardIterator begin, ForwardIterator end) { |
4098 | + typedef typename ::testing::internal::IteratorTraits<ForwardIterator> |
4099 | + ::value_type ParamType; |
4100 | + return internal::ParamGenerator<ParamType>( |
4101 | + new internal::ValuesInIteratorRangeGenerator<ParamType>(begin, end)); |
4102 | +} |
4103 | + |
4104 | +template <typename T, size_t N> |
4105 | +internal::ParamGenerator<T> ValuesIn(const T (&array)[N]) { |
4106 | + return ValuesIn(array, array + N); |
4107 | +} |
4108 | + |
4109 | +template <class Container> |
4110 | +internal::ParamGenerator<typename Container::value_type> ValuesIn( |
4111 | + const Container& container) { |
4112 | + return ValuesIn(container.begin(), container.end()); |
4113 | +} |
4114 | + |
4115 | +// Values() allows generating tests from explicitly specified list of |
4116 | +// parameters. |
4117 | +// |
4118 | +// Synopsis: |
4119 | +// Values(T v1, T v2, ..., T vN) |
4120 | +// - returns a generator producing sequences with elements v1, v2, ..., vN. |
4121 | +// |
4122 | +// For example, this instantiates tests from test case BarTest each |
4123 | +// with values "one", "two", and "three": |
4124 | +// |
4125 | +// INSTANTIATE_TEST_CASE_P(NumSequence, BarTest, Values("one", "two", "three")); |
4126 | +// |
4127 | +// This instantiates tests from test case BazTest each with values 1, 2, 3.5. |
4128 | +// The exact type of values will depend on the type of parameter in BazTest. |
4129 | +// |
4130 | +// INSTANTIATE_TEST_CASE_P(FloatingNumbers, BazTest, Values(1, 2, 3.5)); |
4131 | +// |
4132 | +// Currently, Values() supports from 1 to $n parameters. |
4133 | +// |
4134 | +$range i 1..n |
4135 | +$for i [[ |
4136 | +$range j 1..i |
4137 | + |
4138 | +template <$for j, [[typename T$j]]> |
4139 | +internal::ValueArray$i<$for j, [[T$j]]> Values($for j, [[T$j v$j]]) { |
4140 | + return internal::ValueArray$i<$for j, [[T$j]]>($for j, [[v$j]]); |
4141 | +} |
4142 | + |
4143 | +]] |
4144 | + |
4145 | +// Bool() allows generating tests with parameters in a set of (false, true). |
4146 | +// |
4147 | +// Synopsis: |
4148 | +// Bool() |
4149 | +// - returns a generator producing sequences with elements {false, true}. |
4150 | +// |
4151 | +// It is useful when testing code that depends on Boolean flags. Combinations |
4152 | +// of multiple flags can be tested when several Bool()'s are combined using |
4153 | +// Combine() function. |
4154 | +// |
4155 | +// In the following example all tests in the test case FlagDependentTest |
4156 | +// will be instantiated twice with parameters false and true. |
4157 | +// |
4158 | +// class FlagDependentTest : public testing::TestWithParam<bool> { |
4159 | +// virtual void SetUp() { |
4160 | +// external_flag = GetParam(); |
4161 | +// } |
4162 | +// } |
4163 | +// INSTANTIATE_TEST_CASE_P(BoolSequence, FlagDependentTest, Bool()); |
4164 | +// |
4165 | +inline internal::ParamGenerator<bool> Bool() { |
4166 | + return Values(false, true); |
4167 | +} |
4168 | + |
4169 | +# if GTEST_HAS_COMBINE |
4170 | +// Combine() allows the user to combine two or more sequences to produce |
4171 | +// values of a Cartesian product of those sequences' elements. |
4172 | +// |
4173 | +// Synopsis: |
4174 | +// Combine(gen1, gen2, ..., genN) |
4175 | +// - returns a generator producing sequences with elements coming from |
4176 | +// the Cartesian product of elements from the sequences generated by |
4177 | +// gen1, gen2, ..., genN. The sequence elements will have a type of |
4178 | +// tuple<T1, T2, ..., TN> where T1, T2, ..., TN are the types |
4179 | +// of elements from sequences produces by gen1, gen2, ..., genN. |
4180 | +// |
4181 | +// Combine can have up to $maxtuple arguments. This number is currently limited |
4182 | +// by the maximum number of elements in the tuple implementation used by Google |
4183 | +// Test. |
4184 | +// |
4185 | +// Example: |
4186 | +// |
4187 | +// This will instantiate tests in test case AnimalTest each one with |
4188 | +// the parameter values tuple("cat", BLACK), tuple("cat", WHITE), |
4189 | +// tuple("dog", BLACK), and tuple("dog", WHITE): |
4190 | +// |
4191 | +// enum Color { BLACK, GRAY, WHITE }; |
4192 | +// class AnimalTest |
4193 | +// : public testing::TestWithParam<tuple<const char*, Color> > {...}; |
4194 | +// |
4195 | +// TEST_P(AnimalTest, AnimalLooksNice) {...} |
4196 | +// |
4197 | +// INSTANTIATE_TEST_CASE_P(AnimalVariations, AnimalTest, |
4198 | +// Combine(Values("cat", "dog"), |
4199 | +// Values(BLACK, WHITE))); |
4200 | +// |
4201 | +// This will instantiate tests in FlagDependentTest with all variations of two |
4202 | +// Boolean flags: |
4203 | +// |
4204 | +// class FlagDependentTest |
4205 | +// : public testing::TestWithParam<tuple<bool, bool> > { |
4206 | +// virtual void SetUp() { |
4207 | +// // Assigns external_flag_1 and external_flag_2 values from the tuple. |
4208 | +// tie(external_flag_1, external_flag_2) = GetParam(); |
4209 | +// } |
4210 | +// }; |
4211 | +// |
4212 | +// TEST_P(FlagDependentTest, TestFeature1) { |
4213 | +// // Test your code using external_flag_1 and external_flag_2 here. |
4214 | +// } |
4215 | +// INSTANTIATE_TEST_CASE_P(TwoBoolSequence, FlagDependentTest, |
4216 | +// Combine(Bool(), Bool())); |
4217 | +// |
4218 | +$range i 2..maxtuple |
4219 | +$for i [[ |
4220 | +$range j 1..i |
4221 | + |
4222 | +template <$for j, [[typename Generator$j]]> |
4223 | +internal::CartesianProductHolder$i<$for j, [[Generator$j]]> Combine( |
4224 | + $for j, [[const Generator$j& g$j]]) { |
4225 | + return internal::CartesianProductHolder$i<$for j, [[Generator$j]]>( |
4226 | + $for j, [[g$j]]); |
4227 | +} |
4228 | + |
4229 | +]] |
4230 | +# endif // GTEST_HAS_COMBINE |
4231 | + |
4232 | + |
4233 | + |
4234 | +# define TEST_P(test_case_name, test_name) \ |
4235 | + class GTEST_TEST_CLASS_NAME_(test_case_name, test_name) \ |
4236 | + : public test_case_name { \ |
4237 | + public: \ |
4238 | + GTEST_TEST_CLASS_NAME_(test_case_name, test_name)() {} \ |
4239 | + virtual void TestBody(); \ |
4240 | + private: \ |
4241 | + static int AddToRegistry() { \ |
4242 | + ::testing::UnitTest::GetInstance()->parameterized_test_registry(). \ |
4243 | + GetTestCasePatternHolder<test_case_name>(\ |
4244 | + #test_case_name, __FILE__, __LINE__)->AddTestPattern(\ |
4245 | + #test_case_name, \ |
4246 | + #test_name, \ |
4247 | + new ::testing::internal::TestMetaFactory< \ |
4248 | + GTEST_TEST_CLASS_NAME_(test_case_name, test_name)>()); \ |
4249 | + return 0; \ |
4250 | + } \ |
4251 | + static int gtest_registering_dummy_; \ |
4252 | + GTEST_DISALLOW_COPY_AND_ASSIGN_(\ |
4253 | + GTEST_TEST_CLASS_NAME_(test_case_name, test_name)); \ |
4254 | + }; \ |
4255 | + int GTEST_TEST_CLASS_NAME_(test_case_name, \ |
4256 | + test_name)::gtest_registering_dummy_ = \ |
4257 | + GTEST_TEST_CLASS_NAME_(test_case_name, test_name)::AddToRegistry(); \ |
4258 | + void GTEST_TEST_CLASS_NAME_(test_case_name, test_name)::TestBody() |
4259 | + |
4260 | +# define INSTANTIATE_TEST_CASE_P(prefix, test_case_name, generator) \ |
4261 | + ::testing::internal::ParamGenerator<test_case_name::ParamType> \ |
4262 | + gtest_##prefix##test_case_name##_EvalGenerator_() { return generator; } \ |
4263 | + int gtest_##prefix##test_case_name##_dummy_ = \ |
4264 | + ::testing::UnitTest::GetInstance()->parameterized_test_registry(). \ |
4265 | + GetTestCasePatternHolder<test_case_name>(\ |
4266 | + #test_case_name, __FILE__, __LINE__)->AddTestCaseInstantiation(\ |
4267 | + #prefix, \ |
4268 | + >est_##prefix##test_case_name##_EvalGenerator_, \ |
4269 | + __FILE__, __LINE__) |
4270 | + |
4271 | +} // namespace testing |
4272 | + |
4273 | +#endif // GTEST_HAS_PARAM_TEST |
4274 | + |
4275 | +#endif // GTEST_INCLUDE_GTEST_GTEST_PARAM_TEST_H_ |
4276 | |
4277 | === added file '3rd_party/gmock/gtest/include/gtest/gtest-printers.h' |
4278 | --- 3rd_party/gmock/gtest/include/gtest/gtest-printers.h 1970-01-01 00:00:00 +0000 |
4279 | +++ 3rd_party/gmock/gtest/include/gtest/gtest-printers.h 2014-04-08 15:07:37 +0000 |
4280 | @@ -0,0 +1,855 @@ |
4281 | +// Copyright 2007, Google Inc. |
4282 | +// All rights reserved. |
4283 | +// |
4284 | +// Redistribution and use in source and binary forms, with or without |
4285 | +// modification, are permitted provided that the following conditions are |
4286 | +// met: |
4287 | +// |
4288 | +// * Redistributions of source code must retain the above copyright |
4289 | +// notice, this list of conditions and the following disclaimer. |
4290 | +// * Redistributions in binary form must reproduce the above |
4291 | +// copyright notice, this list of conditions and the following disclaimer |
4292 | +// in the documentation and/or other materials provided with the |
4293 | +// distribution. |
4294 | +// * Neither the name of Google Inc. nor the names of its |
4295 | +// contributors may be used to endorse or promote products derived from |
4296 | +// this software without specific prior written permission. |
4297 | +// |
4298 | +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS |
4299 | +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT |
4300 | +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR |
4301 | +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT |
4302 | +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, |
4303 | +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT |
4304 | +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
4305 | +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
4306 | +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
4307 | +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
4308 | +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
4309 | +// |
4310 | +// Author: wan@google.com (Zhanyong Wan) |
4311 | + |
4312 | +// Google Test - The Google C++ Testing Framework |
4313 | +// |
4314 | +// This file implements a universal value printer that can print a |
4315 | +// value of any type T: |
4316 | +// |
4317 | +// void ::testing::internal::UniversalPrinter<T>::Print(value, ostream_ptr); |
4318 | +// |
4319 | +// A user can teach this function how to print a class type T by |
4320 | +// defining either operator<<() or PrintTo() in the namespace that |
4321 | +// defines T. More specifically, the FIRST defined function in the |
4322 | +// following list will be used (assuming T is defined in namespace |
4323 | +// foo): |
4324 | +// |
4325 | +// 1. foo::PrintTo(const T&, ostream*) |
4326 | +// 2. operator<<(ostream&, const T&) defined in either foo or the |
4327 | +// global namespace. |
4328 | +// |
4329 | +// If none of the above is defined, it will print the debug string of |
4330 | +// the value if it is a protocol buffer, or print the raw bytes in the |
4331 | +// value otherwise. |
4332 | +// |
4333 | +// To aid debugging: when T is a reference type, the address of the |
4334 | +// value is also printed; when T is a (const) char pointer, both the |
4335 | +// pointer value and the NUL-terminated string it points to are |
4336 | +// printed. |
4337 | +// |
4338 | +// We also provide some convenient wrappers: |
4339 | +// |
4340 | +// // Prints a value to a string. For a (const or not) char |
4341 | +// // pointer, the NUL-terminated string (but not the pointer) is |
4342 | +// // printed. |
4343 | +// std::string ::testing::PrintToString(const T& value); |
4344 | +// |
4345 | +// // Prints a value tersely: for a reference type, the referenced |
4346 | +// // value (but not the address) is printed; for a (const or not) char |
4347 | +// // pointer, the NUL-terminated string (but not the pointer) is |
4348 | +// // printed. |
4349 | +// void ::testing::internal::UniversalTersePrint(const T& value, ostream*); |
4350 | +// |
4351 | +// // Prints value using the type inferred by the compiler. The difference |
4352 | +// // from UniversalTersePrint() is that this function prints both the |
4353 | +// // pointer and the NUL-terminated string for a (const or not) char pointer. |
4354 | +// void ::testing::internal::UniversalPrint(const T& value, ostream*); |
4355 | +// |
4356 | +// // Prints the fields of a tuple tersely to a string vector, one |
4357 | +// // element for each field. Tuple support must be enabled in |
4358 | +// // gtest-port.h. |
4359 | +// std::vector<string> UniversalTersePrintTupleFieldsToStrings( |
4360 | +// const Tuple& value); |
4361 | +// |
4362 | +// Known limitation: |
4363 | +// |
4364 | +// The print primitives print the elements of an STL-style container |
4365 | +// using the compiler-inferred type of *iter where iter is a |
4366 | +// const_iterator of the container. When const_iterator is an input |
4367 | +// iterator but not a forward iterator, this inferred type may not |
4368 | +// match value_type, and the print output may be incorrect. In |
4369 | +// practice, this is rarely a problem as for most containers |
4370 | +// const_iterator is a forward iterator. We'll fix this if there's an |
4371 | +// actual need for it. Note that this fix cannot rely on value_type |
4372 | +// being defined as many user-defined container types don't have |
4373 | +// value_type. |
4374 | + |
4375 | +#ifndef GTEST_INCLUDE_GTEST_GTEST_PRINTERS_H_ |
4376 | +#define GTEST_INCLUDE_GTEST_GTEST_PRINTERS_H_ |
4377 | + |
4378 | +#include <ostream> // NOLINT |
4379 | +#include <sstream> |
4380 | +#include <string> |
4381 | +#include <utility> |
4382 | +#include <vector> |
4383 | +#include "gtest/internal/gtest-port.h" |
4384 | +#include "gtest/internal/gtest-internal.h" |
4385 | + |
4386 | +namespace testing { |
4387 | + |
4388 | +// Definitions in the 'internal' and 'internal2' name spaces are |
4389 | +// subject to change without notice. DO NOT USE THEM IN USER CODE! |
4390 | +namespace internal2 { |
4391 | + |
4392 | +// Prints the given number of bytes in the given object to the given |
4393 | +// ostream. |
4394 | +GTEST_API_ void PrintBytesInObjectTo(const unsigned char* obj_bytes, |
4395 | + size_t count, |
4396 | + ::std::ostream* os); |
4397 | + |
4398 | +// For selecting which printer to use when a given type has neither << |
4399 | +// nor PrintTo(). |
4400 | +enum TypeKind { |
4401 | + kProtobuf, // a protobuf type |
4402 | + kConvertibleToInteger, // a type implicitly convertible to BiggestInt |
4403 | + // (e.g. a named or unnamed enum type) |
4404 | + kOtherType // anything else |
4405 | +}; |
4406 | + |
4407 | +// TypeWithoutFormatter<T, kTypeKind>::PrintValue(value, os) is called |
4408 | +// by the universal printer to print a value of type T when neither |
4409 | +// operator<< nor PrintTo() is defined for T, where kTypeKind is the |
4410 | +// "kind" of T as defined by enum TypeKind. |
4411 | +template <typename T, TypeKind kTypeKind> |
4412 | +class TypeWithoutFormatter { |
4413 | + public: |
4414 | + // This default version is called when kTypeKind is kOtherType. |
4415 | + static void PrintValue(const T& value, ::std::ostream* os) { |
4416 | + PrintBytesInObjectTo(reinterpret_cast<const unsigned char*>(&value), |
4417 | + sizeof(value), os); |
4418 | + } |
4419 | +}; |
4420 | + |
4421 | +// We print a protobuf using its ShortDebugString() when the string |
4422 | +// doesn't exceed this many characters; otherwise we print it using |
4423 | +// DebugString() for better readability. |
4424 | +const size_t kProtobufOneLinerMaxLength = 50; |
4425 | + |
4426 | +template <typename T> |
4427 | +class TypeWithoutFormatter<T, kProtobuf> { |
4428 | + public: |
4429 | + static void PrintValue(const T& value, ::std::ostream* os) { |
4430 | + const ::testing::internal::string short_str = value.ShortDebugString(); |
4431 | + const ::testing::internal::string pretty_str = |
4432 | + short_str.length() <= kProtobufOneLinerMaxLength ? |
4433 | + short_str : ("\n" + value.DebugString()); |
4434 | + *os << ("<" + pretty_str + ">"); |
4435 | + } |
4436 | +}; |
4437 | + |
4438 | +template <typename T> |
4439 | +class TypeWithoutFormatter<T, kConvertibleToInteger> { |
4440 | + public: |
4441 | + // Since T has no << operator or PrintTo() but can be implicitly |
4442 | + // converted to BiggestInt, we print it as a BiggestInt. |
4443 | + // |
4444 | + // Most likely T is an enum type (either named or unnamed), in which |
4445 | + // case printing it as an integer is the desired behavior. In case |
4446 | + // T is not an enum, printing it as an integer is the best we can do |
4447 | + // given that it has no user-defined printer. |
4448 | + static void PrintValue(const T& value, ::std::ostream* os) { |
4449 | + const internal::BiggestInt kBigInt = value; |
4450 | + *os << kBigInt; |
4451 | + } |
4452 | +}; |
4453 | + |
4454 | +// Prints the given value to the given ostream. If the value is a |
4455 | +// protocol message, its debug string is printed; if it's an enum or |
4456 | +// of a type implicitly convertible to BiggestInt, it's printed as an |
4457 | +// integer; otherwise the bytes in the value are printed. This is |
4458 | +// what UniversalPrinter<T>::Print() does when it knows nothing about |
4459 | +// type T and T has neither << operator nor PrintTo(). |
4460 | +// |
4461 | +// A user can override this behavior for a class type Foo by defining |
4462 | +// a << operator in the namespace where Foo is defined. |
4463 | +// |
4464 | +// We put this operator in namespace 'internal2' instead of 'internal' |
4465 | +// to simplify the implementation, as much code in 'internal' needs to |
4466 | +// use << in STL, which would conflict with our own << were it defined |
4467 | +// in 'internal'. |
4468 | +// |
4469 | +// Note that this operator<< takes a generic std::basic_ostream<Char, |
4470 | +// CharTraits> type instead of the more restricted std::ostream. If |
4471 | +// we define it to take an std::ostream instead, we'll get an |
4472 | +// "ambiguous overloads" compiler error when trying to print a type |
4473 | +// Foo that supports streaming to std::basic_ostream<Char, |
4474 | +// CharTraits>, as the compiler cannot tell whether |
4475 | +// operator<<(std::ostream&, const T&) or |
4476 | +// operator<<(std::basic_stream<Char, CharTraits>, const Foo&) is more |
4477 | +// specific. |
4478 | +template <typename Char, typename CharTraits, typename T> |
4479 | +::std::basic_ostream<Char, CharTraits>& operator<<( |
4480 | + ::std::basic_ostream<Char, CharTraits>& os, const T& x) { |
4481 | + TypeWithoutFormatter<T, |
4482 | + (internal::IsAProtocolMessage<T>::value ? kProtobuf : |
4483 | + internal::ImplicitlyConvertible<const T&, internal::BiggestInt>::value ? |
4484 | + kConvertibleToInteger : kOtherType)>::PrintValue(x, &os); |
4485 | + return os; |
4486 | +} |
4487 | + |
4488 | +} // namespace internal2 |
4489 | +} // namespace testing |
4490 | + |
4491 | +// This namespace MUST NOT BE NESTED IN ::testing, or the name look-up |
4492 | +// magic needed for implementing UniversalPrinter won't work. |
4493 | +namespace testing_internal { |
4494 | + |
4495 | +// Used to print a value that is not an STL-style container when the |
4496 | +// user doesn't define PrintTo() for it. |
4497 | +template <typename T> |
4498 | +void DefaultPrintNonContainerTo(const T& value, ::std::ostream* os) { |
4499 | + // With the following statement, during unqualified name lookup, |
4500 | + // testing::internal2::operator<< appears as if it was declared in |
4501 | + // the nearest enclosing namespace that contains both |
4502 | + // ::testing_internal and ::testing::internal2, i.e. the global |
4503 | + // namespace. For more details, refer to the C++ Standard section |
4504 | + // 7.3.4-1 [namespace.udir]. This allows us to fall back onto |
4505 | + // testing::internal2::operator<< in case T doesn't come with a << |
4506 | + // operator. |
4507 | + // |
4508 | + // We cannot write 'using ::testing::internal2::operator<<;', which |
4509 | + // gcc 3.3 fails to compile due to a compiler bug. |
4510 | + using namespace ::testing::internal2; // NOLINT |
4511 | + |
4512 | + // Assuming T is defined in namespace foo, in the next statement, |
4513 | + // the compiler will consider all of: |
4514 | + // |
4515 | + // 1. foo::operator<< (thanks to Koenig look-up), |
4516 | + // 2. ::operator<< (as the current namespace is enclosed in ::), |
4517 | + // 3. testing::internal2::operator<< (thanks to the using statement above). |
4518 | + // |
4519 | + // The operator<< whose type matches T best will be picked. |
4520 | + // |
4521 | + // We deliberately allow #2 to be a candidate, as sometimes it's |
4522 | + // impossible to define #1 (e.g. when foo is ::std, defining |
4523 | + // anything in it is undefined behavior unless you are a compiler |
4524 | + // vendor.). |
4525 | + *os << value; |
4526 | +} |
4527 | + |
4528 | +} // namespace testing_internal |
4529 | + |
4530 | +namespace testing { |
4531 | +namespace internal { |
4532 | + |
4533 | +// UniversalPrinter<T>::Print(value, ostream_ptr) prints the given |
4534 | +// value to the given ostream. The caller must ensure that |
4535 | +// 'ostream_ptr' is not NULL, or the behavior is undefined. |
4536 | +// |
4537 | +// We define UniversalPrinter as a class template (as opposed to a |
4538 | +// function template), as we need to partially specialize it for |
4539 | +// reference types, which cannot be done with function templates. |
4540 | +template <typename T> |
4541 | +class UniversalPrinter; |
4542 | + |
4543 | +template <typename T> |
4544 | +void UniversalPrint(const T& value, ::std::ostream* os); |
4545 | + |
4546 | +// Used to print an STL-style container when the user doesn't define |
4547 | +// a PrintTo() for it. |
4548 | +template <typename C> |
4549 | +void DefaultPrintTo(IsContainer /* dummy */, |
4550 | + false_type /* is not a pointer */, |
4551 | + const C& container, ::std::ostream* os) { |
4552 | + const size_t kMaxCount = 32; // The maximum number of elements to print. |
4553 | + *os << '{'; |
4554 | + size_t count = 0; |
4555 | + for (typename C::const_iterator it = container.begin(); |
4556 | + it != container.end(); ++it, ++count) { |
4557 | + if (count > 0) { |
4558 | + *os << ','; |
4559 | + if (count == kMaxCount) { // Enough has been printed. |
4560 | + *os << " ..."; |
4561 | + break; |
4562 | + } |
4563 | + } |
4564 | + *os << ' '; |
4565 | + // We cannot call PrintTo(*it, os) here as PrintTo() doesn't |
4566 | + // handle *it being a native array. |
4567 | + internal::UniversalPrint(*it, os); |
4568 | + } |
4569 | + |
4570 | + if (count > 0) { |
4571 | + *os << ' '; |
4572 | + } |
4573 | + *os << '}'; |
4574 | +} |
4575 | + |
4576 | +// Used to print a pointer that is neither a char pointer nor a member |
4577 | +// pointer, when the user doesn't define PrintTo() for it. (A member |
4578 | +// variable pointer or member function pointer doesn't really point to |
4579 | +// a location in the address space. Their representation is |
4580 | +// implementation-defined. Therefore they will be printed as raw |
4581 | +// bytes.) |
4582 | +template <typename T> |
4583 | +void DefaultPrintTo(IsNotContainer /* dummy */, |
4584 | + true_type /* is a pointer */, |
4585 | + T* p, ::std::ostream* os) { |
4586 | + if (p == NULL) { |
4587 | + *os << "NULL"; |
4588 | + } else { |
4589 | + // C++ doesn't allow casting from a function pointer to any object |
4590 | + // pointer. |
4591 | + // |
4592 | + // IsTrue() silences warnings: "Condition is always true", |
4593 | + // "unreachable code". |
4594 | + if (IsTrue(ImplicitlyConvertible<T*, const void*>::value)) { |
4595 | + // T is not a function type. We just call << to print p, |
4596 | + // relying on ADL to pick up user-defined << for their pointer |
4597 | + // types, if any. |
4598 | + *os << p; |
4599 | + } else { |
4600 | + // T is a function type, so '*os << p' doesn't do what we want |
4601 | + // (it just prints p as bool). We want to print p as a const |
4602 | + // void*. However, we cannot cast it to const void* directly, |
4603 | + // even using reinterpret_cast, as earlier versions of gcc |
4604 | + // (e.g. 3.4.5) cannot compile the cast when p is a function |
4605 | + // pointer. Casting to UInt64 first solves the problem. |
4606 | + *os << reinterpret_cast<const void*>( |
4607 | + reinterpret_cast<internal::UInt64>(p)); |
4608 | + } |
4609 | + } |
4610 | +} |
4611 | + |
4612 | +// Used to print a non-container, non-pointer value when the user |
4613 | +// doesn't define PrintTo() for it. |
4614 | +template <typename T> |
4615 | +void DefaultPrintTo(IsNotContainer /* dummy */, |
4616 | + false_type /* is not a pointer */, |
4617 | + const T& value, ::std::ostream* os) { |
4618 | + ::testing_internal::DefaultPrintNonContainerTo(value, os); |
4619 | +} |
4620 | + |
4621 | +// Prints the given value using the << operator if it has one; |
4622 | +// otherwise prints the bytes in it. This is what |
4623 | +// UniversalPrinter<T>::Print() does when PrintTo() is not specialized |
4624 | +// or overloaded for type T. |
4625 | +// |
4626 | +// A user can override this behavior for a class type Foo by defining |
4627 | +// an overload of PrintTo() in the namespace where Foo is defined. We |
4628 | +// give the user this option as sometimes defining a << operator for |
4629 | +// Foo is not desirable (e.g. the coding style may prevent doing it, |
4630 | +// or there is already a << operator but it doesn't do what the user |
4631 | +// wants). |
4632 | +template <typename T> |
4633 | +void PrintTo(const T& value, ::std::ostream* os) { |
4634 | + // DefaultPrintTo() is overloaded. The type of its first two |
4635 | + // arguments determine which version will be picked. If T is an |
4636 | + // STL-style container, the version for container will be called; if |
4637 | + // T is a pointer, the pointer version will be called; otherwise the |
4638 | + // generic version will be called. |
4639 | + // |
4640 | + // Note that we check for container types here, prior to we check |
4641 | + // for protocol message types in our operator<<. The rationale is: |
4642 | + // |
4643 | + // For protocol messages, we want to give people a chance to |
4644 | + // override Google Mock's format by defining a PrintTo() or |
4645 | + // operator<<. For STL containers, other formats can be |
4646 | + // incompatible with Google Mock's format for the container |
4647 | + // elements; therefore we check for container types here to ensure |
4648 | + // that our format is used. |
4649 | + // |
4650 | + // The second argument of DefaultPrintTo() is needed to bypass a bug |
4651 | + // in Symbian's C++ compiler that prevents it from picking the right |
4652 | + // overload between: |
4653 | + // |
4654 | + // PrintTo(const T& x, ...); |
4655 | + // PrintTo(T* x, ...); |
4656 | + DefaultPrintTo(IsContainerTest<T>(0), is_pointer<T>(), value, os); |
4657 | +} |
4658 | + |
4659 | +// The following list of PrintTo() overloads tells |
4660 | +// UniversalPrinter<T>::Print() how to print standard types (built-in |
4661 | +// types, strings, plain arrays, and pointers). |
4662 | + |
4663 | +// Overloads for various char types. |
4664 | +GTEST_API_ void PrintTo(unsigned char c, ::std::ostream* os); |
4665 | +GTEST_API_ void PrintTo(signed char c, ::std::ostream* os); |
4666 | +inline void PrintTo(char c, ::std::ostream* os) { |
4667 | + // When printing a plain char, we always treat it as unsigned. This |
4668 | + // way, the output won't be affected by whether the compiler thinks |
4669 | + // char is signed or not. |
4670 | + PrintTo(static_cast<unsigned char>(c), os); |
4671 | +} |
4672 | + |
4673 | +// Overloads for other simple built-in types. |
4674 | +inline void PrintTo(bool x, ::std::ostream* os) { |
4675 | + *os << (x ? "true" : "false"); |
4676 | +} |
4677 | + |
4678 | +// Overload for wchar_t type. |
4679 | +// Prints a wchar_t as a symbol if it is printable or as its internal |
4680 | +// code otherwise and also as its decimal code (except for L'\0'). |
4681 | +// The L'\0' char is printed as "L'\\0'". The decimal code is printed |
4682 | +// as signed integer when wchar_t is implemented by the compiler |
4683 | +// as a signed type and is printed as an unsigned integer when wchar_t |
4684 | +// is implemented as an unsigned type. |
4685 | +GTEST_API_ void PrintTo(wchar_t wc, ::std::ostream* os); |
4686 | + |
4687 | +// Overloads for C strings. |
4688 | +GTEST_API_ void PrintTo(const char* s, ::std::ostream* os); |
4689 | +inline void PrintTo(char* s, ::std::ostream* os) { |
4690 | + PrintTo(ImplicitCast_<const char*>(s), os); |
4691 | +} |
4692 | + |
4693 | +// signed/unsigned char is often used for representing binary data, so |
4694 | +// we print pointers to it as void* to be safe. |
4695 | +inline void PrintTo(const signed char* s, ::std::ostream* os) { |
4696 | + PrintTo(ImplicitCast_<const void*>(s), os); |
4697 | +} |
4698 | +inline void PrintTo(signed char* s, ::std::ostream* os) { |
4699 | + PrintTo(ImplicitCast_<const void*>(s), os); |
4700 | +} |
4701 | +inline void PrintTo(const unsigned char* s, ::std::ostream* os) { |
4702 | + PrintTo(ImplicitCast_<const void*>(s), os); |
4703 | +} |
4704 | +inline void PrintTo(unsigned char* s, ::std::ostream* os) { |
4705 | + PrintTo(ImplicitCast_<const void*>(s), os); |
4706 | +} |
4707 | + |
4708 | +// MSVC can be configured to define wchar_t as a typedef of unsigned |
4709 | +// short. It defines _NATIVE_WCHAR_T_DEFINED when wchar_t is a native |
4710 | +// type. When wchar_t is a typedef, defining an overload for const |
4711 | +// wchar_t* would cause unsigned short* be printed as a wide string, |
4712 | +// possibly causing invalid memory accesses. |
4713 | +#if !defined(_MSC_VER) || defined(_NATIVE_WCHAR_T_DEFINED) |
4714 | +// Overloads for wide C strings |
4715 | +GTEST_API_ void PrintTo(const wchar_t* s, ::std::ostream* os); |
4716 | +inline void PrintTo(wchar_t* s, ::std::ostream* os) { |
4717 | + PrintTo(ImplicitCast_<const wchar_t*>(s), os); |
4718 | +} |
4719 | +#endif |
4720 | + |
4721 | +// Overload for C arrays. Multi-dimensional arrays are printed |
4722 | +// properly. |
4723 | + |
4724 | +// Prints the given number of elements in an array, without printing |
4725 | +// the curly braces. |
4726 | +template <typename T> |
4727 | +void PrintRawArrayTo(const T a[], size_t count, ::std::ostream* os) { |
4728 | + UniversalPrint(a[0], os); |
4729 | + for (size_t i = 1; i != count; i++) { |
4730 | + *os << ", "; |
4731 | + UniversalPrint(a[i], os); |
4732 | + } |
4733 | +} |
4734 | + |
4735 | +// Overloads for ::string and ::std::string. |
4736 | +#if GTEST_HAS_GLOBAL_STRING |
4737 | +GTEST_API_ void PrintStringTo(const ::string&s, ::std::ostream* os); |
4738 | +inline void PrintTo(const ::string& s, ::std::ostream* os) { |
4739 | + PrintStringTo(s, os); |
4740 | +} |
4741 | +#endif // GTEST_HAS_GLOBAL_STRING |
4742 | + |
4743 | +GTEST_API_ void PrintStringTo(const ::std::string&s, ::std::ostream* os); |
4744 | +inline void PrintTo(const ::std::string& s, ::std::ostream* os) { |
4745 | + PrintStringTo(s, os); |
4746 | +} |
4747 | + |
4748 | +// Overloads for ::wstring and ::std::wstring. |
4749 | +#if GTEST_HAS_GLOBAL_WSTRING |
4750 | +GTEST_API_ void PrintWideStringTo(const ::wstring&s, ::std::ostream* os); |
4751 | +inline void PrintTo(const ::wstring& s, ::std::ostream* os) { |
4752 | + PrintWideStringTo(s, os); |
4753 | +} |
4754 | +#endif // GTEST_HAS_GLOBAL_WSTRING |
4755 | + |
4756 | +#if GTEST_HAS_STD_WSTRING |
4757 | +GTEST_API_ void PrintWideStringTo(const ::std::wstring&s, ::std::ostream* os); |
4758 | +inline void PrintTo(const ::std::wstring& s, ::std::ostream* os) { |
4759 | + PrintWideStringTo(s, os); |
4760 | +} |
4761 | +#endif // GTEST_HAS_STD_WSTRING |
4762 | + |
4763 | +#if GTEST_HAS_TR1_TUPLE |
4764 | +// Overload for ::std::tr1::tuple. Needed for printing function arguments, |
4765 | +// which are packed as tuples. |
4766 | + |
4767 | +// Helper function for printing a tuple. T must be instantiated with |
4768 | +// a tuple type. |
4769 | +template <typename T> |
4770 | +void PrintTupleTo(const T& t, ::std::ostream* os); |
4771 | + |
4772 | +// Overloaded PrintTo() for tuples of various arities. We support |
4773 | +// tuples of up-to 10 fields. The following implementation works |
4774 | +// regardless of whether tr1::tuple is implemented using the |
4775 | +// non-standard variadic template feature or not. |
4776 | + |
4777 | +inline void PrintTo(const ::std::tr1::tuple<>& t, ::std::ostream* os) { |
4778 | + PrintTupleTo(t, os); |
4779 | +} |
4780 | + |
4781 | +template <typename T1> |
4782 | +void PrintTo(const ::std::tr1::tuple<T1>& t, ::std::ostream* os) { |
4783 | + PrintTupleTo(t, os); |
4784 | +} |
4785 | + |
4786 | +template <typename T1, typename T2> |
4787 | +void PrintTo(const ::std::tr1::tuple<T1, T2>& t, ::std::ostream* os) { |
4788 | + PrintTupleTo(t, os); |
4789 | +} |
4790 | + |
4791 | +template <typename T1, typename T2, typename T3> |
4792 | +void PrintTo(const ::std::tr1::tuple<T1, T2, T3>& t, ::std::ostream* os) { |
4793 | + PrintTupleTo(t, os); |
4794 | +} |
4795 | + |
4796 | +template <typename T1, typename T2, typename T3, typename T4> |
4797 | +void PrintTo(const ::std::tr1::tuple<T1, T2, T3, T4>& t, ::std::ostream* os) { |
4798 | + PrintTupleTo(t, os); |
4799 | +} |
4800 | + |
4801 | +template <typename T1, typename T2, typename T3, typename T4, typename T5> |
4802 | +void PrintTo(const ::std::tr1::tuple<T1, T2, T3, T4, T5>& t, |
4803 | + ::std::ostream* os) { |
4804 | + PrintTupleTo(t, os); |
4805 | +} |
4806 | + |
4807 | +template <typename T1, typename T2, typename T3, typename T4, typename T5, |
4808 | + typename T6> |
4809 | +void PrintTo(const ::std::tr1::tuple<T1, T2, T3, T4, T5, T6>& t, |
4810 | + ::std::ostream* os) { |
4811 | + PrintTupleTo(t, os); |
4812 | +} |
4813 | + |
4814 | +template <typename T1, typename T2, typename T3, typename T4, typename T5, |
4815 | + typename T6, typename T7> |
4816 | +void PrintTo(const ::std::tr1::tuple<T1, T2, T3, T4, T5, T6, T7>& t, |
4817 | + ::std::ostream* os) { |
4818 | + PrintTupleTo(t, os); |
4819 | +} |
4820 | + |
4821 | +template <typename T1, typename T2, typename T3, typename T4, typename T5, |
4822 | + typename T6, typename T7, typename T8> |
4823 | +void PrintTo(const ::std::tr1::tuple<T1, T2, T3, T4, T5, T6, T7, T8>& t, |
4824 | + ::std::ostream* os) { |
4825 | + PrintTupleTo(t, os); |
4826 | +} |
4827 | + |
4828 | +template <typename T1, typename T2, typename T3, typename T4, typename T5, |
4829 | + typename T6, typename T7, typename T8, typename T9> |
4830 | +void PrintTo(const ::std::tr1::tuple<T1, T2, T3, T4, T5, T6, T7, T8, T9>& t, |
4831 | + ::std::ostream* os) { |
4832 | + PrintTupleTo(t, os); |
4833 | +} |
4834 | + |
4835 | +template <typename T1, typename T2, typename T3, typename T4, typename T5, |
4836 | + typename T6, typename T7, typename T8, typename T9, typename T10> |
4837 | +void PrintTo( |
4838 | + const ::std::tr1::tuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>& t, |
4839 | + ::std::ostream* os) { |
4840 | + PrintTupleTo(t, os); |
4841 | +} |
4842 | +#endif // GTEST_HAS_TR1_TUPLE |
4843 | + |
4844 | +// Overload for std::pair. |
4845 | +template <typename T1, typename T2> |
4846 | +void PrintTo(const ::std::pair<T1, T2>& value, ::std::ostream* os) { |
4847 | + *os << '('; |
4848 | + // We cannot use UniversalPrint(value.first, os) here, as T1 may be |
4849 | + // a reference type. The same for printing value.second. |
4850 | + UniversalPrinter<T1>::Print(value.first, os); |
4851 | + *os << ", "; |
4852 | + UniversalPrinter<T2>::Print(value.second, os); |
4853 | + *os << ')'; |
4854 | +} |
4855 | + |
4856 | +// Implements printing a non-reference type T by letting the compiler |
4857 | +// pick the right overload of PrintTo() for T. |
4858 | +template <typename T> |
4859 | +class UniversalPrinter { |
4860 | + public: |
4861 | + // MSVC warns about adding const to a function type, so we want to |
4862 | + // disable the warning. |
4863 | +#ifdef _MSC_VER |
4864 | +# pragma warning(push) // Saves the current warning state. |
4865 | +# pragma warning(disable:4180) // Temporarily disables warning 4180. |
4866 | +#endif // _MSC_VER |
4867 | + |
4868 | + // Note: we deliberately don't call this PrintTo(), as that name |
4869 | + // conflicts with ::testing::internal::PrintTo in the body of the |
4870 | + // function. |
4871 | + static void Print(const T& value, ::std::ostream* os) { |
4872 | + // By default, ::testing::internal::PrintTo() is used for printing |
4873 | + // the value. |
4874 | + // |
4875 | + // Thanks to Koenig look-up, if T is a class and has its own |
4876 | + // PrintTo() function defined in its namespace, that function will |
4877 | + // be visible here. Since it is more specific than the generic ones |
4878 | + // in ::testing::internal, it will be picked by the compiler in the |
4879 | + // following statement - exactly what we want. |
4880 | + PrintTo(value, os); |
4881 | + } |
4882 | + |
4883 | +#ifdef _MSC_VER |
4884 | +# pragma warning(pop) // Restores the warning state. |
4885 | +#endif // _MSC_VER |
4886 | +}; |
4887 | + |
4888 | +// UniversalPrintArray(begin, len, os) prints an array of 'len' |
4889 | +// elements, starting at address 'begin'. |
4890 | +template <typename T> |
4891 | +void UniversalPrintArray(const T* begin, size_t len, ::std::ostream* os) { |
4892 | + if (len == 0) { |
4893 | + *os << "{}"; |
4894 | + } else { |
4895 | + *os << "{ "; |
4896 | + const size_t kThreshold = 18; |
4897 | + const size_t kChunkSize = 8; |
4898 | + // If the array has more than kThreshold elements, we'll have to |
4899 | + // omit some details by printing only the first and the last |
4900 | + // kChunkSize elements. |
4901 | + // TODO(wan@google.com): let the user control the threshold using a flag. |
4902 | + if (len <= kThreshold) { |
4903 | + PrintRawArrayTo(begin, len, os); |
4904 | + } else { |
4905 | + PrintRawArrayTo(begin, kChunkSize, os); |
4906 | + *os << ", ..., "; |
4907 | + PrintRawArrayTo(begin + len - kChunkSize, kChunkSize, os); |
4908 | + } |
4909 | + *os << " }"; |
4910 | + } |
4911 | +} |
4912 | +// This overload prints a (const) char array compactly. |
4913 | +GTEST_API_ void UniversalPrintArray( |
4914 | + const char* begin, size_t len, ::std::ostream* os); |
4915 | + |
4916 | +// This overload prints a (const) wchar_t array compactly. |
4917 | +GTEST_API_ void UniversalPrintArray( |
4918 | + const wchar_t* begin, size_t len, ::std::ostream* os); |
4919 | + |
4920 | +// Implements printing an array type T[N]. |
4921 | +template <typename T, size_t N> |
4922 | +class UniversalPrinter<T[N]> { |
4923 | + public: |
4924 | + // Prints the given array, omitting some elements when there are too |
4925 | + // many. |
4926 | + static void Print(const T (&a)[N], ::std::ostream* os) { |
4927 | + UniversalPrintArray(a, N, os); |
4928 | + } |
4929 | +}; |
4930 | + |
4931 | +// Implements printing a reference type T&. |
4932 | +template <typename T> |
4933 | +class UniversalPrinter<T&> { |
4934 | + public: |
4935 | + // MSVC warns about adding const to a function type, so we want to |
4936 | + // disable the warning. |
4937 | +#ifdef _MSC_VER |
4938 | +# pragma warning(push) // Saves the current warning state. |
4939 | +# pragma warning(disable:4180) // Temporarily disables warning 4180. |
4940 | +#endif // _MSC_VER |
4941 | + |
4942 | + static void Print(const T& value, ::std::ostream* os) { |
4943 | + // Prints the address of the value. We use reinterpret_cast here |
4944 | + // as static_cast doesn't compile when T is a function type. |
4945 | + *os << "@" << reinterpret_cast<const void*>(&value) << " "; |
4946 | + |
4947 | + // Then prints the value itself. |
4948 | + UniversalPrint(value, os); |
4949 | + } |
4950 | + |
4951 | +#ifdef _MSC_VER |
4952 | +# pragma warning(pop) // Restores the warning state. |
4953 | +#endif // _MSC_VER |
4954 | +}; |
4955 | + |
4956 | +// Prints a value tersely: for a reference type, the referenced value |
4957 | +// (but not the address) is printed; for a (const) char pointer, the |
4958 | +// NUL-terminated string (but not the pointer) is printed. |
4959 | + |
4960 | +template <typename T> |
4961 | +class UniversalTersePrinter { |
4962 | + public: |
4963 | + static void Print(const T& value, ::std::ostream* os) { |
4964 | + UniversalPrint(value, os); |
4965 | + } |
4966 | +}; |
4967 | +template <typename T> |
4968 | +class UniversalTersePrinter<T&> { |
4969 | + public: |
4970 | + static void Print(const T& value, ::std::ostream* os) { |
4971 | + UniversalPrint(value, os); |
4972 | + } |
4973 | +}; |
4974 | +template <typename T, size_t N> |
4975 | +class UniversalTersePrinter<T[N]> { |
4976 | + public: |
4977 | + static void Print(const T (&value)[N], ::std::ostream* os) { |
4978 | + UniversalPrinter<T[N]>::Print(value, os); |
4979 | + } |
4980 | +}; |
4981 | +template <> |
4982 | +class UniversalTersePrinter<const char*> { |
4983 | + public: |
4984 | + static void Print(const char* str, ::std::ostream* os) { |
4985 | + if (str == NULL) { |
4986 | + *os << "NULL"; |
4987 | + } else { |
4988 | + UniversalPrint(string(str), os); |
4989 | + } |
4990 | + } |
4991 | +}; |
4992 | +template <> |
4993 | +class UniversalTersePrinter<char*> { |
4994 | + public: |
4995 | + static void Print(char* str, ::std::ostream* os) { |
4996 | + UniversalTersePrinter<const char*>::Print(str, os); |
4997 | + } |
4998 | +}; |
4999 | + |
5000 | +#if GTEST_HAS_STD_WSTRING |
PASSED: Continuous integration, rev:58 jenkins. qa.ubuntu. com/job/ sync-monitor- ci/34/ jenkins. qa.ubuntu. com/job/ sync-monitor- trusty- amd64-ci/ 34 jenkins. qa.ubuntu. com/job/ sync-monitor- trusty- armhf-ci/ 34 jenkins. qa.ubuntu. com/job/ sync-monitor- trusty- armhf-ci/ 34/artifact/ work/output/ *zip*/output. zip jenkins. qa.ubuntu. com/job/ sync-monitor- trusty- i386-ci/ 34
http://
Executed test runs:
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
Click here to trigger a rebuild: s-jenkins. ubuntu- ci:8080/ job/sync- monitor- ci/34/rebuild
http://