这是indexloc提供的服务,不要输入任何密码
Skip to content

The 20211102.0 version uses unpublished GTEST_FLAG_GET macro from googletest #1063

@PawelWMS

Description

@PawelWMS

Describe the bug

In the 20211102.0 version of abseil-cpp some of the test code started using the GTEST_FLAG_GET macro. This causes the following build failures when attempting a CMake build with a pre-installed, latest released version (1.11.0) of googletest:

[ 47%] Built target absl_cord_internal_test"
absl/strings/cord_ring_test.cc: In function 'absl::lts_20211102::{anonymous}::Composition absl::lts_20211102::{anonymous}::RandomComposition()':"
absl/strings/cord_ring_test.cc:278:35: error: 'random_seed' was not declared in this scope; did you mean 'random_r'?"
  278 |   RandomEngine rng(GTEST_FLAG_GET(random_seed));"
      |                                   ^~~~~~~~~~~"
      |                                   random_r"
absl/strings/cord_ring_test.cc:278:20: error: 'GTEST_FLAG_GET' was not declared in this scope; did you mean 'GTEST_FLAG'?"
  278 |   RandomEngine rng(GTEST_FLAG_GET(random_seed));"
      |                    ^~~~~~~~~~~~~~"
      |                    GTEST_FLAG"

After taking a look at the GoogleTest GitHub repository it seems, that the changes introducing this macro are only present in the main branch but haven't been packed into an official release, yet.

Steps to reproduce the bug

  1. Install the 1.11.0 version of GoogleTest.
  2. Configure the abseil-cpp build with CMake (version >= 3.20.0) and the -DABSL_FIND_GOOGLETEST=ON -DABSL_USE_EXTERNAL_GOOGLETEST=ON -DBUILD_TESTING=ON options.
  3. Build with make.

What version of Abseil are you using?

20211102.0

What operating system and version are you using

Docker container on a Ubuntu 18.04 host.

What compiler and version are you using?

gcc: 9.1.0

What build system are you using?

cmake: 3.21.4
make: 4.2.1

Additional context

None.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions