Skip to content

Commit 23a014a

Browse files
committed
Refactor docs about contributions to CONTRIBUTING.md.
Per the review comments.
1 parent c82cd5e commit 23a014a

File tree

8 files changed

+132
-364
lines changed

8 files changed

+132
-364
lines changed

CONTRIBUTING.md

+127-4
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,16 @@ accept your pull requests.
2121

2222
## Contributing A Patch
2323

24-
1. Submit an issue describing your proposed change to the repo in question.
25-
1. The repo owner will respond to your issue promptly.
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.
2634
1. If your proposed change is accepted, and you haven't already done so, sign a
2735
Contributor License Agreement (see details above).
2836
1. Fork the desired repo, develop and test your code changes.
@@ -31,7 +39,122 @@ accept your pull requests.
3139
1. Ensure that your code has an appropriate set of unit tests which all pass.
3240
1. Submit a pull request.
3341

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+
3477
## Style
3578

36-
Samples in this repository follow the [Google C++ Style Guide](
37-
https://google.github.io/styleguide/cppguide.html).
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.

README.md

+3-29
Original file line numberDiff line numberDiff line change
@@ -114,35 +114,9 @@ package (as described below):
114114
* Mac OS X v10.4 Tiger or newer
115115
* Xcode Developer Tools
116116

117-
### Requirements for Contributors ###
117+
## Contributing change
118118

119-
We welcome patches. If you plan to contribute a patch, you need to
120-
build Google Test and its own tests from a git checkout (described
121-
below), which has further requirements:
122-
123-
* [Python](https://www.python.org/) v2.3 or newer (for running some of
124-
the tests and re-generating certain source files from templates)
125-
* [CMake](https://cmake.org/) v2.6.4 or newer
126-
127-
## Regenerating Source Files ##
128-
129-
Some of Google Test's source files are generated from templates (not
130-
in the C++ sense) using a script.
131-
For example, the
132-
file include/gtest/internal/gtest-type-util.h.pump is used to generate
133-
gtest-type-util.h in the same directory.
134-
135-
You don't need to worry about regenerating the source files
136-
unless you need to modify them. You would then modify the
137-
corresponding `.pump` files and run the '[pump.py](googletest/scripts/pump.py)'
138-
generator script. See the [Pump Manual](googletest/docs/PumpManual.md).
139-
140-
### Contributing Code ###
141-
142-
We welcome patches. Please read the
143-
[Developer's Guide](googletest/docs/DevGuide.md)
144-
for how you can contribute. In particular, make sure you have signed
145-
the Contributor License Agreement, or we won't be able to accept the
146-
patch.
119+
Please read the [`CONTRIBUTING.md`](CONTRIBUTING.md) for details on
120+
how to contribute to this project.
147121

148122
Happy testing!

googlemock/README.md

-32
Original file line numberDiff line numberDiff line change
@@ -337,38 +337,6 @@ use the new matcher API (
337337
[polymorphic](./docs/CookBook.md#writing-new-polymorphic-matchers)).
338338
Matchers defined using `MATCHER()` or `MATCHER_P*()` aren't affected.
339339

340-
### Developing Google Mock ###
341-
342-
This section discusses how to make your own changes to Google Mock.
343-
344-
#### Testing Google Mock Itself ####
345-
346-
To make sure your changes work as intended and don't break existing
347-
functionality, you'll want to compile and run Google Test's own tests.
348-
For that you'll need Autotools. First, make sure you have followed
349-
the instructions above to configure Google Mock.
350-
Then, create a build output directory and enter it. Next,
351-
352-
${GMOCK_DIR}/configure # try --help for more info
353-
354-
Once you have successfully configured Google Mock, the build steps are
355-
standard for GNU-style OSS packages.
356-
357-
make # Standard makefile following GNU conventions
358-
make check # Builds and runs all tests - all should pass.
359-
360-
Note that when building your project against Google Mock, you are building
361-
against Google Test as well. There is no need to configure Google Test
362-
separately.
363-
364-
#### Contributing a Patch ####
365-
366-
We welcome patches.
367-
Please read the [Developer's Guide](docs/DevGuide.md)
368-
for how you can contribute. In particular, make sure you have signed
369-
the Contributor License Agreement, or we won't be able to accept the
370-
patch.
371-
372340
Happy testing!
373341

374342
[gtest_readme]: ../googletest/README.md "googletest"

googlemock/docs/DevGuide.md

-132
This file was deleted.

googlemock/docs/Documentation.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,5 @@ the respective git branch/tag).**
1111

1212
To contribute code to Google Mock, read:
1313

14-
* [DevGuide](DevGuide.md) -- read this _before_ writing your first patch.
14+
* [CONTRIBUTING](../CONTRIBUTING.md) -- read this _before_ writing your first patch.
1515
* [Pump Manual](../../googletest/docs/PumpManual.md) -- how we generate some of Google Mock's source files.

0 commit comments

Comments
 (0)