Skip to content

Commit 3ea6da7

Browse files
author
Kim Kulling
committed
googletest: latest
1 parent 2c3c270 commit 3ea6da7

File tree

237 files changed

+45812
-17148
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

237 files changed

+45812
-17148
lines changed

CMakeLists.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ if( CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_GNUCXX )
1010
find_package(Threads)
1111
endif()
1212

13+
set(CMAKE_CXX_STANDARD 14)
1314
option( CPPCORE_BUILD_UNITTESTS
1415
"Build unit tests."
1516
ON
@@ -167,7 +168,7 @@ IF( CPPCORE_BUILD_UNITTESTS )
167168
# Prevent overriding the parent project's compiler/linker
168169
# settings on Windows
169170
SET(gtest_force_shared_crt ON CACHE BOOL "" FORCE)
170-
ADD_SUBDIRECTORY( contrib/googletest-1.10.x/googletest )
171+
ADD_SUBDIRECTORY( contrib/googletest-1.10.x/ )
171172
ADD_EXECUTABLE( cppcore_unittest
172173
${cppcore_test_src}
173174
${cppcore_common_test_src}

contrib/googletest-1.10.x/BUILD.bazel

Lines changed: 43 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,15 +30,38 @@
3030
#
3131
# Bazel Build for Google C++ Testing Framework(Google Test)
3232

33-
load("@rules_cc//cc:defs.bzl", "cc_library", "cc_test")
34-
3533
package(default_visibility = ["//visibility:public"])
3634

3735
licenses(["notice"])
3836

37+
exports_files(["LICENSE"])
38+
39+
config_setting(
40+
name = "qnx",
41+
constraint_values = ["@platforms//os:qnx"],
42+
)
43+
3944
config_setting(
4045
name = "windows",
41-
constraint_values = ["@bazel_tools//platforms:windows"],
46+
constraint_values = ["@platforms//os:windows"],
47+
)
48+
49+
config_setting(
50+
name = "freebsd",
51+
constraint_values = ["@platforms//os:freebsd"],
52+
)
53+
54+
config_setting(
55+
name = "openbsd",
56+
constraint_values = ["@platforms//os:openbsd"],
57+
)
58+
59+
config_setting(
60+
name = "msvc_compiler",
61+
flag_values = {
62+
"@bazel_tools//tools/cpp:compiler": "msvc-cl",
63+
},
64+
visibility = [":__subpackages__"],
4265
)
4366

4467
config_setting(
@@ -76,6 +99,7 @@ cc_library(
7699
"googlemock/include/gmock/*.h",
77100
]),
78101
copts = select({
102+
":qnx": [],
79103
":windows": [],
80104
"//conditions:default": ["-pthread"],
81105
}),
@@ -94,17 +118,33 @@ cc_library(
94118
"googletest/include",
95119
],
96120
linkopts = select({
121+
":qnx": ["-lregex"],
97122
":windows": [],
123+
":freebsd": [
124+
"-lm",
125+
"-pthread",
126+
],
127+
":openbsd": [
128+
"-lm",
129+
"-pthread",
130+
],
98131
"//conditions:default": ["-pthread"],
99132
}),
100133
deps = select({
101134
":has_absl": [
135+
"@com_google_absl//absl/container:flat_hash_set",
102136
"@com_google_absl//absl/debugging:failure_signal_handler",
103137
"@com_google_absl//absl/debugging:stacktrace",
104138
"@com_google_absl//absl/debugging:symbolize",
139+
"@com_google_absl//absl/flags:flag",
140+
"@com_google_absl//absl/flags:parse",
141+
"@com_google_absl//absl/flags:reflection",
142+
"@com_google_absl//absl/flags:usage",
105143
"@com_google_absl//absl/strings",
144+
"@com_google_absl//absl/types:any",
106145
"@com_google_absl//absl/types:optional",
107146
"@com_google_absl//absl/types:variant",
147+
"@com_googlesource_code_re2//:re2",
108148
],
109149
"//conditions:default": [],
110150
}),

contrib/googletest-1.10.x/CMakeLists.txt

Lines changed: 5 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,13 @@
11
# Note: CMake support is community-based. The maintainers do not use CMake
22
# internally.
33

4-
cmake_minimum_required(VERSION 2.8.8)
5-
6-
if (POLICY CMP0048)
7-
cmake_policy(SET CMP0048 NEW)
8-
endif (POLICY CMP0048)
4+
cmake_minimum_required(VERSION 3.13)
95

106
project(googletest-distribution)
11-
set(GOOGLETEST_VERSION 1.10.0)
7+
set(GOOGLETEST_VERSION 1.14.0)
128

13-
if (CMAKE_VERSION VERSION_LESS "3.1")
14-
add_definitions(-std=c++11)
15-
else()
16-
set(CMAKE_CXX_STANDARD 11)
17-
set(CMAKE_CXX_STANDARD_REQUIRED ON)
18-
if(NOT CYGWIN)
19-
set(CMAKE_CXX_EXTENSIONS OFF)
20-
endif()
9+
if(NOT CYGWIN AND NOT MSYS AND NOT ${CMAKE_SYSTEM_NAME} STREQUAL QNX)
10+
set(CMAKE_CXX_EXTENSIONS OFF)
2111
endif()
2212

2313
enable_testing()
@@ -28,6 +18,7 @@ include(GNUInstallDirs)
2818
#Note that googlemock target already builds googletest
2919
option(BUILD_GMOCK "Builds the googlemock subproject" ON)
3020
option(INSTALL_GTEST "Enable installation of googletest. (Projects embedding googletest may want to turn this OFF.)" ON)
21+
option(GTEST_HAS_ABSL "Use Abseil and RE2. Requires Abseil and RE2 to be separately added to the build." OFF)
3122

3223
if(BUILD_GMOCK)
3324
add_subdirectory( googlemock )

contrib/googletest-1.10.x/CONTRIBUTING.md

Lines changed: 27 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -21,22 +21,23 @@ accept your pull requests.
2121

2222
## Are you a Googler?
2323

24-
If you are a Googler, please make an attempt to submit an internal change rather
25-
than a GitHub Pull Request. If you are not able to submit an internal change a
24+
If you are a Googler, please make an attempt to submit an internal contribution
25+
rather than a GitHub Pull Request. If you are not able to submit internally, a
2626
PR is acceptable as an alternative.
2727

2828
## Contributing A Patch
2929

3030
1. Submit an issue describing your proposed change to the
31-
[issue tracker](https://github.com/google/googletest).
31+
[issue tracker](https://github.com/google/googletest/issues).
3232
2. Please don't mix more than one logical change per submittal, because it
3333
makes the history hard to follow. If you want to make a change that doesn't
3434
have a corresponding issue in the issue tracker, please create one.
3535
3. Also, coordinate with team members that are listed on the issue in question.
3636
This ensures that work isn't being duplicated and communicating your plan
3737
early also generally leads to better patches.
3838
4. If your proposed change is accepted, and you haven't already done so, sign a
39-
Contributor License Agreement (see details above).
39+
Contributor License Agreement
40+
([see details above](#contributor-license-agreements)).
4041
5. Fork the desired repo, develop and test your code changes.
4142
6. Ensure that your code adheres to the existing style in the sample to which
4243
you are contributing.
@@ -79,17 +80,17 @@ fairly rigid coding style, as defined by the
7980
[google-styleguide](https://github.com/google/styleguide) project. All patches
8081
will be expected to conform to the style outlined
8182
[here](https://google.github.io/styleguide/cppguide.html). Use
82-
[.clang-format](https://github.com/google/googletest/blob/master/.clang-format)
83-
to check your formatting
83+
[.clang-format](https://github.com/google/googletest/blob/main/.clang-format) to
84+
check your formatting.
8485

8586
## Requirements for Contributors
8687

8788
If you plan to contribute a patch, you need to build Google Test, Google Mock,
8889
and their own tests from a git checkout, which has further requirements:
8990

90-
* [Python](https://www.python.org/) v2.3 or newer (for running some of the
91+
* [Python](https://www.python.org/) v3.6 or newer (for running some of the
9192
tests and re-generating certain source files from templates)
92-
* [CMake](https://cmake.org/) v2.6.4 or newer
93+
* [CMake](https://cmake.org/) v2.8.12 or newer
9394

9495
## Developing Google Test and Google Mock
9596

@@ -101,42 +102,40 @@ To make sure your changes work as intended and don't break existing
101102
functionality, you'll want to compile and run Google Test and GoogleMock's own
102103
tests. For that you can use CMake:
103104

104-
mkdir mybuild
105-
cd mybuild
106-
cmake -Dgtest_build_tests=ON -Dgmock_build_tests=ON ${GTEST_REPO_DIR}
105+
```
106+
mkdir mybuild
107+
cd mybuild
108+
cmake -Dgtest_build_tests=ON -Dgmock_build_tests=ON ${GTEST_REPO_DIR}
109+
```
107110

108111
To choose between building only Google Test or Google Mock, you may modify your
109112
cmake command to be one of each
110113

111-
cmake -Dgtest_build_tests=ON ${GTEST_DIR} # sets up Google Test tests
112-
cmake -Dgmock_build_tests=ON ${GMOCK_DIR} # sets up Google Mock tests
114+
```
115+
cmake -Dgtest_build_tests=ON ${GTEST_DIR} # sets up Google Test tests
116+
cmake -Dgmock_build_tests=ON ${GMOCK_DIR} # sets up Google Mock tests
117+
```
113118

114119
Make sure you have Python installed, as some of Google Test's tests are written
115120
in Python. If the cmake command complains about not being able to find Python
116121
(`Could NOT find PythonInterp (missing: PYTHON_EXECUTABLE)`), try telling it
117122
explicitly where your Python executable can be found:
118123

119-
cmake -DPYTHON_EXECUTABLE=path/to/python ...
124+
```
125+
cmake -DPYTHON_EXECUTABLE=path/to/python ...
126+
```
120127

121128
Next, you can build Google Test and / or Google Mock and all desired tests. On
122129
\*nix, this is usually done by
123130

124-
make
131+
```
132+
make
133+
```
125134

126135
To run the tests, do
127136

128-
make test
137+
```
138+
make test
139+
```
129140

130141
All tests should pass.
131-
132-
### Regenerating Source Files
133-
134-
Some of Google Test's source files are generated from templates (not in the C++
135-
sense) using a script. For example, the file
136-
include/gtest/internal/gtest-type-util.h.pump is used to generate
137-
gtest-type-util.h in the same directory.
138-
139-
You don't need to worry about regenerating the source files unless you need to
140-
modify them. You would then modify the corresponding `.pump` files and run the
141-
'[pump.py](googletest/scripts/pump.py)' generator script. See the
142-
[Pump Manual](googletest/docs/pump_manual.md).
Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
# This file contains a list of people who've made non-trivial
2+
# contribution to the Google C++ Testing Framework project. People
3+
# who commit code to the project are encouraged to add their names
4+
# here. Please keep the list sorted by first names.
5+
6+
Ajay Joshi <[email protected]>
7+
Balázs Dán <[email protected]>
8+
Benoit Sigoure <[email protected]>
9+
Bharat Mediratta <[email protected]>
10+
Bogdan Piloca <[email protected]>
11+
Chandler Carruth <[email protected]>
12+
Chris Prince <[email protected]>
13+
Chris Taylor <[email protected]>
14+
Dan Egnor <[email protected]>
15+
Dave MacLachlan <[email protected]>
16+
David Anderson <[email protected]>
17+
Dean Sturtevant
18+
Eric Roman <[email protected]>
19+
Gene Volovich <[email protected]>
20+
Hady Zalek <[email protected]>
21+
Hal Burch <[email protected]>
22+
Jeffrey Yasskin <[email protected]>
23+
Jim Keller <[email protected]>
24+
Joe Walnes <[email protected]>
25+
26+
Jói Sigurðsson <[email protected]>
27+
Keir Mierle <[email protected]>
28+
Keith Ray <[email protected]>
29+
Kenton Varda <[email protected]>
30+
Kostya Serebryany <[email protected]>
31+
Krystian Kuzniarek <[email protected]>
32+
Lev Makhlis
33+
Manuel Klimek <[email protected]>
34+
Mario Tanev <[email protected]>
35+
Mark Paskin
36+
Markus Heule <[email protected]>
37+
Martijn Vels <[email protected]>
38+
Matthew Simmons <[email protected]>
39+
Mika Raento <[email protected]>
40+
Mike Bland <[email protected]>
41+
Miklós Fazekas <[email protected]>
42+
Neal Norwitz <[email protected]>
43+
Nermin Ozkiranartli <[email protected]>
44+
Owen Carlsen <[email protected]>
45+
Paneendra Ba <[email protected]>
46+
Pasi Valminen <[email protected]>
47+
Patrick Hanna <[email protected]>
48+
Patrick Riley <[email protected]>
49+
Paul Menage <[email protected]>
50+
Peter Kaminski <[email protected]>
51+
Piotr Kaminski <[email protected]>
52+
Preston Jackson <[email protected]>
53+
Rainer Klaffenboeck <[email protected]>
54+
55+
Russ Rufer <[email protected]>
56+
Sean Mcafee <[email protected]>
57+
Sigurður Ásgeirsson <[email protected]>
58+
Sverre Sundsdal <[email protected]>
59+
Szymon Sobik <[email protected]>
60+
Takeshi Yoshino <[email protected]>
61+
Tracy Bialik <[email protected]>
62+
Vadim Berman <[email protected]>
63+
Vlad Losev <[email protected]>
64+
Wolfgang Klier <[email protected]>
65+
Zhanyong Wan <[email protected]>

0 commit comments

Comments
 (0)