git: eecc84de3572 - main - GoogleTest: run several tests as plain C++ tests
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Thu, 29 Oct 2026 23:32:54 UTC
The branch main has been updated by ngie:
URL: https://cgit.FreeBSD.org/src/commit/?id=eecc84de3572d1ee6caac1fa14dd3140c9601c9c
commit eecc84de3572d1ee6caac1fa14dd3140c9601c9c
Author: Enji Cooper <ngie@FreeBSD.org>
AuthorDate: 2026-10-09 21:33:50 +0000
Commit: Enji Cooper <ngie@FreeBSD.org>
CommitDate: 2026-10-29 23:32:31 +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 ...")
---
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 493567100630..6ac12d2814d4 100644
--- a/lib/googletest/tests/gmock/Makefile
+++ b/lib/googletest/tests/gmock/Makefile
@@ -2,7 +2,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 5834ca788985..691dd5ce25ff 100644
--- a/lib/googletest/tests/gtest/Makefile
+++ b/lib/googletest/tests/gtest/Makefile
@@ -2,14 +2,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 de9bc2f4a78a..517ec804692a 100644
--- a/lib/googletest/tests/gtest_main/Makefile
+++ b/lib/googletest/tests/gtest_main/Makefile
@@ -3,8 +3,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
@@ -14,10 +12,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}