Add the bsd.test.mk file
This file simplifies the build of test programs, either written in C++ or in sh. It hides the internals of atf, e.g. by silently linking against -latf or calling atf-compile. It also takes care of installing an Atffile for each new test directory.
This commit is contained in:
parent
12408017c4
commit
dd2f8250cc
@ -1,4 +1,4 @@
|
||||
# $NetBSD: mi,v 1.1081 2007/11/12 15:00:02 jmmv Exp $
|
||||
# $NetBSD: mi,v 1.1082 2007/11/12 15:05:15 jmmv Exp $
|
||||
./etc/mtree/set.comp comp-sys-root
|
||||
./usr/bin/addr2line comp-debug-bin bfd
|
||||
./usr/bin/ar comp-util-bin bfd
|
||||
@ -12506,5 +12506,6 @@
|
||||
./usr/share/mk/bsd.shlib.mk comp-util-share share
|
||||
./usr/share/mk/bsd.subdir.mk comp-util-share share
|
||||
./usr/share/mk/bsd.sys.mk comp-util-share share
|
||||
./usr/share/mk/bsd.test.mk comp-util-share share
|
||||
./usr/share/mk/bsd.x11.mk comp-util-share share
|
||||
./var/db/libc.tags comp-c-root
|
||||
|
@ -1,4 +1,4 @@
|
||||
# $NetBSD: Makefile,v 1.39 2007/08/05 21:50:32 pooka Exp $
|
||||
# $NetBSD: Makefile,v 1.40 2007/11/12 15:05:16 jmmv Exp $
|
||||
# @(#)Makefile 8.1 (Berkeley) 6/8/93
|
||||
|
||||
NOOBJ= # defined
|
||||
@ -11,7 +11,7 @@ FILES= bsd.README bsd.doc.mk bsd.dep.mk bsd.endian.mk bsd.files.mk \
|
||||
bsd.init.mk bsd.kernobj.mk bsd.kinc.mk bsd.klinks.mk bsd.kmod.mk \
|
||||
bsd.lib.mk bsd.links.mk bsd.man.mk bsd.nls.mk bsd.obj.mk bsd.own.mk \
|
||||
bsd.prog.mk bsd.rpc.mk bsd.shlib.mk bsd.subdir.mk bsd.sys.mk \
|
||||
bsd.x11.mk sys.mk
|
||||
bsd.test.mk bsd.x11.mk sys.mk
|
||||
|
||||
FILESDIR=/usr/share/mk
|
||||
.endif
|
||||
|
42
share/mk/bsd.test.mk
Normal file
42
share/mk/bsd.test.mk
Normal file
@ -0,0 +1,42 @@
|
||||
# $NetBSD: bsd.test.mk,v 1.1 2007/11/12 15:05:16 jmmv Exp $
|
||||
#
|
||||
|
||||
TESTSBASE= /usr/tests
|
||||
TESTSDIR?= ${TESTSBASE}${.CURDIR:S/^${NETBSDSRCDIR}\/tests//}
|
||||
|
||||
_TESTS= # empty
|
||||
|
||||
.if defined(TESTS_CXX)
|
||||
PROGS_CXX+= ${TESTS_CXX}
|
||||
LDADD+= -latf
|
||||
. for _T in ${TESTS_CXX}
|
||||
BINDIR.${_T}= ${TESTSDIR}
|
||||
MAN.${_T}?= # empty
|
||||
_TESTS+= ${_T}
|
||||
. endfor
|
||||
.endif
|
||||
|
||||
.if defined(TESTS_SH)
|
||||
|
||||
. for _T in ${TESTS_SH}
|
||||
SCRIPTS+= ${_T}
|
||||
SCRIPTSDIR_${_T}= ${TESTSDIR}
|
||||
|
||||
_TESTS+= ${_T}
|
||||
CLEANFILES+= ${_T} ${_T}.tmp
|
||||
|
||||
TESTS_SH_SRC_${_T}?= ${_T}.sh
|
||||
${_T}: ${TESTS_SH_SRC_${_T}}
|
||||
${_MKTARGET_BUILD}
|
||||
${TOOL_ATF_COMPILE} -o ${.TARGET}.tmp ${.ALLSRC}
|
||||
mv ${.TARGET}.tmp ${.TARGET}
|
||||
. endfor
|
||||
.endif
|
||||
|
||||
FILES+= Atffile
|
||||
FILESDIR_Atffile= ${TESTSDIR}
|
||||
.include <bsd.files.mk>
|
||||
|
||||
.if !empty(SCRIPTS) || !empty(PROGS_CXX)
|
||||
. include <bsd.prog.mk>
|
||||
.endif
|
Loading…
Reference in New Issue
Block a user