Roll third_party/googletest/src/ b514bdc89..eb2d85edd (93 commits)

https://chromium.googlesource.com/external/github.com/google/googletest.git/+log/b514bdc898e2..eb2d85edd0bf

$ git log b514bdc89..eb2d85edd --date=short --no-merges --format='%ad %ae %s'
2025-08-24 absl-team Remove unused syslog dependency for Fuchsia.
2025-08-19 absl-team Internal header include changes.
2025-08-16 absl-team Deprecate single-argument DoAll and Invoke.
2025-08-11 absl-team Update the document in typed tests to use using-declaration instead of typedef
2025-07-28 absl-team Provide a better error message when ASSERT and SKIP macros are used in methods that return values
2025-07-23 absl-team Skip the predicate on SIGSEGV in death-test on Android builds with API level <= 23.
2025-07-18 absl-team Fix the sample usage of `ConvertGenerator` by removing the type-id name.
2025-07-12 absl-team Automated Code Change
2025-07-04 absl-team Replace internal link in GoogleTest docs
2025-06-27 pizzud gtest: Reword fail_if_no_test_selected_message for sharding and filtering.
2025-06-24 absl-team Add documentation for exception matchers.
2025-06-13 absl-team Although the following paragraph explains there is a better solution, having this technique in the bullet point seems to suggest that this technique is considered as a valid alternative. It would be better to drop it or make it clear that this technique is not recommended.
2025-06-12 absl-team Add UnpackStructImpl for structs with 24, 25 and 26 fields.
2025-06-11 joel.langlois README.md: Fixed broken Markdown link formatting.
2025-06-10 absl-team Automated Code Change
2025-06-09 absl-team In MatcherCast, store the input value as its own type rather than as the Matcher type, to avoid dangling references
2025-06-09 pizzud googletest: Add a flag to fail if no tests were selected to run.
2025-06-05 absl-team Remove "blindly" from the gmock "uninteresting call" message.
2025-05-30 absl-team Fix unified diff headers.
2025-05-30 absl-team Use the provided length in ConditionalPrintAsText
2025-05-25 nextgen.gubka Fix extra ';' after member function definition
2025-05-22 absl-team Updates Google Analytics tracker.
2025-05-22 dcheng Print std::basic_string_view<Char> as a string literal
2025-05-20 dmauro Delete the absl polyfill support for std::any, std::optional and std::variant now that the absl types are aliases of the std types
2025-05-19 absl-team Add UnpackStructImpl specialization for 23 struct members.
2025-05-19 absl-team Use static_cast instead of ImplicitCast_ for character conversions
2025-05-15 dmauro GoogleTest CI Update
2025-05-13 mkruskal Add [[nodiscard]] to GetParam() to prevent accidental misuse.
2025-05-12 absl-team Clarify that the return value of `InvokeArgument` is not the return value of the action.
2025-05-01 absl-team gtest: Remove incorrect documentation of private headers as PIMPL idiom
2025-04-30 dmauro Update documentation for v1.17.0
2025-04-30 dmauro Update GoogleTest dependencies in preparation for release
2025-04-29 lar Use std::memcpy instead of a union to access floating point bits.
2025-04-29 dmauro Fix GCC15 warning that <ciso646> is deprecated in C++17
2025-04-23 absl-team AllOf, AnyOf, Optional: Avoid generating unnecessary match explanations
2025-04-17 dmauro Bump RE2 dependency to 2024-07-02.bcr.1
2025-04-09 jacobsa `gmock-actions`: add a missing conversion operator to `WithArgsAction`.
2025-04-09 jacobsa `gmock-actions`: run clang-format.
2025-03-26 durandal Remove obsolete references to LinuxThreads.
2025-03-21 absl-team Add UnpackStructImpl for structs with 22 fields.
2025-03-21 ototot Fix a typo
2025-03-20 absl-team Add a non-'const' overload for the function invoked by the IgnoreArgs action wrapper.
2025-03-18 wan Improve the failure messages of `ElementsAre()`, `ElementsAreArray()`, etc.
2025-03-11 wan Clarify the polymorphic matcher concept and explain how to define a composite matcher.
2025-03-11 wan Allow `DistanceFrom()` to use user-defined `abs()` by default.
2025-03-07 wan Add a `DistanceFrom()` matcher for general distance comparison.
2025-03-04 absl-team Add a `testing::ConvertGenerator` overload that accepts a converting functor. This allows the use of classes that do not have a converting ctor to the desired type.
2025-02-28 dmauro Try to warn the user when test filters do not match any tests
2025-02-27 pizzud googletest: Add testonly alias of :gtest for testonly cc_libraries to use.
2025-02-27 absl-team Add UnpackStructImpl for structs with 21 fields.
2025-02-26 dmauro Output to the test warning file if no tests are linked.
2025-02-24 wan Adds support for a --gtest_fail_if_no_test_linked flag to fail the test program if no test case is linked in (a common programmer mistake).
2025-02-21 dmauro GoogleTest C++17 cleanups   * Use `[[nodiscard]]` instead of GTEST_MUST_USE_RESULT_   * Use `[[maybe_unused]]` instead of  GTEST_INTERNAL_ATTRIBUTE_MAYBE_UNUSED   * Use `[[deprecated]]` instead of `GTEST_INTERNAL_DEPRECATED`   * Remove `GTEST_INTERNAL_NEED_REDUNDANT_CONSTEXPR_DECL`
2025-02-17 jmr Property: Promote note to warning
2025-02-12 dmauro Require C++17
2025-02-10 absl-team Add SaveArgByMove
2025-02-07 dmauro Update docs for v1.16.x branch
2025-02-06 dmauro Update GoogleTest deps in preparation for release
2025-02-06 dmauro Remove empty glob pattern, which is now an error.
2025-01-31 absl-team Pull Regexp syntax out of Death test section in advanced.md
2025-01-31 absl-team Fix extended regular expressions reference URL in advanced.md
2025-01-30 absl-team Export testsuite properties as XML elements, not attributes.
2025-01-16 absl-team Cast mutable lvalue references to const from testing::ResultOf
2025-01-15 absl-team Enable safe matcher casts from `Matcher<const T&>` to `Matcher<T>`.
2025-01-10 hector.dearman Default to color output for ghostty
2025-01-09 absl-team Document unexpected interaction with death test error code and gmock.
2025-01-08 absl-team Add UnpackStructImpl for structs with 20 fields.
2024-12-26 absl-team gtest: Output a canned test case for test suite setup / teardown failures in XML/JSON
2024-12-23 absl-team Put the fake Fuchsia SDK in a module extension
2024-12-16 absl-team the public version already has the const qualifier
2024-12-11 absl-team Update the links to ISTQB glossary.
2024-12-10 absl-team Add support for printing C++20 std::*_ordering types to gtest. Adds feature test macro for C++20 <compare> header, a pretty-printer, and tests. Inexplicably, these types aren't enums, so can't be handled with a switch.
2024-11-15 andy.soffer Fix documentation bug.
2024-11-04 absl-team Fixing a typo in the documentation of IsSubsetOf().
2024-10-31 absl-team Remove mention of using `ASSERT_...` statements inside custom matcher definitions.
2024-10-27 pbos Use FAIL() in GTEST_SKIP() documentation
2024-10-16 absl-team Avoid creating std::vector<const T> in UnorderedElementsAreArrayMatcher and others.
2024-10-14 absl-team This change adjusts how `ASSERT_NEAR` and `EXPECT_NEAR` treats infinity, such that `ASSERT_NEAR(inf, inf, 0)` passes. This makes the behavior more consistent with `ASSERT_EQ(inf, inf)` which succeeds.
2024-10-04 absl-team Automated Code Change
2024-10-01 absl-team Optional(): Add support for std::optional<>-like types lacking bool conversion.
2024-09-16 absl-team Use matcher's description in AnyOf when matcher has no explanation.
2024-08-29 absl-team Automated Code Change
2024-08-01 dmauro Update main to point to 1.15.2 patch release
2024-07-30 dmauro Remove auto-detection of Python toolchain from MODULE.bazel since it affects downstream users
2024-07-30 absl-team Directly include `gmock.h` and `gtest.h` in gmock-matchers tests.
2024-07-24 absl-team Use matcher's description in AllOf if matcher has no explanation.
2024-07-23 jacobsa gmock-actions: make DoAll convert to OnceAction via custom conversions.
2024-07-23 jacobsa Run clang-format.
2024-07-20 dmauro Change the Bazel build to use the canonical repo names used by Bzlmod and the Bazel Central Registry
2024-07-16 dmauro Update GoogleTest Bazel quickstart for Bzlmod
2024-07-16 dmauro Update main branch to reflect the release of 1.15.0
2024-07-16 absl-team Use matcher's description in AllOf if matcher has no explanation.
2024-07-15 absl-team Use matcher's description in AllOf if matcher has no explanation.

