3 # Logic to build and install TAP-compliant test programs.
5 # This is provided to support existing tests in the FreeBSD source tree
6 # (particularly those coming from tools/regression/) that comply with the
7 # Test Anything Protocol. It should not be used for new tests.
11 # List of C, C++ and shell test programs to build.
13 # Programs listed here are built according to the semantics of bsd.prog.mk for
14 # PROGS, PROGS_CXX and SCRIPTS, respectively.
16 # Test programs registered in this manner are set to be installed into TESTSDIR
17 # (which should be overriden by the Makefile) and are not required to provide a
23 .if !empty(TAP_TESTS_C)
24 PROGS+= ${TAP_TESTS_C}
25 _TESTS+= ${TAP_TESTS_C}
26 .for _T in ${TAP_TESTS_C}
27 BINDIR.${_T}= ${TESTSDIR}
30 TEST_INTERFACE.${_T}= tap
34 .if !empty(TAP_TESTS_CXX)
35 PROGS_CXX+= ${TAP_TESTS_CXX}
36 _TESTS+= ${TAP_TESTS_CXX}
37 .for _T in ${TAP_TESTS_CXX}
38 BINDIR.${_T}= ${TESTSDIR}
41 TEST_INTERFACE.${_T}= tap
45 .if !empty(TAP_TESTS_SH)
46 SCRIPTS+= ${TAP_TESTS_SH}
47 _TESTS+= ${TAP_TESTS_SH}
48 .for _T in ${TAP_TESTS_SH}
49 SCRIPTSDIR_${_T}= ${TESTSDIR}
50 TEST_INTERFACE.${_T}= tap
51 CLEANFILES+= ${_T} ${_T}.tmp
52 # TODO(jmmv): It seems to me that this SED and SRC functionality should
53 # exist in bsd.prog.mk along the support for SCRIPTS. Move it there if
54 # this proves to be useful within the tests.
55 TAP_TESTS_SH_SED_${_T}?= # empty
56 TAP_TESTS_SH_SRC_${_T}?= ${_T}.sh
57 ${_T}: ${TAP_TESTS_SH_SRC_${_T}}
58 cat ${.ALLSRC} | sed ${TAP_TESTS_SH_SED_${_T}} >${.TARGET}.tmp
59 chmod +x ${.TARGET}.tmp
60 mv ${.TARGET}.tmp ${.TARGET}
64 .include <bsd.test.mk>