Skip to content

Commit 21e5185

Browse files
Merge branch 'master' into josh/fix_scoped_class2
2 parents 3e2cb75 + 490554a commit 21e5185

File tree

240 files changed

+15085
-8264
lines changed

Some content is hidden

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

240 files changed

+15085
-8264
lines changed

.gitignore

+30
Original file line numberDiff line numberDiff line change
@@ -22,3 +22,33 @@ Win32-Debug/
2222
Win32-Release/
2323
x64-Debug/
2424
x64-Release/
25+
26+
# Ignore autoconf / automake files
27+
Makefile.in
28+
aclocal.m4
29+
configure
30+
build-aux/
31+
autom4te.cache/
32+
googletest/m4/libtool.m4
33+
googletest/m4/ltoptions.m4
34+
googletest/m4/ltsugar.m4
35+
googletest/m4/ltversion.m4
36+
googletest/m4/lt~obsolete.m4
37+
38+
# Ignore generated directories.
39+
googlemock/fused-src/
40+
googletest/fused-src/
41+
42+
# macOS files
43+
.DS_Store
44+
45+
# Ignore cmake generated directories and files.
46+
CMakeFiles
47+
CTestTestfile.cmake
48+
Makefile
49+
cmake_install.cmake
50+
googlemock/CMakeFiles
51+
googlemock/CTestTestfile.cmake
52+
googlemock/Makefile
53+
googlemock/cmake_install.cmake
54+
googlemock/gtest

.travis.yml

+15-8
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Build matrix / environment variable are explained on:
2-
# http://about.travis-ci.org/docs/user/build-configuration/
2+
# https://docs.travis-ci.com/user/customizing-the-build/
33
# This file can be validated on:
44
# http://lint.travis-ci.org/
55

@@ -12,28 +12,34 @@ matrix:
1212
include:
1313
- os: linux
1414
compiler: gcc
15-
sudo: true
16-
cache:
15+
sudo : true
1716
install: ./ci/install-linux.sh && ./ci/log-config.sh
1817
script: ./ci/build-linux-bazel.sh
1918
- os: linux
2019
compiler: clang
21-
sudo: true
22-
cache:
20+
sudo : true
2321
install: ./ci/install-linux.sh && ./ci/log-config.sh
2422
script: ./ci/build-linux-bazel.sh
2523
- os: linux
24+
group: deprecated-2017Q4
2625
compiler: gcc
27-
env: BUILD_TYPE=Debug VERBOSE=1
26+
install: ./ci/install-linux.sh && ./ci/log-config.sh
27+
script: ./ci/build-linux-autotools.sh
2828
- os: linux
29+
group: deprecated-2017Q4
2930
compiler: gcc
30-
env: BUILD_TYPE=Release VERBOSE=1 CXX_FLAGS=-std=c++11
31+
env: BUILD_TYPE=Debug VERBOSE=1 CXX_FLAGS=-std=c++11
3132
- os: linux
33+
group: deprecated-2017Q4
3234
compiler: clang
3335
env: BUILD_TYPE=Debug VERBOSE=1
3436
- os: linux
37+
group: deprecated-2017Q4
3538
compiler: clang
3639
env: BUILD_TYPE=Release VERBOSE=1 CXX_FLAGS=-std=c++11
40+
- os: linux
41+
compiler: clang
42+
env: BUILD_TYPE=Release VERBOSE=1 CXX_FLAGS=-std=c++11 NO_EXCEPTION=ON NO_RTTI=ON COMPILER_IS_GNUCXX=ON
3743
- os: osx
3844
compiler: gcc
3945
env: BUILD_TYPE=Debug VERBOSE=1
@@ -43,9 +49,10 @@ matrix:
4349
- os: osx
4450
compiler: clang
4551
env: BUILD_TYPE=Debug VERBOSE=1
52+
if: type != pull_request
4653
- os: osx
47-
compiler: clang
4854
env: BUILD_TYPE=Release VERBOSE=1 CXX_FLAGS=-std=c++11
55+
if: type != pull_request
4956

5057
# These are the install and build (script) phases for the most common entries in the matrix. They could be included
5158
# in each entry in the matrix, but that is just repetitive.

BUILD.bazel

+40-7
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright 2017 Google Inc.
1+
# Copyright 2017 Google Inc.
22
# All Rights Reserved.
33
#
44
#
@@ -37,11 +37,21 @@ package(default_visibility = ["//visibility:public"])
3737
licenses(["notice"])
3838

3939
config_setting(
40-
name = "win",
40+
name = "windows",
41+
values = {"cpu": "x64_windows"},
42+
)
43+
44+
config_setting(
45+
name = "windows_msvc",
4146
values = {"cpu": "x64_windows_msvc"},
4247
)
4348