Created with:
  roll-dep third_party/googletest/src

Change-Id: I8352afc32791030187946292a2f5aca6fcc8a05a
Reviewed-on: https://chromium-review.googlesource.com/c/openscreen/+/6897921
Reviewed-by: Mark Foltz <[email protected]>
Commit-Queue: Mark Foltz <[email protected]>
2 files changed
tree: 19dc005cb9ae93996965bcd26e4239023f1b7f98
  1. build_overrides/
  2. cast/
  3. discovery/
  4. docs/
  5. gni/
  6. infra/
  7. osp/
  8. platform/
  9. test/
  10. testing/
  11. third_party/
  12. tools/
  13. util/
  14. .clang-format
  15. .gitignore
  16. .gitmodules
  17. .gn
  18. .vpython3
  19. AUTHORS
  20. BUILD.gn
  21. codereview.settings
  22. DEPS
  23. LICENSE
  24. OWNERS
  25. PRESUBMIT.py
  26. PRESUBMIT_test_mocks.py
  27. README.md
README.md

Open Screen Library

The Open Screen Library implements the Open Screen Protocol, Multicast DNS and DNS-SD, and the Chromecast protocols (discovery, application control, and media streaming).

The library consists of feature modules that share a common platform API that must be implemented and linked by the embedding application.

