diff --git a/lib/libcasper/services/cap_dns/Makefile b/lib/libcasper/services/cap_dns/Makefile index 2582fe89b14c..6f7dbd580201 100644 --- a/lib/libcasper/services/cap_dns/Makefile +++ b/lib/libcasper/services/cap_dns/Makefile @@ -1,5 +1,7 @@ # $FreeBSD$ +.include + PACKAGE=libcasper LIB= cap_dns @@ -15,4 +17,8 @@ LIBADD= nv CFLAGS+=-I${.CURDIR} +.if ${MK_TESTS} != "no" +SUBDIR+= tests +.endif + .include diff --git a/lib/libcasper/services/cap_dns/tests/Makefile b/lib/libcasper/services/cap_dns/tests/Makefile new file mode 100644 index 000000000000..38af7117fe2f --- /dev/null +++ b/lib/libcasper/services/cap_dns/tests/Makefile @@ -0,0 +1,11 @@ +# $FreeBSD$ + +TAP_TESTS_C= dns_test + +LIBADD+= casper +LIBADD+= cap_dns +LIBADD+= nv + +WARNS?= 3 + +.include diff --git a/tools/regression/capsicum/libcasper/dns.c b/lib/libcasper/services/cap_dns/tests/dns_test.c similarity index 100% rename from tools/regression/capsicum/libcasper/dns.c rename to lib/libcasper/services/cap_dns/tests/dns_test.c diff --git a/lib/libcasper/services/cap_grp/Makefile b/lib/libcasper/services/cap_grp/Makefile index 195b08d25777..a620be11b814 100644 --- a/lib/libcasper/services/cap_grp/Makefile +++ b/lib/libcasper/services/cap_grp/Makefile @@ -1,5 +1,7 @@ # $FreeBSD$ +.include + PACKAGE=libcasper LIB= cap_grp @@ -15,4 +17,8 @@ LIBADD= nv CFLAGS+=-I${.CURDIR} +.if ${MK_TESTS} != "no" +SUBDIR+= tests +.endif + .include diff --git a/lib/libcasper/services/cap_grp/tests/Makefile b/lib/libcasper/services/cap_grp/tests/Makefile new file mode 100644 index 000000000000..656188513188 --- /dev/null +++ b/lib/libcasper/services/cap_grp/tests/Makefile @@ -0,0 +1,11 @@ +# $FreeBSD$ + +TAP_TESTS_C= grp_test + +LIBADD+= casper +LIBADD+= cap_grp +LIBADD+= nv + +WARNS?= 3 + +.include diff --git a/tools/regression/capsicum/libcasper/grp.c b/lib/libcasper/services/cap_grp/tests/grp_test.c similarity index 100% rename from tools/regression/capsicum/libcasper/grp.c rename to lib/libcasper/services/cap_grp/tests/grp_test.c diff --git a/lib/libcasper/services/cap_pwd/Makefile b/lib/libcasper/services/cap_pwd/Makefile index 3e604bd54c53..57876115db0b 100644 --- a/lib/libcasper/services/cap_pwd/Makefile +++ b/lib/libcasper/services/cap_pwd/Makefile @@ -1,5 +1,7 @@ # $FreeBSD$ +.include + PACKAGE=libcasper LIB= cap_pwd @@ -15,4 +17,8 @@ LIBADD= nv CFLAGS+=-I${.CURDIR} +.if ${MK_TESTS} != "no" +SUBDIR+= tests +.endif + .include diff --git a/lib/libcasper/services/cap_pwd/tests/Makefile b/lib/libcasper/services/cap_pwd/tests/Makefile new file mode 100644 index 000000000000..8c88753e59d1 --- /dev/null +++ b/lib/libcasper/services/cap_pwd/tests/Makefile @@ -0,0 +1,11 @@ +# $FreeBSD$ + +TAP_TESTS_C= pwd_test + +LIBADD+= casper +LIBADD+= cap_pwd +LIBADD+= nv + +WARNS?= 3 + +.include diff --git a/tools/regression/capsicum/libcasper/pwd.c b/lib/libcasper/services/cap_pwd/tests/pwd_test.c similarity index 100% rename from tools/regression/capsicum/libcasper/pwd.c rename to lib/libcasper/services/cap_pwd/tests/pwd_test.c diff --git a/lib/libcasper/services/cap_sysctl/Makefile b/lib/libcasper/services/cap_sysctl/Makefile index 7501f37ab4e0..d37b5dc461de 100644 --- a/lib/libcasper/services/cap_sysctl/Makefile +++ b/lib/libcasper/services/cap_sysctl/Makefile @@ -1,5 +1,7 @@ # $FreeBSD$ +.include + PACKAGE=libcasper LIB= cap_sysctl @@ -15,4 +17,8 @@ LIBADD= nv CFLAGS+=-I${.CURDIR} +.if ${MK_TESTS} != "no" +SUBDIR+= tests +.endif + .include diff --git a/lib/libcasper/services/cap_sysctl/tests/Makefile b/lib/libcasper/services/cap_sysctl/tests/Makefile new file mode 100644 index 000000000000..f8625ab98449 --- /dev/null +++ b/lib/libcasper/services/cap_sysctl/tests/Makefile @@ -0,0 +1,11 @@ +# $FreeBSD$ + +TAP_TESTS_C= sysctl_test + +LIBADD+= casper +LIBADD+= cap_sysctl +LIBADD+= nv + +WARNS?= 3 + +.include diff --git a/tools/regression/capsicum/libcasper/sysctl.c b/lib/libcasper/services/cap_sysctl/tests/sysctl_test.c similarity index 100% rename from tools/regression/capsicum/libcasper/sysctl.c rename to lib/libcasper/services/cap_sysctl/tests/sysctl_test.c diff --git a/tools/regression/capsicum/libcasper/Makefile b/tools/regression/capsicum/libcasper/Makefile deleted file mode 100644 index b024c3b50121..000000000000 --- a/tools/regression/capsicum/libcasper/Makefile +++ /dev/null @@ -1,32 +0,0 @@ -# $FreeBSD$ - -SERVICES= dns -SERVICES+= grp -SERVICES+= pwd -SERVICES+= sysctl - -CFLAGS= -O2 -pipe -std=gnu99 -fstack-protector -CFLAGS+= -Wsystem-headers -Werror -Wall -Wno-format-y2k -W -Wno-unused-parameter -CFLAGS+= -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Wreturn-type -CFLAGS+= -Wcast-qual -Wwrite-strings -Wswitch -Wshadow -Wunused-parameter -CFLAGS+= -Wcast-align -Wchar-subscripts -Winline -Wnested-externs -Wredundant-decls -CFLAGS+= -Wold-style-definition -Wno-pointer-sign - -CFLAGS+= -ggdb - -SERVTEST= ${SERVICES:=.t} - -all: ${SERVTEST} - -.for SERVICE in ${SERVICES} - -${SERVICE}.t: ${SERVICE}.c - ${CC} ${CFLAGS} ${@:.t=.c} -o $@ -lnv -lcasper -lcap_${@:.t=} - -.endfor - -test: all - @prove -r ${.CURDIR} - -clean: - rm -f ${SERVTEST}