summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjmmv <jmmv@FreeBSD.org>2014-03-16 02:07:08 +0000
committerjmmv <jmmv@FreeBSD.org>2014-03-16 02:07:08 +0000
commitf965a606e8ed559a35c4f9c0dc6073d869742120 (patch)
tree5f7443092d7c0f6cea7f6ce3d939e34b38133fd6
parent57805e1981db01e97ae9fe81450fa4a82f0f3dbf (diff)
downloadFreeBSD-src-f965a606e8ed559a35c4f9c0dc6073d869742120.zip
FreeBSD-src-f965a606e8ed559a35c4f9c0dc6073d869742120.tar.gz
Migrate tools/regression/sbin/ to the new tests layout.
Pretty much all that this change does is shuffles the code around and hooks it into the regular build. The code of the old tests has not changed.
-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 037c997..da64e34 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 9ee8ea3..fcf1709 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 74d1c4d..57c9211 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 0000000..b092eea
--- /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 c204d49..c204d49 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 b79f9a5..b79f9a5 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 f464ed7..58ce41d 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 0000000..7a6a831
--- /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 9dbdd85..7316951 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 be8b1b5..4b9b940 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 04e6d00..f5843b3 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 65d3670..65d3670 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 383f47e..383f47e 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 0000000..a298f87
--- /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 623ff62..0000000
--- 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 a9c876e..0000000
--- 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 dc9fa67..0000000
--- a/tools/regression/sbin/growfs/Makefile
+++ /dev/null
@@ -1,6 +0,0 @@
-# $FreeBSD$
-
-all test:
- prove -vmw regress.t
-
-clean:
OpenPOWER on IntegriCloud