The major feature modules in the library can be used independently and have their own documentation:

Getting the code

Installing depot_tools

Library dependencies are managed using gclient, from the depot_tools repo.

To get gclient, run the following command in your terminal:

    git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git

Then add the depot_tools folder to your PATH environment variable.

Note that openscreen does not use other features of depot_tools like repo or drover. However, some git-cl functions do work, like git cl try, git cl format, git cl lint, and git cl upload.

Checking out code

From the parent directory of where you want the openscreen checkout (e.g., ~/my_project_dir), configure gclient and check out openscreen with the following commands:

    cd ~/my_project_dir
    gclient config https://chromium.googlesource.com/openscreen
    gclient sync

The first gclient command will create a default .gclient file in ~/my_project_dir that describes how to pull down the openscreen repository. The second command creates an openscreen/ subdirectory, downloads the source code, all third-party dependencies, and the toolchain needed to build things; and at their appropriate revisions.

Syncing your local checkout

To update your local checkout from the openscreen reference repository, just run

   cd ~/my_project_dir/openscreen
   git pull
   gclient sync

This will rebase any local commits on the remote top-of-tree, and update any dependencies that have changed.

Build setup

The following are the main tools are required for development/builds.

  • Installed by gclient automatically
    • Build file generator: gn (installed into buildtools/)
    • Code formatter: clang-format (installed into buildtools/)
    • Builder: ninja
    • Compiler/Linker: clang
  • Installed by you
    • JSON validator: yajsv
    • libstdc++
    • gcc
    • XCode

yajsv installation

  1. Install go from https://golang.org or your Linux package manager.
  2. go install github.com/neilpa/yajsv@latest

libstdc++ (Linux only)

Ensure that libstdc++ 8 is installed, as clang depends on the system instance of it. On Debian flavors, you can run:

   sudo apt-get install libstdc++-8-dev libstdc++6-8-dbg

XCode (Mac only)

