git: 906dced78237 - stable/14 - GoogleTest: run several tests as plain C++ tests
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Mon, 23 Nov 2026 05:57:32 UTC
The branch stable/14 has been updated by ngie:
URL: https://cgit.FreeBSD.org/src/commit/?id=906dced7823773de1747699aa9e68b664bbe6d3f
commit 906dced7823773de1747699aa9e68b664bbe6d3f
Author: Enji Cooper <ngie@FreeBSD.org>
AuthorDate: 2026-10-09 21:33:50 +0000
Commit: Enji Cooper <ngie@FreeBSD.org>
CommitDate: 2026-11-23 05:50:28 +0000
GoogleTest: run several tests as plain C++ tests
Some of the tests provided by GoogleTest don't play well with the kyua
GoogleTest engine available in 0.15.0, in part because they test
edgecases that the kyua GoogleTest engine does not expect or handle
gracefully.
Treat the tests as plain C++ tests to keep parity (result-wise) before
switching the testcase type from `plain` (what it is today under the
covers) to `googletest`.
MFC after: 1 month
MFC with: 3fb03fb35b20 ("[tests] switch GoogleTest tests to ...")
(cherry picked from commit eecc84de3572d1ee6caac1fa14dd3140c9601c9c)
---
lib/googletest/tests/gmock/Makefile | 3 ++-
lib/googletest/tests/gtest/Makefile | 21 ++++++++++++++-------
lib/googletest/tests/gtest_main/Makefile | 17 ++++++++++++-----
3 files changed, 28 insertions(+), 13 deletions(-)
diff --git a/lib/googletest/tests/gmock/Makefile b/lib/googletest/tests/gmock/Makefile
index 5df1f48c0e4a..672cd66ec44f 100644
--- a/lib/googletest/tests/gmock/Makefile
+++ b/lib/googletest/tests/gmock/Makefile
@@ -3,7 +3,8 @@
.PATH: ${GOOGLEMOCK_SRCROOT}/src ${GOOGLEMOCK_SRCROOT}/test
-GTESTS+= gmock_stress_test
+# This doesn't work with the googletest engine in kyua 0.15.0.
+PLAIN_TESTS_CXX+= gmock_stress_test
LIBADD+= pthread gtest gmock
diff --git a/lib/googletest/tests/gtest/Makefile b/lib/googletest/tests/gtest/Makefile
index 0000167dfe70..9fd25304a6bd 100644
--- a/lib/googletest/tests/gtest/Makefile
+++ b/lib/googletest/tests/gtest/Makefile
@@ -3,14 +3,21 @@
.PATH: ${GOOGLETEST_SRCROOT}/src ${GOOGLETEST_SRCROOT}/test
-GTESTS+= gtest_environment_test
-GTESTS+= gtest_no_test_unittest
-GTESTS+= googletest-param-test-test
GTESTS+= gtest_premature_exit_test
-GTESTS+= gtest_repeat_test
-GTESTS+= gtest_stress_test
-GTESTS+= gtest_throw_on_failure_ex_test
-GTESTS+= gtest-unittest-api_test
+# These test scenarios are't handled properly with the googletest engine in
+# kyua 0.15.0.
+PLAIN_TESTS_CXX+= gtest_environment_test
+PLAIN_TESTS_CXX+= gtest_no_test_unittest
+PLAIN_TESTS_CXX+= gtest_throw_on_failure_ex_test
+
+# NOTE: these tests rely on testing by side-effect with global variables/state
+# used in multiple testcases.
+#
+# Running this plain C++ tests gets around that problem.
+PLAIN_TESTS_CXX+= googletest-param-test-test
+PLAIN_TESTS_CXX+= gtest_repeat_test
+PLAIN_TESTS_CXX+= gtest_stress_test
+PLAIN_TESTS_CXX+= gtest-unittest-api_test
CXXFLAGS+= -I${GOOGLETEST_SRCROOT}/include
CXXFLAGS+= -I${GOOGLETEST_SRCROOT}
diff --git a/lib/googletest/tests/gtest_main/Makefile b/lib/googletest/tests/gtest_main/Makefile
index 3124042f8b95..58e84458a86d 100644
--- a/lib/googletest/tests/gtest_main/Makefile
+++ b/lib/googletest/tests/gtest_main/Makefile
@@ -4,8 +4,6 @@
.PATH: ${GOOGLETEST_SRCROOT}/src ${GOOGLETEST_SRCROOT}/test
GTESTS+= googletest-death-test-test
-GTESTS+= googletest-filepath-test
-GTESTS+= googletest-listener-test
GTESTS+= googletest-message-test
GTESTS+= googletest-options-test
GTESTS+= googletest-port-test
@@ -15,10 +13,19 @@ GTESTS+= gtest-typed-test_test
GTESTS+= gtest_main_unittest
GTESTS+= gtest_pred_impl_unittest
GTESTS+= gtest_prod_test
-GTESTS+= gtest_skip_test
-GTESTS+= gtest_skip_in_environment_setup_test
GTESTS+= gtest_sole_header_test
-GTESTS+= gtest_unittest
+
+# Crashes when listing testcases using googletest engine in kyua 0.15.0
+# (probably test bugs).
+PLAIN_TESTS_CXX+= googletest-filepath-test
+PLAIN_TESTS_CXX+= googletest-listener-test
+# These test scearios don't work with the googletest engine in kyua 0.15.0.
+PLAIN_TESTS_CXX+= gtest_skip_in_environment_setup_test
+PLAIN_TESTS_CXX+= gtest_skip_test
+# Some of the test scenarios show up as "skipped", when in reality they're just
+# testing skipped functionality. Don't inflate the testcase numbers
+# unnecessarily as it can serve to confuse downstream users.
+PLAIN_TESTS_CXX+= gtest_unittest
CXXFLAGS+= -I${GOOGLETEST_SRCROOT}/include
CXXFLAGS+= -I${GOOGLETEST_SRCROOT}