freebsd-nq/cddl/usr.sbin/dtrace/tests/Makefile.inc1
Mark Johnston 41aeaf2a30 Replace dtest.pl, the upstream DTrace test suite harness, with a shell
script. This reimplementation is much simpler than dtest.pl and is more
amenable to being run under Kyua - dtest.pl writes error output to a
temporary directory that is deleted when the run finishes, making it hard
to debug test failures. This change also removes the test suite's dependency
on perl.
2015-03-30 04:01:49 +00:00

53 lines
1.4 KiB
Makefile

# $FreeBSD$
TESTGROUP= ${.CURDIR:H:T}/${.CURDIR:T}
TESTSRC= ${.CURDIR:H:H:H:H:H}/contrib/opensolaris/cmd/dtrace/test/tst/${TESTGROUP}
TESTSDIR= ${TESTSBASE}/cddl/usr.sbin/dtrace/${TESTGROUP}
.if !defined(_RECURSING_PROGS)
FILESGROUPS+= FILES ${TESTGROUP} ${TESTGROUP}EXE
${TESTGROUP}= ${TESTFILES}
${TESTGROUP}EXE= ${TESTEXES}
${TESTGROUP}EXEMODE= 0555
${TESTGROUP}DIR= ${TESTSDIR}
${TESTGROUP}EXEDIR= ${TESTSDIR}
TESTWRAPPER= t_dtrace_contrib
ATF_TESTS_SH+= ${TESTWRAPPER}
TEST_METADATA.t_dtrace_contrib+= required_files="/usr/local/bin/ksh"
TEST_METADATA.t_dtrace_contrib+= required_user="root"
GENTEST?= ${.CURDIR:H:H}/tools/gentest.sh
EXCLUDE= ${.CURDIR:H:H}/tools/exclude.sh
${TESTWRAPPER}.sh: ${GENTEST} ${EXCLUDE} ${${TESTGROUP}}
sh ${GENTEST} -e ${EXCLUDE} ${TESTGROUP} ${${TESTGROUP}:S/ */ /} > ${.TARGET}
CLEANFILES+= ${TESTWRAPPER}.sh
.endif # !defined(_RECURSING_PROGS)
.PATH: ${TESTSRC}
PROGS= ${CFILES:T:S/.c$/.exe/g}
.for prog in ${PROGS}
SRCS.${prog}+= ${prog:S/.exe$/.c/}
BINDIR.${prog}= ${TESTSDIR}
MAN.${prog}=
.if exists(${prog:S/^tst.//:S/.exe$/.d/})
SRCS.${prog}+= ${prog:S/^tst.//:S/.exe$/.d/}
.endif
.endfor
# Some tests depend on the internals of their corresponding test programs,
# so make sure the optimizer doesn't interfere with them.
CFLAGS+= -O0
# Test programs shouldn't be stripped; else we generally can't use the PID
# provider.
DEBUG_FLAGS= -g
STRIP=
.include <bsd.test.mk>