diff --git a/etc/mtree/BSD.tests.dist b/etc/mtree/BSD.tests.dist index 037c9970ed50..da64e3473ccc 100644 --- a/etc/mtree/BSD.tests.dist +++ b/etc/mtree/BSD.tests.dist @@ -68,6 +68,14 @@ .. .. .. + sbin + dhclient + .. + growfs + .. + mdconfig + .. + .. share examples tests diff --git a/sbin/Makefile b/sbin/Makefile index 9ee8ea37e529..fcf17099de96 100644 --- a/sbin/Makefile +++ b/sbin/Makefile @@ -118,6 +118,10 @@ SUBDIR+= quotacheck SUBDIR+= routed .endif +.if ${MK_TESTS} != "no" +SUBDIR+= tests +.endif + .include SUBDIR:= ${SUBDIR:O} diff --git a/sbin/dhclient/Makefile b/sbin/dhclient/Makefile index 74d1c4d9dea9..57c92118d131 100644 --- a/sbin/dhclient/Makefile +++ b/sbin/dhclient/Makefile @@ -31,6 +31,8 @@ # OF THE POSSIBILITY OF SUCH DAMAGE. # +.include + SRCS= dhclient.c clparse.c alloc.c dispatch.c hash.c bpf.c options.c \ tree.c conflex.c errwarn.c inet.c packet.c convert.c tables.c \ parse.c privsep.c @@ -44,4 +46,8 @@ LDADD= -lutil WARNS?= 2 +.if ${MK_TESTS} != "no" +SUBDIR+= tests +.endif + .include diff --git a/sbin/dhclient/tests/Makefile b/sbin/dhclient/tests/Makefile new file mode 100644 index 000000000000..b092eead050d --- /dev/null +++ b/sbin/dhclient/tests/Makefile @@ -0,0 +1,15 @@ +# $FreeBSD$ + +TESTSDIR= ${TESTSBASE}/sbin/dhclient + +.PATH: ${.CURDIR}/.. + +PLAIN_TESTS_C= option-domain-search_test +SRCS.option-domain-search_test= alloc.c convert.c hash.c options.c \ + tables.c fake.c option-domain-search.c +CFLAGS.option-domain-search_test+= -I${.CURDIR}/.. +LDADD.option-domain-search_test= -lutil + +WARNS?= 2 + +.include diff --git a/tools/regression/sbin/dhclient/fake.c b/sbin/dhclient/tests/fake.c similarity index 100% rename from tools/regression/sbin/dhclient/fake.c rename to sbin/dhclient/tests/fake.c diff --git a/tools/regression/sbin/dhclient/option-domain-search.c b/sbin/dhclient/tests/option-domain-search.c similarity index 100% rename from tools/regression/sbin/dhclient/option-domain-search.c rename to sbin/dhclient/tests/option-domain-search.c diff --git a/sbin/growfs/Makefile b/sbin/growfs/Makefile index f464ed7d77ab..58ce41df6310 100644 --- a/sbin/growfs/Makefile +++ b/sbin/growfs/Makefile @@ -6,6 +6,8 @@ #GFSDBG= +.include + .PATH: ${.CURDIR}/../mount PROG= growfs @@ -20,4 +22,8 @@ SRCS+= debug.c DPADD= ${LIBUTIL} LDADD= -lutil +.if ${MK_TESTS} != "no" +SUBDIR+= tests +.endif + .include diff --git a/sbin/growfs/tests/Makefile b/sbin/growfs/tests/Makefile new file mode 100644 index 000000000000..7a6a831f2037 --- /dev/null +++ b/sbin/growfs/tests/Makefile @@ -0,0 +1,7 @@ +# $FreeBSD$ + +TESTSDIR= ${TESTSBASE}/sbin/growfs + +TAP_TESTS_PERL= legacy_test + +.include diff --git a/tools/regression/sbin/growfs/regress.t b/sbin/growfs/tests/legacy_test.pl similarity index 99% rename from tools/regression/sbin/growfs/regress.t rename to sbin/growfs/tests/legacy_test.pl index 9dbdd8523970..7316951c92b3 100755 --- a/tools/regression/sbin/growfs/regress.t +++ b/sbin/growfs/tests/legacy_test.pl @@ -1,5 +1,3 @@ -#! /usr/bin/perl -# # $FreeBSD$ use strict; diff --git a/sbin/mdconfig/Makefile b/sbin/mdconfig/Makefile index be8b1b556dde..4b9b9405474d 100644 --- a/sbin/mdconfig/Makefile +++ b/sbin/mdconfig/Makefile @@ -1,9 +1,15 @@ # $FreeBSD$ +.include + PROG= mdconfig MAN= mdconfig.8 DPADD= ${LIBUTIL} ${LIBGEOM} ${LIBBSDXML} ${LIBSBUF} LDADD= -lutil -lgeom -lbsdxml -lsbuf +.if ${MK_TESTS} != "no" +SUBDIR+= tests +.endif + .include diff --git a/tools/regression/sbin/mdconfig/00.t b/sbin/mdconfig/tests/legacy_test.sh similarity index 96% rename from tools/regression/sbin/mdconfig/00.t rename to sbin/mdconfig/tests/legacy_test.sh index 04e6d00cab07..f5843b3098fd 100644 --- a/tools/regression/sbin/mdconfig/00.t +++ b/sbin/mdconfig/tests/legacy_test.sh @@ -38,7 +38,7 @@ fi TESTDIR=$(dirname $(realpath $0)) -perl $TESTDIR/run $TESTDIR/mdconfig.test > /dev/null +__PERL__ -w -U $TESTDIR/run $TESTDIR/mdconfig.test > /dev/null if [ $? -eq 0 ]; then echo "ok 1" diff --git a/tools/regression/sbin/mdconfig/mdconfig.test b/sbin/mdconfig/tests/mdconfig.test similarity index 100% rename from tools/regression/sbin/mdconfig/mdconfig.test rename to sbin/mdconfig/tests/mdconfig.test diff --git a/tools/regression/sbin/mdconfig/run b/sbin/mdconfig/tests/run.pl old mode 100755 new mode 100644 similarity index 100% rename from tools/regression/sbin/mdconfig/run rename to sbin/mdconfig/tests/run.pl diff --git a/sbin/tests/Makefile b/sbin/tests/Makefile new file mode 100644 index 000000000000..a298f87ab432 --- /dev/null +++ b/sbin/tests/Makefile @@ -0,0 +1,10 @@ +# $FreeBSD$ + +.include + +TESTSDIR= ${TESTSBASE}/sbin + +.PATH: ${.CURDIR:H:H}/tests +KYUAFILE= yes + +.include diff --git a/tools/regression/sbin/Makefile b/tools/regression/sbin/Makefile deleted file mode 100644 index 623ff62ee540..000000000000 --- a/tools/regression/sbin/Makefile +++ /dev/null @@ -1,5 +0,0 @@ -# $FreeBSD$ - -SUBDIR= dhclient growfs - -.include diff --git a/tools/regression/sbin/dhclient/Makefile b/tools/regression/sbin/dhclient/Makefile deleted file mode 100644 index a9c876e3b2fb..000000000000 --- a/tools/regression/sbin/dhclient/Makefile +++ /dev/null @@ -1,17 +0,0 @@ -# $FreeBSD$ - -.PATH: ${.CURDIR}/../../../../sbin/dhclient - -SRCS= alloc.c convert.c hash.c options.c tables.c \ - fake.c \ - option-domain-search.c - -CFLAGS+= -I${.CURDIR}/../../../../sbin/dhclient -LDADD= -lutil - -PROG= option-domain-search - -NO_MAN= -WARNS?= 2 - -.include diff --git a/tools/regression/sbin/growfs/Makefile b/tools/regression/sbin/growfs/Makefile deleted file mode 100644 index dc9fa6771f24..000000000000 --- a/tools/regression/sbin/growfs/Makefile +++ /dev/null @@ -1,6 +0,0 @@ -# $FreeBSD$ - -all test: - prove -vmw regress.t - -clean: