mirror of
https://git.mirrors.martin98.com/https://github.com/google/googletest.git
synced 2025-06-02 04:55:52 +08:00
Update documentation for v1.17.0
PiperOrigin-RevId: 753214894 Change-Id: I5ec24399301dcc7e70b179db98e175f45374e3c2
This commit is contained in:
parent
54915d462b
commit
04ee1b4f2a
19
README.md
19
README.md
@ -2,30 +2,19 @@
|
||||
|
||||
### Announcements
|
||||
|
||||
#### Live at Head
|
||||
|
||||
GoogleTest now follows the
|
||||
[Abseil Live at Head philosophy](https://abseil.io/about/philosophy#upgrade-support).
|
||||
We recommend
|
||||
[updating to the latest commit in the `main` branch as often as possible](https://github.com/abseil/abseil-cpp/blob/master/FAQ.md#what-is-live-at-head-and-how-do-i-do-it).
|
||||
We do publish occasional semantic versions, tagged with
|
||||
`v${major}.${minor}.${patch}` (e.g. `v1.16.0`).
|
||||
|
||||
#### Documentation Updates
|
||||
|
||||
Our documentation is now live on GitHub Pages at
|
||||
https://google.github.io/googletest/. We recommend browsing the documentation on
|
||||
GitHub Pages rather than directly in the repository.
|
||||
|
||||
#### Release 1.16.0
|
||||
#### Release 1.17.0
|
||||
|
||||
[Release 1.16.0](https://github.com/google/googletest/releases/tag/v1.16.0) is
|
||||
[Release 1.17.0](https://github.com/google/googletest/releases/tag/v1.17.0) is
|
||||
now available.
|
||||
|
||||
The 1.16.x branch requires at least C++14.
|
||||
|
||||
The 1.16.x branch will be the last to support C++14. Future development will
|
||||
[require at least C++17](https://opensource.google/documentation/policies/cplusplus-support#c_language_standard).
|
||||
The 1.17.x branch [requires at least
|
||||
C++17]((https://opensource.google/documentation/policies/cplusplus-support#c_language_standard).
|
||||
|
||||
#### Continuous Integration
|
||||
|
||||
|
@ -9,7 +9,7 @@ we recommend this tutorial as a starting point.
|
||||
To complete this tutorial, you'll need:
|
||||
|
||||
* A compatible operating system (e.g. Linux, macOS, Windows).
|
||||
* A compatible C++ compiler that supports at least C++14.
|
||||
* A compatible C++ compiler that supports at least C++17.
|
||||
* [Bazel](https://bazel.build/) 7.0 or higher, the preferred build system used
|
||||
by the GoogleTest team.
|
||||
|
||||
@ -48,7 +48,7 @@ with the following content:
|
||||
|
||||
# Choose the most recent version available at
|
||||
# https://registry.bazel.build/modules/googletest
|
||||
bazel_dep(name = "googletest", version = "1.15.2")
|
||||
bazel_dep(name = "googletest", version = "1.17.0")
|
||||
```
|
||||
|
||||
Now you're ready to build C++ code that uses GoogleTest.
|
||||
@ -99,16 +99,16 @@ files, see the
|
||||
[Bazel C++ Tutorial](https://docs.bazel.build/versions/main/tutorial/cpp.html).
|
||||
|
||||
{: .callout .note}
|
||||
NOTE: In the example below, we assume Clang or GCC and set `--cxxopt=-std=c++14`
|
||||
to ensure that GoogleTest is compiled as C++14 instead of the compiler's default
|
||||
setting (which could be C++11). For MSVC, the equivalent would be
|
||||
`--cxxopt=/std:c++14`. See [Supported Platforms](platforms.md) for more details
|
||||
on supported language versions.
|
||||
NOTE: In the example below, we assume Clang or GCC and set `--cxxopt=-std=c++17`
|
||||
to ensure that GoogleTest is compiled as C++17 instead of the compiler's default
|
||||
setting. For MSVC, the equivalent would be `--cxxopt=/std:c++17`. See
|
||||
[Supported Platforms](platforms.md) for more details on supported language
|
||||
versions.
|
||||
|
||||
Now you can build and run your test:
|
||||
|
||||
<pre>
|
||||
<strong>$ bazel test --cxxopt=-std=c++14 --test_output=all //:hello_test</strong>
|
||||
<strong>$ bazel test --cxxopt=-std=c++17 --test_output=all //:hello_test</strong>
|
||||
INFO: Analyzed target //:hello_test (26 packages loaded, 362 targets configured).
|
||||
INFO: Found 1 test target...
|
||||
INFO: From Testing //:hello_test:
|
||||
|
@ -10,7 +10,7 @@ this tutorial as a starting point. If your project uses Bazel, see the
|
||||
To complete this tutorial, you'll need:
|
||||
|
||||
* A compatible operating system (e.g. Linux, macOS, Windows).
|
||||
* A compatible C++ compiler that supports at least C++14.
|
||||
* A compatible C++ compiler that supports at least C++17.
|
||||
* [CMake](https://cmake.org/) and a compatible build tool for building the
|
||||
project.
|
||||
* Compatible build tools include
|
||||
@ -52,8 +52,8 @@ To do this, in your project directory (`my_project`), create a file named
|
||||
cmake_minimum_required(VERSION 3.14)
|
||||
project(my_project)
|
||||
|
||||
# GoogleTest requires at least C++14
|
||||
set(CMAKE_CXX_STANDARD 14)
|
||||
# GoogleTest requires at least C++17
|
||||
set(CMAKE_CXX_STANDARD 17)
|
||||
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
||||
|
||||
include(FetchContent)
|
||||
|
@ -25,7 +25,7 @@ When building GoogleTest as a standalone project, the typical workflow starts
|
||||
with
|
||||
|
||||
```
|
||||
git clone https://github.com/google/googletest.git -b v1.16.0
|
||||
git clone https://github.com/google/googletest.git -b v1.17.0
|
||||
cd googletest # Main directory of the cloned repository.
|
||||
mkdir build # Create a directory to hold the build output.
|
||||
cd build
|
||||
@ -124,9 +124,9 @@ match the project in which it is included.
|
||||
|
||||
#### C++ Standard Version
|
||||
|
||||
An environment that supports C++14 is required in order to successfully build
|
||||
An environment that supports C++17 is required in order to successfully build
|
||||
GoogleTest. One way to ensure this is to specify the standard in the top-level
|
||||
project, for example by using the `set(CMAKE_CXX_STANDARD 14)` command along
|
||||
project, for example by using the `set(CMAKE_CXX_STANDARD 17)` command along
|
||||
with `set(CMAKE_CXX_STANDARD_REQUIRED ON)`. If this is not feasible, for example
|
||||
in a C project using GoogleTest for validation, then it can be specified by
|
||||
adding it to the options for cmake via the`-DCMAKE_CXX_FLAGS` option.
|
||||
@ -145,9 +145,9 @@ We list the most frequently used macros below. For a complete list, see file
|
||||
### Multi-threaded Tests
|
||||
|
||||
GoogleTest is thread-safe where the pthread library is available. After
|
||||
`#include <gtest/gtest.h>`, you can check the
|
||||
`GTEST_IS_THREADSAFE` macro to see whether this is the case (yes if the macro is
|
||||
`#defined` to 1, no if it's undefined.).
|
||||
`#include <gtest/gtest.h>`, you can check the `GTEST_IS_THREADSAFE` macro to see
|
||||
whether this is the case (yes if the macro is `#defined` to 1, no if it's
|
||||
undefined.).
|
||||
|
||||
If GoogleTest doesn't correctly detect whether pthread is available in your
|
||||
environment, you can force it with
|
||||
|
Loading…
x
Reference in New Issue
Block a user