aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--etc/mtree/BSD.tests.dist8
-rw-r--r--sbin/Makefile4
-rw-r--r--sbin/dhclient/Makefile6
-rw-r--r--sbin/dhclient/tests/Makefile15
-rw-r--r--sbin/dhclient/tests/fake.c (renamed from tools/regression/sbin/dhclient/fake.c)0
-rw-r--r--sbin/dhclient/tests/option-domain-search.c (renamed from tools/regression/sbin/dhclient/option-domain-search.c)0
-rw-r--r--sbin/growfs/Makefile6
-rw-r--r--sbin/growfs/tests/Makefile7
-rwxr-xr-xsbin/growfs/tests/legacy_test.pl (renamed from tools/regression/sbin/growfs/regress.t)2
-rw-r--r--sbin/mdconfig/Makefile6
-rw-r--r--sbin/mdconfig/tests/legacy_test.sh (renamed from tools/regression/sbin/mdconfig/00.t)2
-rw-r--r--sbin/mdconfig/tests/mdconfig.test (renamed from tools/regression/sbin/mdconfig/mdconfig.test)0
-rw-r--r--[-rwxr-xr-x]sbin/mdconfig/tests/run.pl (renamed from tools/regression/sbin/mdconfig/run)0
-rw-r--r--sbin/tests/Makefile10
-rw-r--r--tools/regression/sbin/Makefile5
-rw-r--r--tools/regression/sbin/dhclient/Makefile17
-rw-r--r--tools/regression/sbin/growfs/Makefile6
17 files changed, 63 insertions, 31 deletions
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 <bsd.arch.inc.mk>
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 <bsd.own.mk>
+
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 <bsd.prog.mk>
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 <bsd.test.mk>
diff --git a/tools/regression/sbin/dhclient/fake.c b/sbin/dhclient/tests/fake.c
index c204d49402c5..c204d49402c5 100644
--- a/tools/regression/sbin/dhclient/fake.c
+++ b/sbin/dhclient/tests/fake.c
diff --git a/tools/regression/sbin/dhclient/option-domain-search.c b/sbin/dhclient/tests/option-domain-search.c
index b79f9a560137..b79f9a560137 100644
--- a/tools/regression/sbin/dhclient/option-domain-search.c
+++ b/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 <bsd.own.mk>
+
.PATH: ${.CURDIR}/../mount
PROG= growfs
@@ -20,4 +22,8 @@ SRCS+= debug.c
DPADD= ${LIBUTIL}
LDADD= -lutil
+.if ${MK_TESTS} != "no"
+SUBDIR+= tests
+.endif
+
.include <bsd.prog.mk>
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 <bsd.test.mk>
diff --git a/tools/regression/sbin/growfs/regress.t b/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 <bsd.own.mk>
+
PROG= mdconfig
MAN= mdconfig.8
DPADD= ${LIBUTIL} ${LIBGEOM} ${LIBBSDXML} ${LIBSBUF}
LDADD= -lutil -lgeom -lbsdxml -lsbuf
+.if ${MK_TESTS} != "no"
+SUBDIR+= tests
+.endif
+
.include <bsd.prog.mk>
diff --git a/tools/regression/sbin/mdconfig/00.t b/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
index 65d3670b57c3..65d3670b57c3 100644
--- a/tools/regression/sbin/mdconfig/mdconfig.test
+++ b/sbin/mdconfig/tests/mdconfig.test
diff --git a/tools/regression/sbin/mdconfig/run b/sbin/mdconfig/tests/run.pl
index 383f47e62397..383f47e62397 100755..100644
--- a/tools/regression/sbin/mdconfig/run
+++ b/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 <bsd.own.mk>
+
+TESTSDIR= ${TESTSBASE}/sbin
+
+.PATH: ${.CURDIR:H:H}/tests
+KYUAFILE= yes
+
+.include <bsd.test.mk>
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 <bsd.subdir.mk>
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 <bsd.prog.mk>
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: