Skip to content

Commit 20ac119

Browse files
committed
upgrading to google benchmark v1.5.1; adding google test version e6e2d3b
1 parent ed008d5 commit 20ac119

File tree

261 files changed

+111325
-0
lines changed

Some content is hidden

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

261 files changed

+111325
-0
lines changed
Lines changed: 4 additions & 0 deletions
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
Lines changed: 84 additions & 0 deletions
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
Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
# Build matrix / environment variable are explained on:
2+
# https://docs.travis-ci.com/user/customizing-the-build/
3+
# This file can be validated on:
4+
# http://lint.travis-ci.org/
5+
6+
language: cpp
7+
8+
# Define the matrix explicitly, manually expanding the combinations of (os, compiler, env).
9+
# It is more tedious, but grants us far more flexibility.
10+
matrix:
11+
include:
12+
- os: linux
13+
before_install: chmod -R +x ./ci/*platformio.sh
14+
install: ./ci/install-platformio.sh
15+
script: ./ci/build-platformio.sh
16+
- os: linux
17+
dist: bionic
18+
compiler: gcc
19+
install: ./ci/install-linux.sh && ./ci/log-config.sh
20+
script: ./ci/build-linux-bazel.sh
21+
- os: linux
22+
dist: bionic
23+
compiler: clang
24+
install: ./ci/install-linux.sh && ./ci/log-config.sh
25+
script: ./ci/build-linux-bazel.sh
26+
- os: linux
27+
dist: bionic
28+
compiler: gcc
29+
env: BUILD_TYPE=Debug VERBOSE=1 CXX_FLAGS="-std=c++11 -Wdeprecated"
30+
- os: linux
31+
dist: bionic
32+
compiler: clang
33+
env: BUILD_TYPE=Release VERBOSE=1 CXX_FLAGS="-std=c++11 -Wdeprecated" NO_EXCEPTION=ON NO_RTTI=ON COMPILER_IS_GNUCXX=ON
34+
- os: osx
35+
compiler: gcc
36+
env: BUILD_TYPE=Release VERBOSE=1 CXX_FLAGS="-std=c++11 -Wdeprecated" HOMEBREW_LOGS=~/homebrew-logs HOMEBREW_TEMP=~/homebrew-temp
37+
- os: osx
38+
compiler: clang
39+
env: BUILD_TYPE=Release VERBOSE=1 CXX_FLAGS="-std=c++11 -Wdeprecated" HOMEBREW_LOGS=~/homebrew-logs HOMEBREW_TEMP=~/homebrew-temp
40+
41+
# These are the install and build (script) phases for the most common entries in the matrix. They could be included
42+
# in each entry in the matrix, but that is just repetitive.
43+
install:
44+
- ./ci/install-${TRAVIS_OS_NAME}.sh
45+
- . ./ci/env-${TRAVIS_OS_NAME}.sh
46+
- ./ci/log-config.sh
47+
48+
script: ./ci/travis.sh
49+
50+
# This section installs the necessary dependencies.
51+
addons:
52+
apt:
53+
packages:
54+
- g++
55+
- clang
56+
update: true
57+
homebrew:
58+
packages:
59+
- ccache
60+
61+
- llvm@4
62+
update: true
63+
64+
notifications:
65+
email: false
Lines changed: 180 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,180 @@
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+
config_setting(
40+
name = "windows",
41+
constraint_values = ["@bazel_tools//platforms:windows"],
42+
)
43+
44+
config_setting(
45+
name = "has_absl",
46+
values = {"define": "absl=1"},
47+
)
48+
49+
# Library that defines the FRIEND_TEST macro.
50+
cc_library(
51+
name = "gtest_prod",
52+
hdrs = ["googletest/include/gtest/gtest_prod.h"],
53+
includes = ["googletest/include"],
54+
)
55+
56+
# Google Test including Google Mock
57+
cc_library(
58+
name = "gtest",
59+
srcs = glob(
60+
include = [
61+
"googletest/src/*.cc",
62+
"googletest/src/*.h",
63+
"googletest/include/gtest/**/*.h",
64+
"googlemock/src/*.cc",
65+
"googlemock/include/gmock/**/*.h",
66+
],
67+
exclude = [
68+
"googletest/src/gtest-all.cc",
69+
"googletest/src/gtest_main.cc",
70+
"googlemock/src/gmock-all.cc",
71+
"googlemock/src/gmock_main.cc",
72+
],
73+
),
74+
hdrs = glob([
75+
"googletest/include/gtest/*.h",
76+
"googlemock/include/gmock/*.h",
77+
]),
78+
copts = select({
79+
":windows": [],
80+
"//conditions:default": ["-pthread"],
81+
}),
82+
defines = select({
83+
":has_absl": ["GTEST_HAS_ABSL=1"],
84+
"//conditions:default": [],
85+
}),
86+
features = select({
87+
":windows": ["windows_export_all_symbols"],
88+
"//conditions:default": [],
89+
}),
90+
includes = [
91+
"googlemock",
92+
"googlemock/include",
93+
"googletest",
94+
"googletest/include",
95+
],
96+
linkopts = select({
97+
":windows": [],
98+
"//conditions:default": ["-pthread"],
99+
}),
100+
deps = select({
101+
":has_absl": [
102+
"@com_google_absl//absl/debugging:failure_signal_handler",
103+
"@com_google_absl//absl/debugging:stacktrace",
104+
"@com_google_absl//absl/debugging:symbolize",
105+
"@com_google_absl//absl/strings",
106+
"@com_google_absl//absl/types:any",
107+
"@com_google_absl//absl/types:optional",
108+
"@com_google_absl//absl/types:variant",
109+
],
110+
"//conditions:default": [],
111+
}),
112+
)
113+
114+
cc_library(
115+
name = "gtest_main",
116+
srcs = ["googlemock/src/gmock_main.cc"],
117+
features = select({
118+
":windows": ["windows_export_all_symbols"],
119+
"//conditions:default": [],
120+
}),
121+
deps = [":gtest"],
122+
)
123+
124+
# The following rules build samples of how to use gTest.
125+
cc_library(
126+
name = "gtest_sample_lib",
127+
srcs = [
128+
"googletest/samples/sample1.cc",
129+
"googletest/samples/sample2.cc",
130+
"googletest/samples/sample4.cc",
131+
],
132+
hdrs = [
133+
"googletest/samples/prime_tables.h",
134+
"googletest/samples/sample1.h",
135+
"googletest/samples/sample2.h",
136+
"googletest/samples/sample3-inl.h",
137+
"googletest/samples/sample4.h",
138+
],
139+
features = select({
140+
":windows": ["windows_export_all_symbols"],
141+
"//conditions:default": [],
142+
}),
143+
)
144+
145+
cc_test(
146+
name = "gtest_samples",
147+
size = "small",
148+
# All Samples except:
149+
# sample9 (main)
150+
# sample10 (main and takes a command line option and needs to be separate)
151+
srcs = [
152+
"googletest/samples/sample1_unittest.cc",
153+
"googletest/samples/sample2_unittest.cc",
154+
"googletest/samples/sample3_unittest.cc",
155+
"googletest/samples/sample4_unittest.cc",
156+
"googletest/samples/sample5_unittest.cc",
157+
"googletest/samples/sample6_unittest.cc",
158+
"googletest/samples/sample7_unittest.cc",
159+
"googletest/samples/sample8_unittest.cc",
160+
],
161+
linkstatic = 0,
162+
deps = [
163+
"gtest_sample_lib",
164+
":gtest_main",
165+
],
166+
)
167+
168+
cc_test(
169+
name = "sample9_unittest",
170+
size = "small",
171+
srcs = ["googletest/samples/sample9_unittest.cc"],
172+
deps = [":gtest"],
173+
)
174+
175+
cc_test(
176+
name = "sample10_unittest",
177+
size = "small",
178+
srcs = ["googletest/samples/sample10_unittest.cc"],
179+
deps = [":gtest"],
180+
)
Lines changed: 32 additions & 0 deletions
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.8)
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.10.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)