[google-styleguide](https://github.com/google/styleguide) project. All patches
will be expected to conform to the style outlined
[here](https://google.github.io/styleguide/cppguide.html). Use
-[.clang-format](https://github.com/google/googletest/blob/master/.clang-format)
-to check your formatting.
+[.clang-format](https://github.com/google/googletest/blob/main/.clang-format) to
+check your formatting.
## Requirements for Contributors
If you plan to contribute a patch, you need to build Google Test, Google Mock,
and their own tests from a git checkout, which has further requirements:
-* [Python](https://www.python.org/) v2.3 or newer (for running some of the
+* [Python](https://www.python.org/) v3.6 or newer (for running some of the
tests and re-generating certain source files from templates)
* [CMake](https://cmake.org/) v2.8.12 or newer
functionality, you'll want to compile and run Google Test and GoogleMock's own
tests. For that you can use CMake:
- mkdir mybuild
- cd mybuild
- cmake -Dgtest_build_tests=ON -Dgmock_build_tests=ON ${GTEST_REPO_DIR}
+```
+mkdir mybuild
+cd mybuild
+cmake -Dgtest_build_tests=ON -Dgmock_build_tests=ON ${GTEST_REPO_DIR}
+```
To choose between building only Google Test or Google Mock, you may modify your
cmake command to be one of each
- cmake -Dgtest_build_tests=ON ${GTEST_DIR} # sets up Google Test tests
- cmake -Dgmock_build_tests=ON ${GMOCK_DIR} # sets up Google Mock tests
+```
+cmake -Dgtest_build_tests=ON ${GTEST_DIR} # sets up Google Test tests
+cmake -Dgmock_build_tests=ON ${GMOCK_DIR} # sets up Google Mock tests
+```
Make sure you have Python installed, as some of Google Test's tests are written
in Python. If the cmake command complains about not being able to find Python
(`Could NOT find PythonInterp (missing: PYTHON_EXECUTABLE)`), try telling it
explicitly where your Python executable can be found:
- cmake -DPYTHON_EXECUTABLE=path/to/python ...
+```
+cmake -DPYTHON_EXECUTABLE=path/to/python ...
+```
Next, you can build Google Test and / or Google Mock and all desired tests. On
\*nix, this is usually done by
- make
+```
+make
+```
To run the tests, do
- make test
+```
+make test
+```
All tests should pass.