From 0c90c9ad4649789feec86c776674491c35cc7e27 Mon Sep 17 00:00:00 2001 From: Lexi Winter Date: Thu, 6 Nov 2025 14:34:41 +0000 Subject: [PATCH] lib/googletest: Move to a new googletest package gtest/gmock are not normally used by users unless running the tests, so they shouldn't be in the utilities package. Move them to a new googletest package, to match what we did with ATF/Kyua. While here, move tests dependencies from tests-all.ucl to tests.ucl, which is the canonical place for that. This change adds a new package to the system so, until we have a proper policy on how to handle this in release/stable branches, it should not be MFC'd. MFC after: never Reported by: emaste Reviewed by: manu Sponsored by: https://www.patreon.com/bsdivy Differential Revision: https://reviews.freebsd.org/D53607 --- lib/googletest/Makefile.inc | 2 ++ lib/googletest/tests/Makefile | 3 +++ lib/googletest/tests/Makefile.inc | 2 ++ release/packages/ucl/googletest-all.ucl | 33 +++++++++++++++++++++++++ release/packages/ucl/tests-all.ucl | 18 -------------- release/packages/ucl/tests.ucl | 23 +++++++++++++++-- 6 files changed, 61 insertions(+), 20 deletions(-) create mode 100644 release/packages/ucl/googletest-all.ucl diff --git a/lib/googletest/Makefile.inc b/lib/googletest/Makefile.inc index 231d7545f36..43ebace19a1 100644 --- a/lib/googletest/Makefile.inc +++ b/lib/googletest/Makefile.inc @@ -1,5 +1,7 @@ .include +PACKAGE?= googletest + GTEST_DIR= ${SRCTOP}/contrib/googletest GOOGLEMOCK_SRCROOT= ${GTEST_DIR}/googlemock GOOGLETEST_SRCROOT= ${GTEST_DIR}/googletest diff --git a/lib/googletest/tests/Makefile b/lib/googletest/tests/Makefile index 886b1a2fe49..350e0fe765f 100644 --- a/lib/googletest/tests/Makefile +++ b/lib/googletest/tests/Makefile @@ -1,4 +1,7 @@ .PATH: ${SRCTOP}/tests + +PACKAGE= tests + KYUAFILE= yes # Note: we start the gmock_main and gmock tests first since those take up to diff --git a/lib/googletest/tests/Makefile.inc b/lib/googletest/tests/Makefile.inc index 9691aaa93de..8d19e1fafde 100644 --- a/lib/googletest/tests/Makefile.inc +++ b/lib/googletest/tests/Makefile.inc @@ -3,6 +3,8 @@ # rather than installing all of them to /usr/tests/lib/googletest TESTSDIR= ${TESTSBASE}/lib/googletest/${.CURDIR:T} +PACKAGE= tests + # Clang's optimizer spends a really long time on these tests at -O2. Changing # -O2 to -O1 reduces the -j32 time for lib/googletest/test from 131s to 71s. # Using -O0 further reduces the time to 29s, and also reduces the disk usage diff --git a/release/packages/ucl/googletest-all.ucl b/release/packages/ucl/googletest-all.ucl new file mode 100644 index 00000000000..889e8a65f31 --- /dev/null +++ b/release/packages/ucl/googletest-all.ucl @@ -0,0 +1,33 @@ +/* + * SPDX-License-Identifier: ISC + * + * Copyright (c) 2025 Lexi Winter + * + * Permission to use, copy, modify, and distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + +comment = "Unit testing framework" + +desc = <