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