]> CyberLeo.Net >> Repos - FreeBSD/releng/10.2.git/blob - share/mk/netbsd-tests.test.mk
- Copy stable/10@285827 to releng/10.2 in preparation for 10.2-RC1
[FreeBSD/releng/10.2.git] / share / mk / netbsd-tests.test.mk
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
20 LIBNETBSD_SRCDIR=       ${SRCTOP}/lib/libnetbsd
21 LIBNETBSD_OBJDIR=       ${OBJTOP}/lib/libnetbsd
22
23 .for t in ${NETBSD_ATF_TESTS_C}
24 CFLAGS.$t+=     -I${LIBNETBSD_SRCDIR} -I${SRCTOP}/contrib/netbsd-tests
25 LDFLAGS.$t+=    -L${LIBNETBSD_OBJDIR}
26
27 DPADD.$t+=      ${LIBNETBSD}
28 LDADD.$t+=      -lnetbsd
29
30 SRCS.$t?=       ${t:C/^/t_/:C/_test$//g}.c
31 .endfor
32
33 ATF_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}
39 ATF_TESTS_SH_SRC_$t?=   ${t:C/^/t_/:C/_test$//g}.sh
40 .endfor
41
42 ATF_TESTS_SH+=  ${NETBSD_ATF_TESTS_SH}
43
44 .endif
45
46 # vim: syntax=make