44-
# Google Test including Google Mock
49+
config_setting(
50+
name = "has_absl",
51+
values = {"define": "absl=1"},
52+
)
53+
54+
# Google Test including Google Mock
4555
cc_library(
4656
name = "gtest",
4757
srcs = glob(
@@ -59,36 +69,59 @@ cc_library(
5969
"googlemock/src/gmock_main.cc",
6070
],
6171
),
62-
hdrs =glob([
72+
hdrs = glob([
6373
"googletest/include/gtest/*.h",
6474
"googlemock/include/gmock/*.h",
6575
]),
6676
copts = select(
6777
{
68-
":win": [],
78+
":windows": [],
79+
":windows_msvc": [],
6980
"//conditions:default": ["-pthread"],
7081
},
7182
),
83+
defines = select(
84+
{
85+
":has_absl": [
86+
"GTEST_HAS_ABSL=1",
87+
],
88+
"//conditions:default": [],
89+
},
90+
),
7291
includes = [
7392
"googlemock",
7493
"googlemock/include",
7594
"googletest",
7695
"googletest/include",
7796
],
7897
linkopts = select({
79-
":win": [],
98+
":windows": [],
99+
":windows_msvc": [],
80100
"//conditions:default": [
81101
"-pthread",
82102
],
83103
}),
104+
deps = select(
105+
{
106+
":has_absl": [
107+
"@com_google_absl//absl/debugging:failure_signal_handler",
108+
"@com_google_absl//absl/debugging:stacktrace",
109+
"@com_google_absl//absl/debugging:symbolize",
110+
"@com_google_absl//absl/strings",
111+
"@com_google_absl//absl/types:optional",
112+
"@com_google_absl//absl/types:variant",
113+
],
114+
"//conditions:default": [],
115+
},
116+
),
84117
)
85118

86119
cc_library(
87120
name = "gtest_main",
88121
srcs = [
89122
"googlemock/src/gmock_main.cc",
90123
],
91-
deps = ["//:gtest"],
124+
deps = [":gtest"],
92125
)
93126

94127
# The following rules build samples of how to use gTest.

CONTRIBUTING.md

+160
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,160 @@
1+
# How to become a contributor and submit your own code
2+
3+
## Contributor License Agreements
4+
5+
We'd love to accept your patches! Before we can take them, we
6+
have to jump a couple of legal hurdles.
7+
8+
Please fill out either the individual or corporate Contributor License Agreement
9+
(CLA).
10+
11+
* If you are an individual writing original source code and you're sure you
12+
own the intellectual property, then you'll need to sign an
13+
[individual CLA](https://developers.google.com/open-source/cla/individual).
14+
* If you work for a company that wants to allow you to contribute your work,
15+
then you'll need to sign a
16+
[corporate CLA](https://developers.google.com/open-source/cla/corporate).
17+
18+
Follow either of the two links above to access the appropriate CLA and
19+
instructions for how to sign and return it. Once we receive it, we'll be able to
20+
accept your pull requests.
21+
22+
## Contributing A Patch
23+
24+
1. Submit an issue describing your proposed change to the
25+
[issue tracker](https://github.com/google/googletest).
26+
1. Please don't mix more than one logical change per submittal,
27+
because it makes the history hard to follow. If you want to make a
28+
change that doesn't have a corresponding issue in the issue
29+
tracker, please create one.
30+
1. Also, coordinate with team members that are listed on the issue in
31+
question. This ensures that work isn't being duplicated and
32+
communicating your plan early also generally leads to better
33+
patches.
34+
1. If your proposed change is accepted, and you haven't already done so, sign a
35+
Contributor License Agreement (see details above).
36+
1. Fork the desired repo, develop and test your code changes.
37+
1. Ensure that your code adheres to the existing style in the sample to which
38+
you are contributing.
39+
1. Ensure that your code has an appropriate set of unit tests which all pass.
40+
1. Submit a pull request.
41+
42+
If you are a Googler, it is preferable to first create an internal change and
43+
have it reviewed and submitted, and then create an upstreaming pull
44+
request here.
45+
46+
## The Google Test and Google Mock Communities ##
47+
48+
The Google Test community exists primarily through the
49+
[discussion group](http://groups.google.com/group/googletestframework)
50+
and the GitHub repository.
51+
Likewise, the Google Mock community exists primarily through their own
52+
[discussion group](http://groups.google.com/group/googlemock).
53+
You are definitely encouraged to contribute to the
54+
discussion and you can also help us to keep the effectiveness of the
55+
group high by following and promoting the guidelines listed here.
56+
57+
### Please Be Friendly ###
58+
59+
Showing courtesy and respect to others is a vital part of the Google
60+
culture, and we strongly encourage everyone participating in Google
61+
Test development to join us in accepting nothing less. Of course,
62+
being courteous is not the same as failing to constructively disagree
63+
with each other, but it does mean that we should be respectful of each
64+
other when enumerating the 42 technical reasons that a particular
65+
proposal may not be the best choice. There's never a reason to be
66+
antagonistic or dismissive toward anyone who is sincerely trying to
67+
contribute to a discussion.
68+
69+
Sure, C++ testing is serious business and all that, but it's also
70+
a lot of fun. Let's keep it that way. Let's strive to be one of the
71+
friendliest communities in all of open source.
72+
73+
As always, discuss Google Test in the official GoogleTest discussion group.
74+
You don't have to actually submit code in order to sign up. Your participation
75+
itself is a valuable contribution.
76+
77+
## Style
78+
79+
To keep the source consistent, readable, diffable and easy to merge,
80+
we use a fairly rigid coding style, as defined by the [google-styleguide](https://github.com/google/styleguide) project. All patches will be expected
81+
to conform to the style outlined [here](https://google.github.io/styleguide/cppguide.html).
82+
83+
## Requirements for Contributors ###
84+
85+
If you plan to contribute a patch, you need to build Google Test,
86+
Google Mock, and their own tests from a git checkout, which has
87+
further requirements:
88+
89+
* [Python](https://www.python.org/) v2.3 or newer (for running some of
90+
the tests and re-generating certain source files from templates)
91+
* [CMake](https://cmake.org/) v2.6.4 or newer
92+
* [GNU Build System](https://en.wikipedia.org/wiki/GNU_Build_System)
93+
including automake (>= 1.9), autoconf (>= 2.59), and
94+
libtool / libtoolize.
95+
96+
## Developing Google Test ##
97+
98+
This section discusses how to make your own changes to Google Test.
99+
100+
### Testing Google Test Itself ###
101+
102+
To make sure your changes work as intended and don't break existing
103+
functionality, you'll want to compile and run Google Test's own tests.
104+
For that you can use CMake:
105+
106+
mkdir mybuild
107+
cd mybuild
108+
cmake -Dgtest_build_tests=ON ${GTEST_DIR}
109+
110+
Make sure you have Python installed, as some of Google Test's tests
111+
are written in Python. If the cmake command complains about not being
112+
able to find Python (`Could NOT find PythonInterp (missing:
113+
PYTHON_EXECUTABLE)`), try telling it explicitly where your Python
114+
executable can be found:
115+
116+
cmake -DPYTHON_EXECUTABLE=path/to/python -Dgtest_build_tests=ON ${GTEST_DIR}
117+
118+
Next, you can build Google Test and all of its own tests. On \*nix,
119+
this is usually done by 'make'. To run the tests, do
120+
121+
make test
122+
123+
All tests should pass.
124+
125+
### Regenerating Source Files ##
126+
127+
Some of Google Test's source files are generated from templates (not
128+
in the C++ sense) using a script.
129+
For example, the
130+
file include/gtest/internal/gtest-type-util.h.pump is used to generate
131+
gtest-type-util.h in the same directory.
132+
133+
You don't need to worry about regenerating the source files
134+
unless you need to modify them. You would then modify the
135+
corresponding `.pump` files and run the '[pump.py](googletest/scripts/pump.py)'
136+
generator script. See the [Pump Manual](googletest/docs/PumpManual.md).
137+
138+
## Developing Google Mock ###
139+
140+
This section discusses how to make your own changes to Google Mock.
141+
142+
#### Testing Google Mock Itself ####
143+
144+
To make sure your changes work as intended and don't break existing
145+
functionality, you'll want to compile and run Google Test's own tests.
146+
For that you'll need Autotools. First, make sure you have followed
147+
the instructions above to configure Google Mock.
148+
Then, create a build output directory and enter it. Next,
149+
150+
${GMOCK_DIR}/configure # try --help for more info
151+
152+
Once you have successfully configured Google Mock, the build steps are
153+
standard for GNU-style OSS packages.
154+
155+
make # Standard makefile following GNU conventions
156+
make check # Builds and runs all tests - all should pass.
157+
158+
Note that when building your project against Google Mock, you are building
159+
against Google Test as well. There is no need to configure Google Test
160+
separately.

LICENSE

+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
Copyright 2008, Google Inc.
2+
All rights reserved.
3+
4+
Redistribution and use in source and binary forms, with or without
5+
modification, are permitted provided that the following conditions are
6+
met:
7+
8+
* Redistributions of source code must retain the above copyright
9+
notice, this list of conditions and the following disclaimer.
10+
* Redistributions in binary form must reproduce the above
11+
copyright notice, this list of conditions and the following disclaimer
12+
in the documentation and/or other materials provided with the
13+
distribution.
14+
* Neither the name of Google Inc. nor the names of its
15+
contributors may be used to endorse or promote products derived from
16+
this software without specific prior written permission.
17+
18+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
19+
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
20+
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
21+
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
22+
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
23+
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
24+
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
25+
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
26+
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
27+
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
28+
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

Makefile.am

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
## Process this file with automake to produce Makefile.in
2+
ACLOCAL_AMFLAGS = -I m4
3+
4+
AUTOMAKE_OPTIONS = foreign
5+
6+
# Build . before src so that our all-local and clean-local hooks kicks in at
7+
# the right time.
8+
SUBDIRS = googletest googlemock
9+
10+
EXTRA_DIST = \
11+
BUILD.bazel \
12+
CMakeLists.txt \
13+
README.md \
14+
WORKSPACE

0 commit comments

Comments
 (0)