xref: /freebsd/share/mk/netbsd-tests.test.mk (revision 895f86f15fbf6540071feb9328c3c50ed1f027b8)
1# $FreeBSD$
2
3.if !target(__netbsd_tests.test.mk__)
4__netbsd_tests.test.mk__:
5
6TESTSRC?=	${SRCTOP}/contrib/netbsd-tests/${RELDIR:H}
7
8.if !exists(${TESTSRC}/)
9.error "Please define TESTSRC to the absolute path of the test sources, e.g. $${SRCTOP}/contrib/netbsd-tests/lib/libc/stdio"
10.endif
11
12.PATH: ${TESTSRC}
13
14LIBNETBSD_SRCDIR=	${SRCTOP}/lib/libnetbsd
15LIBNETBSD_OBJDIR=	${OBJTOP}/lib/libnetbsd
16
17.for t in ${NETBSD_ATF_TESTS_C}
18CFLAGS.$t+=	-I${LIBNETBSD_SRCDIR} -I${SRCTOP}/contrib/netbsd-tests
19LDFLAGS.$t+=	-L${LIBNETBSD_OBJDIR}
20
21DPADD.$t+=	${LIBNETBSD}
22LDADD.$t+=	-lnetbsd
23
24SRCS.$t?=	${t:C/^/t_/:C/_test$//g}.c
25.endfor
26
27ATF_TESTS_C+=	${NETBSD_ATF_TESTS_C}
28
29# A C++ analog isn't provided because there aren't any C++ testcases in
30# contrib/netbsd-tests
31
32.for t in ${NETBSD_ATF_TESTS_SH}
33ATF_TESTS_SH_SRC_$t?=	${t:C/^/t_/:C/_test$//g}.sh
34.endfor
35
36ATF_TESTS_SH+=	${NETBSD_ATF_TESTS_SH}
37
38.endif
39
40# vim: syntax=make
41