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