llvm-project
ebf12390 - [libc][test] Split PigweedTest.h out of GTest.h (#247278)

Commit
1 day ago
[libc][test] Split PigweedTest.h out of GTest.h (#247278) Test.h previously routed LIBC_COPT_TEST_USE_PIGWEED to GTest.h with a TODO to migrate Pigweed onto LIBC_COPT_TEST_USE_GTEST. However, Pigweed's pw_unit_test:light backend does not provide ::testing::Matcher or gmock-style matchers, so sharing GTest.h fails to compile against pw_unit_test:light and leaves LIBC_TEST_HAS_MATCHERS() enabled when matchers are unavailable. Give LIBC_COPT_TEST_USE_PIGWEED its own minimal PigweedTest.h adapter that exports LIBC_NAMESPACE::testing::Test from <gtest/gtest.h> and defines LIBC_TEST_HAS_MATCHERS() as (0), matching ZxTest.h. This keeps Pigweed builds working against pw_unit_test:light while allowing GTest.h to rely on real GoogleTest and GoogleMock facilities. Part of #91630 Assisted-by: Gemini
Author
Parents
Loading