Files
freebsd-src/share/mk/googletest.test.mk
Enji Cooper 3fb03fb35b [tests] switch GoogleTest tests to googletest interface
The new `googletest` kyua test interface--added in 0.15.0 and fixed in
0.15.1--allows tests to be executed and handled in a more fine-grained
manner than the way it was prior to this commit.

This change deletes the `capsicum-test` ATF wrapper script,
`functional.sh`, and all supporting logic in `googletest.test.mk` as
well as this change makes that logic unnecessary.

MFC after:	1 month
MFC with:	b68969979d ("contrib/kyua: update to 0.15.1")
2026-10-29 16:32:11 -07:00

38 lines
1012 B
Makefile

#
# You must include bsd.test.mk instead of this file from your Makefile.
#
# Logic to build and install GoogleTest based test programs.
#
# GoogleTest is a C++ test framework, thus, it does not describe/articulate how
# to write tests in other languages, e.g., C or shell, unlike the ATF, plain,
# and TAP raw test interfaces.
.if !target(__<bsd.test.mk>__)
.error googletest.test.mk cannot be included directly.
.endif
# List of GoogleTest test programs to build.
#
# Programs listed here are built according to the semantics of bsd.progs.mk for
# PROGS_CXX.
#
# Test programs registered in this manner are set to be installed into TESTSDIR
# (which should be overridden by the Makefile) and are not required to provide a
# manpage.
GTESTS?=
.if !empty(GTESTS)
.include <googletest.test.inc.mk>
PROGS_CXX+= ${GTESTS}
.for _T in ${GTESTS}
BINDIR.${_T}= ${TESTSDIR}
CXXFLAGS.${_T}+= ${GTESTS_CXXFLAGS}
MAN.${_T}?= # empty
SRCS.${_T}?= ${_T}.cc
_TESTS+= ${_T}
TEST_INTERFACE.${_T}= googletest
.endfor
.endif