You can install the XCode command-line tools only or the full version of XCode.

xcode-select --install

gcc (optional, Linux only)

Setting the gn argument is_clang=false on Linux enables building using gcc instead.

  mkdir out/debug-gcc
  gn gen out/debug-gcc --args="is_clang=false"

Note that g++ version 9 or newer must be installed. On Debian flavors you can run:

  sudo apt-get install gcc-9

Debug build

Setting the gn argument is_debug=true enables debug build.

  gn gen out/debug --args="is_debug=true"

gn configuration

Running gn args opens an editor that allows to create a list of arguments passed to every invocation of gn gen. gn args --list will list all of the possible arguments you can set.

  gn args out/debug

Building targets

We use the Open Screen Protocol demo application as an example, however, the instructions are essentially the same for all executable targets.

  mkdir out/debug
  gn gen out/debug             # Creates the build directory and necessary ninja files
  ninja -C out/debug osp_demo  # Builds the executable with ninja
  ./out/debug/osp_demo         # Runs the executable

The -C argument to ninja works just like it does for GNU Make: it specifies the working directory for the build. So the same could be done as follows:

  ./gn gen out/debug
  cd out/debug
  ninja osp_demo
  ./osp_demo

After editing a file, only ninja needs to be rerun, not gn. If you have edited a BUILD.gn file, ninja will re-run gn for you.

We recommend using autoninja instead of ninja, which takes the same command-line arguments but automatically parallelizes the build for your system, depending on number of processor cores, amount of RAM, etc.

Also, while specifying build targets is possible while using ninja, typically for development it is sufficient to just build everything, especially since the Open Screen repository is still quite small. That makes the invocation to the build system simplify to:

  autoninja -C out/debug

For details on running osp_demo, see its README.md.

Building all targets

Running ninja -C out/debug gn_all will build all non-test targets in the repository.

gn ls --type=executable out/debug will list all of the executable targets that can be built.

If you want to customize the build further, you can run gn args out/debug to pull up an editor for build flags. gn args --list out/debug prints all of the build flags available.

Building and running unit tests

  ninja -C out/debug openscreen_unittests
  ./out/debug/openscreen_unittests

Contributing changes

Open Screen library code should follow the Open Screen Library Style Guide.

This library uses Chromium Gerrit for patch management and code review (for better or worse). You will need to register for an account at chromium-review.googlesource.com to upload patches for review.

The following sections contain some tips about dealing with Gerrit for code reviews, specifically when pushing patches for review, getting patches reviewed, and committing patches.

Uploading a patch for review

The git cl tool handles details of interacting with Gerrit (the Chromium code review tool) and is recommended for pushing patches for review. Once you have committed changes locally, simply run:

  git cl format
  git cl upload

The first command will will auto-format the code changes using clang-format. Then, the second command runs the PRESUBMIT.py script to check style and, if it passes, a newcode review will be posted on chromium-review.googlesource.com.

If you make additional commits to your local branch, then running git cl upload again in the same branch will merge those commits into the ongoing review as a new patchset.

It's simplest to create a local git branch for each patch you want reviewed separately. git cl keeps track of review status separately for each local branch.

Addressing merge conflicts

If conflicting commits have been landed in the repository for a patch in review, Gerrit will flag the patch as having a merge conflict. In that case, use the instructions above to rebase your commits on top-of-tree and upload a new patchset with the merge conflicts resolved.

Tryjobs

Clicking the CQ DRY RUN button (also, confusingly, labeled COMMIT QUEUE +1) will run the current patchset through all LUCI builders and report the results. It is always a good idea get a green tryjob on a patch before sending it for review to avoid extra back-and-forth.

You can also run git cl try from the commandline to submit a tryjob.

Code reviews

Send your patch to one or more committers in the COMMITTERS file for code review. All patches must receive at least one LGTM by a committer before it can be submitted.

Submitting patches

After your patch has received one or more LGTM commit it by clicking the SUBMIT button (or, confusingly, COMMIT QUEUE +2) in Gerrit. This will run your patch through the builders again before committing to the main openscreen repository.

Additional resources