Skip to content

Commit fac0bd8

Browse files
committed
Update googletest to 1.13
Fix issue with CMake 4.0
1 parent a742115 commit fac0bd8

File tree

277 files changed

+21419
-25486
lines changed

Some content is hidden

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

277 files changed

+21419
-25486
lines changed

.bazelignore

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
test/gtest-1.11.0
1+
test/googletest-1.13.0

.codedocs

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ EXAMPLE_PATH =
88

99
# One or more directories and files to exclude from documentation generation.
1010
# Use relative paths with respect to the repository root directory.
11-
EXCLUDE = test/gtest-1.8.0/
11+
EXCLUDE = test/googletest-1.13.0/
1212

1313
# One or more wildcard patterns to exclude files and directories from document
1414
# generation.

test/CMakeLists.txt

+2-2
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@ if(YAML_USE_SYSTEM_GTEST)
1111
endif()
1212
else()
1313
add_subdirectory(
14-
"${CMAKE_CURRENT_SOURCE_DIR}/gtest-1.11.0"
14+
"${CMAKE_CURRENT_SOURCE_DIR}/googletest-1.13.0"
1515
"${CMAKE_CURRENT_BINARY_DIR}/prefix")
16-
include_directories(SYSTEM "${CMAKE_CURRENT_SOURCE_DIR}/gtest-1.11.0/googletest/include")
16+
include_directories(SYSTEM "${CMAKE_CURRENT_SOURCE_DIR}/googletest-1.13.0/googletest/include")
1717
endif()
1818

