xref: /freebsd/cddl/usr.sbin/dtrace/tests/dtrace.test.mk (revision d65cd7a57bf0600b722afc770838a5d0c1c3a8e1)
1# $FreeBSD$
2
3TESTGROUP= ${.CURDIR:H:T}/${.CURDIR:T}
4TESTBASE= ${SRCTOP}/cddl/contrib/opensolaris/cmd/dtrace/test/tst
5TESTSRC= ${TESTBASE}/${TESTGROUP}
6TESTSDIR= ${TESTSBASE}/cddl/usr.sbin/dtrace/${TESTGROUP}
7
8FILESGROUPS+=	${TESTGROUP}EXE
9
10${TESTGROUP}EXE= ${TESTEXES}
11${TESTGROUP}EXEMODE= 0555
12${TESTGROUP}EXEPACKAGE=	${PACKAGE}
13
14TESTWRAPPER=	t_dtrace_contrib
15ATF_TESTS_SH+=	${TESTWRAPPER}
16TEST_METADATA.t_dtrace_contrib+= required_files="/usr/local/bin/ksh"
17TEST_METADATA.t_dtrace_contrib+= required_user="root"
18
19GENTEST?=	${.CURDIR:H:H}/tools/gentest.sh
20EXCLUDE=	${.CURDIR:H:H}/tools/exclude.sh
21${TESTWRAPPER}.sh: ${GENTEST} ${EXCLUDE} ${${PACKAGE}FILES}
22	env TESTBASE=${TESTBASE:Q} \
23	    sh ${GENTEST} -e ${EXCLUDE} ${TESTGROUP} ${${PACKAGE}FILES:S/ */ /} > ${.TARGET}
24
25CLEANFILES+=	${TESTWRAPPER}.sh
26
27.PATH:	${TESTSRC}
28
29PROGS=		${CFILES:T:S/.c$/.exe/g}
30.for prog in ${PROGS}
31SRCS.${prog}+= ${prog:S/.exe$/.c/}
32
33.if exists(${prog:S/^tst.//:S/.exe$/.d/})
34SRCS.${prog}+=	${prog:S/^tst.//:S/.exe$/.d/}
35.endif
36.endfor
37
38BINDIR=		${TESTSDIR}
39MAN=
40
41# Some tests depend on the internals of their corresponding test programs,
42# so make sure the optimizer doesn't interfere with them.
43CFLAGS+=	-O0
44
45# Test programs shouldn't be stripped; else we generally can't use the PID
46# provider.
47DEBUG_FLAGS=	-g
48STRIP=
49
50.include <bsd.test.mk>
51