]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - share/mk/googletest.test.mk
ping(8): Fix a mandoc related issue
[FreeBSD/FreeBSD.git] / share / mk / googletest.test.mk
1 # $FreeBSD$
2 #
3 # You must include bsd.test.mk instead of this file from your Makefile.
4 #
5 # Logic to build and install GoogleTest based test programs.
6 #
7 # GoogleTest is a C++ test framework, thus, it does not describe/articulate how
8 # to write tests in other languages, e.g., C or shell, unlike the ATF, plain,
9 # and TAP raw test interfaces.
10 #
11 # For now this is a thin wrapper around the `plain` test interface, but in the
12 # future this will rely on a newer version of kyua which will integrate in
13 # GoogleTest support.
14
15 .if !target(__<bsd.test.mk>__)
16 .error googletest.test.mk cannot be included directly.
17 .endif
18
19 # List of GoogleTest test programs to build.
20 #
21 # Programs listed here are built according to the semantics of bsd.progs.mk for
22 # PROGS_CXX.
23 #
24 # Test programs registered in this manner are set to be installed into TESTSDIR
25 # (which should be overridden by the Makefile) and are not required to provide a
26 # manpage.
27 GTESTS?=
28
29 .if !empty(GTESTS)
30 .include <googletest.test.inc.mk>
31
32 PROGS_CXX+= ${GTESTS}
33 .for _T in ${GTESTS}
34 BINDIR.${_T}= ${TESTSDIR}
35 CXXFLAGS.${_T}+= ${GTESTS_CXXFLAGS}
36 MAN.${_T}?= # empty
37 SRCS.${_T}?= ${_T}.cc
38 .if !empty(GTESTS_WRAPPER_SH.${_T})
39 # A stopgap/workaround to let kyua execute test case one by one
40 ATF_TESTS_SH+= ${GTESTS_WRAPPER_SH.${_T}}
41 .else
42 _TESTS+= ${_T}
43 TEST_INTERFACE.${_T}= plain
44 .endif
45
46 .endfor
47 .endif