Update documentation for v1.17.0

PiperOrigin-RevId: 753214894
Change-Id: I5ec24399301dcc7e70b179db98e175f45374e3c2
This commit is contained in:
Derek Mauro 2025-04-30 10:11:13 -07:00 committed by Copybara-Service
parent 54915d462b
commit 04ee1b4f2a
4 changed files with 21 additions and 32 deletions

View File

@ -2,30 +2,19 @@
### Announcements ### 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 #### Documentation Updates
Our documentation is now live on GitHub Pages at Our documentation is now live on GitHub Pages at
https://google.github.io/googletest/. We recommend browsing the documentation on https://google.github.io/googletest/. We recommend browsing the documentation on
GitHub Pages rather than directly in the repository. 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. now available.
The 1.16.x branch requires at least C++14. The 1.17.x branch [requires at least
C++17]((https://opensource.google/documentation/policies/cplusplus-support#c_language_standard).
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).
#### Continuous Integration #### Continuous Integration

View File

@ -9,7 +9,7 @@ we recommend this tutorial as a starting point.
To complete this tutorial, you'll need: To complete this tutorial, you'll need:
* A compatible operating system (e.g. Linux, macOS, Windows). * 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 * [Bazel](https://bazel.build/) 7.0 or higher, the preferred build system used
by the GoogleTest team. by the GoogleTest team.
@ -48,7 +48,7 @@ with the following content:
# Choose the most recent version available at # Choose the most recent version available at
# https://registry.bazel.build/modules/googletest # 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. 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). [Bazel C++ Tutorial](https://docs.bazel.build/versions/main/tutorial/cpp.html).
{: .callout .note} {: .callout .note}
NOTE: In the example below, we assume Clang or GCC and set `--cxxopt=-std=c++14` NOTE: In the example below, we assume Clang or GCC and set `--cxxopt=-std=c++17`
to ensure that GoogleTest is compiled as C++14 instead of the compiler's default to ensure that GoogleTest is compiled as C++17 instead of the compiler's default
setting (which could be C++11). For MSVC, the equivalent would be setting. For MSVC, the equivalent would be `--cxxopt=/std:c++17`. See
`--cxxopt=/std:c++14`. See [Supported Platforms](platforms.md) for more details [Supported Platforms](platforms.md) for more details on supported language
on supported language versions. versions.
Now you can build and run your test: Now you can build and run your test:
<pre> <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: Analyzed target //:hello_test (26 packages loaded, 362 targets configured).
INFO: Found 1 test target... INFO: Found 1 test target...
INFO: From Testing //:hello_test: INFO: From Testing //:hello_test:

View File

@ -10,7 +10,7 @@ this tutorial as a starting point. If your project uses Bazel, see the
To complete this tutorial, you'll need: To complete this tutorial, you'll need:
* A compatible operating system (e.g. Linux, macOS, Windows). * 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 * [CMake](https://cmake.org/) and a compatible build tool for building the
project. project.
* Compatible build tools include * 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) cmake_minimum_required(VERSION 3.14)
project(my_project) project(my_project)
# GoogleTest requires at least C++14 # GoogleTest requires at least C++17
set(CMAKE_CXX_STANDARD 14) set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON) set(CMAKE_CXX_STANDARD_REQUIRED ON)
include(FetchContent) include(FetchContent)

View File

@ -25,7 +25,7 @@ When building GoogleTest as a standalone project, the typical workflow starts
with 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. cd googletest # Main directory of the cloned repository.
mkdir build # Create a directory to hold the build output. mkdir build # Create a directory to hold the build output.
cd build cd build
@ -124,9 +124,9 @@ match the project in which it is included.
#### C++ Standard Version #### 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 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 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 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. 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 ### Multi-threaded Tests
GoogleTest is thread-safe where the pthread library is available. After GoogleTest is thread-safe where the pthread library is available. After
`#include <gtest/gtest.h>`, you can check the `#include <gtest/gtest.h>`, you can check the `GTEST_IS_THREADSAFE` macro to see
`GTEST_IS_THREADSAFE` macro to see whether this is the case (yes if the macro is whether this is the case (yes if the macro is `#defined` to 1, no if it's
`#defined` to 1, no if it's undefined.). undefined.).
If GoogleTest doesn't correctly detect whether pthread is available in your If GoogleTest doesn't correctly detect whether pthread is available in your
environment, you can force it with environment, you can force it with