Skip to content

Commit 92188a4

Browse files
committed
Move helper function to anonymous namespace
1 parent 7be01cc commit 92188a4

File tree

555 files changed

+330653
-14
lines changed

Some content is hidden

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

555 files changed

+330653
-14
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# Run manually to reformat a file:
2+
# clang-format -i --style=file <file>
3+
Language: Cpp
4+
BasedOnStyle: Google
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
---
2+
name: Bug report
3+
about: Create a report to help us improve
4+
title: ''
5+
labels: 'bug'
6+
assignees: ''
7+
---
8+
9+
**Describe the bug**
10+
11+
Include a clear and concise description of what the problem is, including what
12+
you expected to happen, and what actually happened.
13+
14+
**Steps to reproduce the bug**
15+
16+
It's important that we are able to reproduce the problem that you are
17+
experiencing. Please provide all code and relevant steps to reproduce the
18+
problem, including your `BUILD`/`CMakeLists.txt` file and build commands. Links
19+
to a GitHub branch or [godbolt.org](https://godbolt.org/) that demonstrate the
20+
problem are also helpful.
21+
22+
**Does the bug persist in the most recent commit?**
23+
24+
We recommend using the latest commit in the master branch in your projects.
25+
26+
**What operating system and version are you using?**
27+
28+
If you are using a Linux distribution please include the name and version of the
29+
distribution as well.
30+
31+
**What compiler and version are you using?**
32+
33+
Please include the output of `gcc -v` or `clang -v`, or the equivalent for your
34+
compiler.
35+
36+
**What build system are you using?**
37+
38+
Please include the output of `bazel --version` or `cmake --version`, or the
39+
equivalent for your build system.
40+
41+
**Additional context**
42+
43+
Add any other context about the problem here.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
---
2+
name: Feature request
3+
about: Propose a new feature
4+
title: ''
5+
labels: 'enhancement'
6+
assignees: ''
7+
---
8+
9+
**Does the feature exist in the most recent commit?**
10+
11+
We recommend using the latest commit from GitHub in your projects.
12+
13+
**Why do we need this feature?**
14+
15+
Ideally, explain why a combination of existing features cannot be used instead.
16+
17+
**Describe the proposal**
18+
19+
Include a detailed description of the feature, with usage examples.
20+
21+
**Is the feature specific to an operating system, compiler, or build system version?**
22+
23+
If it is, please specify which versions.
24+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
blank_issues_enabled: false
+84
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
# Ignore CI build directory
2+
build/
3+
xcuserdata
4+
cmake-build-debug/
5+
.idea/
6+
bazel-bin
7+
bazel-genfiles
8+
bazel-googletest
9+
bazel-out
10+
bazel-testlogs
11+
# python
12+
*.pyc
13+
14+
# Visual Studio files
15+
.vs
16+
*.sdf
17+
*.opensdf
18+
*.VC.opendb
19+
*.suo
20+
*.user
21+
_ReSharper.Caches/
22+
Win32-Debug/
23+
Win32-Release/
24+
x64-Debug/
25+
x64-Release/
26+
27+
# Ignore autoconf / automake files
28+
Makefile.in
29+
aclocal.m4
30+
configure
31+
build-aux/
32+
autom4te.cache/
33+
googletest/m4/libtool.m4
34+
googletest/m4/ltoptions.m4
35+
googletest/m4/ltsugar.m4
36+
googletest/m4/ltversion.m4
37+
googletest/m4/lt~obsolete.m4
38+
googlemock/m4
39+
40+
# Ignore generated directories.
41+
googlemock/fused-src/
42+
googletest/fused-src/
43+
44+
# macOS files
45+
.DS_Store
46+
googletest/.DS_Store
47+
googletest/xcode/.DS_Store
48+
49+
# Ignore cmake generated directories and files.
50+
CMakeFiles
51+
CTestTestfile.cmake
52+
Makefile
53+
cmake_install.cmake
54+
googlemock/CMakeFiles
55+
googlemock/CTestTestfile.cmake
56+
googlemock/Makefile
57+
googlemock/cmake_install.cmake
58+
googlemock/gtest
59+
/bin
60+
/googlemock/gmock.dir
61+
/googlemock/gmock_main.dir
62+
/googlemock/RUN_TESTS.vcxproj.filters
63+
/googlemock/RUN_TESTS.vcxproj
64+
/googlemock/INSTALL.vcxproj.filters
65+
/googlemock/INSTALL.vcxproj
66+
/googlemock/gmock_main.vcxproj.filters
67+
/googlemock/gmock_main.vcxproj
68+
/googlemock/gmock.vcxproj.filters
69+
/googlemock/gmock.vcxproj
70+
/googlemock/gmock.sln
71+
/googlemock/ALL_BUILD.vcxproj.filters
72+
/googlemock/ALL_BUILD.vcxproj
73+
/lib
74+
/Win32
75+
/ZERO_CHECK.vcxproj.filters
76+
/ZERO_CHECK.vcxproj
77+
/RUN_TESTS.vcxproj.filters
78+
/RUN_TESTS.vcxproj
79+
/INSTALL.vcxproj.filters
80+
/INSTALL.vcxproj
81+
/googletest-distribution.sln
82+
/CMakeCache.txt
83+
/ALL_BUILD.vcxproj.filters
84+
/ALL_BUILD.vcxproj
+190
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,190 @@
1+
# Copyright 2017 Google Inc.
2+
# All Rights Reserved.
3+
#
4+
#
5+
# Redistribution and use in source and binary forms, with or without
6+
# modification, are permitted provided that the following conditions are
7+
# met:
8+
#
9+
# * Redistributions of source code must retain the above copyright
10+
# notice, this list of conditions and the following disclaimer.
11+
# * Redistributions in binary form must reproduce the above
12+
# copyright notice, this list of conditions and the following disclaimer
13+
# in the documentation and/or other materials provided with the
14+
# distribution.
15+
# * Neither the name of Google Inc. nor the names of its
16+
# contributors may be used to endorse or promote products derived from
17+
# this software without specific prior written permission.
18+
#
19+
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
20+
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
21+
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
22+
# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
23+
# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
24+
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
25+
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
26+
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
27+
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
28+
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
29+
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30+
#
31+
# Bazel Build for Google C++ Testing Framework(Google Test)
32+
33+
load("@rules_cc//cc:defs.bzl", "cc_library", "cc_test")
34+
35+
package(default_visibility = ["//visibility:public"])
36+
37+
licenses(["notice"])
38+
39+
exports_files(["LICENSE"])
40+
41+
config_setting(
42+
name = "windows",
43+
constraint_values = ["@platforms//os:windows"],
44+
)
45+
46+
config_setting(
47+
name = "msvc_compiler",
48+
flag_values = {
49+
"@bazel_tools//tools/cpp:compiler": "msvc-cl",
50+
},
51+
visibility = [":__subpackages__"],
52+
)
53+
54+
config_setting(
55+
name = "has_absl",
56+
values = {"define": "absl=1"},
57+
)
58+
59+
# Library that defines the FRIEND_TEST macro.
60+
cc_library(
61+
name = "gtest_prod",
62+
hdrs = ["googletest/include/gtest/gtest_prod.h"],
63+
includes = ["googletest/include"],
64+
)
65+
66+
# Google Test including Google Mock
67+
cc_library(
68+
name = "gtest",
69+
srcs = glob(
70+
include = [
71+
"googletest/src/*.cc",
72+
"googletest/src/*.h",
73+
"googletest/include/gtest/**/*.h",
74+
"googlemock/src/*.cc",
75+
"googlemock/include/gmock/**/*.h",
76+
],
77+
exclude = [
78+
"googletest/src/gtest-all.cc",
79+
"googletest/src/gtest_main.cc",
80+
"googlemock/src/gmock-all.cc",
81+
"googlemock/src/gmock_main.cc",
82+
],
83+
),
84+
hdrs = glob([
85+
"googletest/include/gtest/*.h",
86+
"googlemock/include/gmock/*.h",
87+
]),
88+
copts = select({
89+
":windows": [],
90+
"//conditions:default": ["-pthread"],
91+
}),
92+
defines = select({
93+
":has_absl": ["GTEST_HAS_ABSL=1"],
94+
"//conditions:default": [],
95+
}),
96+
features = select({
97+
":windows": ["windows_export_all_symbols"],
98+
"//conditions:default": [],
99+
}),
100+
includes = [
101+
"googlemock",
102+
"googlemock/include",
103+
"googletest",
104+
"googletest/include",
105+
],
106+
linkopts = select({
107+
":windows": [],
108+
"//conditions:default": ["-pthread"],
109+
}),
110+
deps = select({
111+
":has_absl": [
112+
"@com_google_absl//absl/debugging:failure_signal_handler",
113+
"@com_google_absl//absl/debugging:stacktrace",
114+
"@com_google_absl//absl/debugging:symbolize",
115+
"@com_google_absl//absl/strings",
116+
"@com_google_absl//absl/types:any",
117+
"@com_google_absl//absl/types:optional",
118+
"@com_google_absl//absl/types:variant",
119+
],
120+
"//conditions:default": [],
121+
}),
122+
)
123+
124+
cc_library(
125+
name = "gtest_main",
126+
srcs = ["googlemock/src/gmock_main.cc"],
127+
features = select({
128+
":windows": ["windows_export_all_symbols"],
129+
"//conditions:default": [],
130+
}),
131+
deps = [":gtest"],
132+
)
133+
134+
# The following rules build samples of how to use gTest.
135+
cc_library(
136+
name = "gtest_sample_lib",
137+
srcs = [
138+
"googletest/samples/sample1.cc",
139+
"googletest/samples/sample2.cc",
140+
"googletest/samples/sample4.cc",
141+
],
142+
hdrs = [
143+
"googletest/samples/prime_tables.h",
144+
"googletest/samples/sample1.h",
145+
"googletest/samples/sample2.h",
146+
"googletest/samples/sample3-inl.h",
147+
"googletest/samples/sample4.h",
148+
],
149+
features = select({
150+
":windows": ["windows_export_all_symbols"],
151+
"//conditions:default": [],
152+
}),
153+
)
154+
155+
cc_test(
156+
name = "gtest_samples",
157+
size = "small",
158+
# All Samples except:
159+
# sample9 (main)
160+
# sample10 (main and takes a command line option and needs to be separate)
161+
srcs = [
162+
"googletest/samples/sample1_unittest.cc",
163+
"googletest/samples/sample2_unittest.cc",
164+
"googletest/samples/sample3_unittest.cc",
165+
"googletest/samples/sample4_unittest.cc",
166+
"googletest/samples/sample5_unittest.cc",
167+
"googletest/samples/sample6_unittest.cc",
168+
"googletest/samples/sample7_unittest.cc",
169+
"googletest/samples/sample8_unittest.cc",
170+
],
171+
linkstatic = 0,
172+
deps = [
173+
"gtest_sample_lib",
174+
":gtest_main",
175+
],
176+
)
177+
178+
cc_test(
179+
name = "sample9_unittest",
180+
size = "small",
181+
srcs = ["googletest/samples/sample9_unittest.cc"],
182+
deps = [":gtest"],
183+
)
184+
185+
cc_test(
186+
name = "sample10_unittest",
187+
size = "small",
188+
srcs = ["googletest/samples/sample10_unittest.cc"],
189+
deps = [":gtest"],
190+
)
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# Note: CMake support is community-based. The maintainers do not use CMake
2+
# internally.
3+
4+
cmake_minimum_required(VERSION 2.8.12)
5+
6+
if (POLICY CMP0048)
7+
cmake_policy(SET CMP0048 NEW)
8+
endif (POLICY CMP0048)
9+
10+
project(googletest-distribution)
11+
set(GOOGLETEST_VERSION 1.11.0)
12+
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()
17+
endif()
18+
19+
enable_testing()
20+
21+
include(CMakeDependentOption)
22+
include(GNUInstallDirs)
23+
24+
#Note that googlemock target already builds googletest
25+
option(BUILD_GMOCK "Builds the googlemock subproject" ON)
26+
option(INSTALL_GTEST "Enable installation of googletest. (Projects embedding googletest may want to turn this OFF.)" ON)
27+
28+
if(BUILD_GMOCK)
29+
add_subdirectory( googlemock )
30+
else()
31+
add_subdirectory( googletest )
32+
endif()

0 commit comments

Comments
 (0)