1919
set(test-new-api-pattern "new-api/*.cpp")
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
name: Bug Report
2+
description: Let us know that something does not work as expected.
3+
title: "[Bug]: Please title this bug report"
4+
body:
5+
- type: textarea
6+
id: what-happened
7+
attributes:
8+
label: Describe the issue
9+
description: What happened, and what did you expect to happen?
10+
validations:
11+
required: true
12+
- type: textarea
13+
id: steps
14+
attributes:
15+
label: Steps to reproduce the problem
16+
description: It is important that we are able to reproduce the problem that you are experiencing. Please provide all code and relevant steps to reproduce the problem, including your `BUILD`/`CMakeLists.txt` file and build commands. Links to a GitHub branch or [godbolt.org](https://godbolt.org/) that demonstrate the problem are also helpful.
17+
validations:
18+
required: true
19+
- type: textarea
20+
id: version
21+
attributes:
22+
label: What version of GoogleTest are you using?
23+
description: Please include the output of `git rev-parse HEAD` or the GoogleTest release version number that you are using.
24+
validations:
25+
required: true
26+
- type: textarea
27+
id: os
28+
attributes:
29+
label: What operating system and version are you using?
30+
description: If you are using a Linux distribution please include the name and version of the distribution as well.
31+
validations:
32+
required: true
33+
- type: textarea
34+
id: compiler
35+
attributes:
36+
label: What compiler and version are you using?
37+
description: Please include the output of `gcc -v` or `clang -v`, or the equivalent for your compiler.
38+
validations:
39+
required: true
40+
- type: textarea
41+
id: buildsystem
42+
attributes:
43+
label: What build system are you using?
44+
description: Please include the output of `bazel --version` or `cmake --version`, or the equivalent for your build system.
45+
validations:
46+
required: true
47+
- type: textarea
48+
id: additional
49+
attributes:
50+
label: Additional context
51+
description: Add any other context about the problem here.
52+
validations:
53+
required: false
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: Feature request
2+
description: Propose a new feature.
3+
title: "[FR]: Please title this feature request"
4+
labels: "enhancement"
5+
body:
6+
- type: textarea
7+
id: version
8+
attributes:
9+
label: Does the feature exist in the most recent commit?
10+
description: We recommend using the latest commit from GitHub in your projects.
11+
validations:
12+
required: true
13+
- type: textarea
14+
id: why
15+
attributes:
16+
label: Why do we need this feature?
17+
description: Ideally, explain why a combination of existing features cannot be used instead.
18+
validations:
19+
required: true
20+
- type: textarea
21+
id: proposal
22+
attributes:
23+
label: Describe the proposal.
24+
description: Include a detailed description of the feature, with usage examples.
25+
validations:
26+
required: true
27+
- type: textarea
28+
id: platform
29+
attributes:
30+
label: Is the feature specific to an operating system, compiler, or build system version?
31+
description: If it is, please specify which versions.
32+
validations:
33+
required: true
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
blank_issues_enabled: false
2+
contact_links:
3+
- name: Get Help
4+
url: https://github.com/google/googletest/discussions
5+
about: Please ask and answer questions here.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
name: ci
2+
3+
on:
4+
push:
5+
pull_request:
6+
7+
env:
8+
BAZEL_CXXOPTS: -std=c++14
9+
10+
jobs:
11+
Linux:
12+
runs-on: ubuntu-latest
13+
steps:
14+
15+
- uses: actions/checkout@v3
16+
with:
17+
fetch-depth: 0
18+
19+
- name: Tests
20+
run: bazel test --cxxopt=-std=c++14 --features=external_include_paths --test_output=errors ...
21+
22+
macOS:
23+
runs-on: macos-latest
24+
steps:
25+
26+
- uses: actions/checkout@v3
27+
with:
28+
fetch-depth: 0
29+
30+
- name: Tests
31+
run: bazel test --cxxopt=-std=c++14 --features=external_include_paths --test_output=errors ...
32+
33+
34+
Windows:
35+
runs-on: windows-latest
36+
steps:
37+
38+
- uses: actions/checkout@v3
39+
with:
40+
fetch-depth: 0
41+
42+
- name: Tests
43+
run: bazel test --cxxopt=/std:c++14 --features=external_include_paths --test_output=errors ...
File renamed without changes.

test/gtest-1.11.0/BUILD.bazel renamed to test/googletest-1.13.0/BUILD.bazel

+30-2
Original file line numberDiff line numberDiff line change
@@ -30,19 +30,32 @@
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

3937
exports_files(["LICENSE"])
4038

39+
config_setting(
40+
name = "qnx",
41+
constraint_values = ["@platforms//os:qnx"],
42+
)
43+
4144
config_setting(
4245
name = "windows",
4346
constraint_values = ["@platforms//os:windows"],
4447
)
4548

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+
4659
config_setting(
4760
name = "msvc_compiler",
4861
flag_values = {
@@ -86,6 +99,7 @@ cc_library(
8699
"googlemock/include/gmock/*.h",
87100
]),
88101
copts = select({
102+
":qnx": [],
89103
":windows": [],
90104
"//conditions:default": ["-pthread"],
91105
}),
@@ -104,18 +118,32 @@ cc_library(
104118
"googletest/include",
105119
],
106120
linkopts = select({
121+
":qnx": ["-lregex"],
107122
":windows": [],
123+
":freebsd": [
124+
"-lm",
125+
"-pthread",
126+
],
127+
":openbsd": [
128+
"-lm",
129+
"-pthread",
130+
],
108131
"//conditions:default": ["-pthread"],
109132
}),
110133
deps = select({
111134
":has_absl": [
112135
"@com_google_absl//absl/debugging:failure_signal_handler",
113136
"@com_google_absl//absl/debugging:stacktrace",
114137
"@com_google_absl//absl/debugging:symbolize",
138+
"@com_google_absl//absl/flags:flag",
139+
"@com_google_absl//absl/flags:parse",
140+
"@com_google_absl//absl/flags:reflection",
141+
"@com_google_absl//absl/flags:usage",
115142
"@com_google_absl//absl/strings",
116143
"@com_google_absl//absl/types:any",
117144
"@com_google_absl//absl/types:optional",
118145
"@com_google_absl//absl/types:variant",
146+
"@com_googlesource_code_re2//:re2",
119147
],
120148
"//conditions:default": [],
121149
}),

test/gtest-1.11.0/CMakeLists.txt renamed to test/googletest-1.13.0/CMakeLists.txt

+13-6
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,25 @@
11
# Note: CMake support is community-based. The maintainers do not use CMake
22
# internally.
33

4-
cmake_minimum_required(VERSION 2.8.12)
4+
cmake_minimum_required(VERSION 3.5)
55

66
if (POLICY CMP0048)
77
cmake_policy(SET CMP0048 NEW)
88
endif (POLICY CMP0048)
99

10+
if (POLICY CMP0069)
11+
cmake_policy(SET CMP0069 NEW)
12+
endif (POLICY CMP0069)
13+
14+
if (POLICY CMP0077)
15+
cmake_policy(SET CMP0077 NEW)
16+
endif (POLICY CMP0077)
17+
1018
project(googletest-distribution)
11-
set(GOOGLETEST_VERSION 1.11.0)
19+
set(GOOGLETEST_VERSION 1.13.0)
1220

13-
if (CMAKE_VERSION VERSION_GREATER "3.0.2")
14-
if(NOT CYGWIN AND NOT MSYS AND NOT ${CMAKE_SYSTEM_NAME} STREQUAL QNX)
15-
set(CMAKE_CXX_EXTENSIONS OFF)
16-
endif()
21+
if(NOT CYGWIN AND NOT MSYS AND NOT ${CMAKE_SYSTEM_NAME} STREQUAL QNX)
22+
set(CMAKE_CXX_EXTENSIONS OFF)
1723
endif()
1824

1925
enable_testing()
@@ -24,6 +30,7 @@ include(GNUInstallDirs)
2430
#Note that googlemock target already builds googletest
2531
option(BUILD_GMOCK "Builds the googlemock subproject" ON)
2632
option(INSTALL_GTEST "Enable installation of googletest. (Projects embedding googletest may want to turn this OFF.)" ON)
33+
option(GTEST_HAS_ABSL "Use Abseil and RE2. Requires Abseil and RE2 to be separately added to the build." OFF)
2734

2835
if(BUILD_GMOCK)
2936
add_subdirectory( googlemock )

test/gtest-1.11.0/CONTRIBUTING.md renamed to test/googletest-1.13.0/CONTRIBUTING.md

+6-5
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@ 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
@@ -36,7 +36,8 @@ PR is acceptable as an alternative.
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,8 +80,8 @@ 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

test/gtest-1.11.0/CONTRIBUTORS renamed to test/googletest-1.13.0/CONTRIBUTORS

+2
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ Manuel Klimek <[email protected]>
3434
Mario Tanev <[email protected]>
3535
Mark Paskin
3636
Markus Heule <[email protected]>
37+
Martijn Vels <[email protected]>
3738
Matthew Simmons <[email protected]>
3839
Mika Raento <[email protected]>
3940
Mike Bland <[email protected]>
@@ -55,6 +56,7 @@ Russ Rufer <[email protected]>
5556
Sean Mcafee <[email protected]>
5657
Sigurður Ásgeirsson <[email protected]>
5758
Sverre Sundsdal <[email protected]>
59+
Szymon Sobik <[email protected]>
5860
Takeshi Yoshino <[email protected]>
5961
Tracy Bialik <[email protected]>
6062
Vadim Berman <[email protected]>
File renamed without changes.

0 commit comments

Comments
 (0)