summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--bin/date/tests/Makefile2
-rw-r--r--bin/mv/tests/Makefile2
-rw-r--r--bin/pax/tests/Makefile2
-rw-r--r--bin/sh/tests/Makefile2
-rw-r--r--bin/test/tests/Makefile2
-rw-r--r--lib/atf/libatf-c++/tests/Makefile2
-rw-r--r--lib/atf/libatf-c++/tests/detail/Makefile2
-rw-r--r--lib/atf/libatf-c/tests/Makefile2
-rw-r--r--lib/atf/libatf-c/tests/detail/Makefile2
-rw-r--r--lib/atf/tests/test-programs/Makefile2
-rw-r--r--lib/libcrypt/tests/Makefile2
-rw-r--r--libexec/atf/atf-check/tests/Makefile2
-rw-r--r--share/examples/tests/tests/atf/Makefile2
-rw-r--r--share/examples/tests/tests/plain/Makefile2
-rw-r--r--share/mk/atf.test.mk8
-rw-r--r--share/mk/bsd.test.mk26
-rw-r--r--share/mk/plain.test.mk8
-rw-r--r--share/mk/tap.test.mk8
-rw-r--r--tests/sys/kern/Makefile2
-rw-r--r--usr.bin/atf/atf-sh/tests/Makefile2
20 files changed, 45 insertions, 37 deletions
diff --git a/bin/date/tests/Makefile b/bin/date/tests/Makefile
index 540008b..2301dcf 100644
--- a/bin/date/tests/Makefile
+++ b/bin/date/tests/Makefile
@@ -6,4 +6,4 @@ TESTSDIR= ${TESTSBASE}/bin/date
TAP_TESTS_SH= legacy_test
-.include <tap.test.mk>
+.include <bsd.test.mk>
diff --git a/bin/mv/tests/Makefile b/bin/mv/tests/Makefile
index 051a3b6..3d437ef 100644
--- a/bin/mv/tests/Makefile
+++ b/bin/mv/tests/Makefile
@@ -6,4 +6,4 @@ TESTSDIR= ${TESTSBASE}/bin/mv
TAP_TESTS_SH= legacy_test
-.include <tap.test.mk>
+.include <bsd.test.mk>
diff --git a/bin/pax/tests/Makefile b/bin/pax/tests/Makefile
index f4f81ee..1f27c18 100644
--- a/bin/pax/tests/Makefile
+++ b/bin/pax/tests/Makefile
@@ -6,4 +6,4 @@ TESTSDIR= ${TESTSBASE}/bin/pax
TAP_TESTS_PERL= legacy_test
-.include <tap.test.mk>
+.include <bsd.test.mk>
diff --git a/bin/sh/tests/Makefile b/bin/sh/tests/Makefile
index f6ddb8a..51c6dc4 100644
--- a/bin/sh/tests/Makefile
+++ b/bin/sh/tests/Makefile
@@ -15,4 +15,4 @@ TEST_METADATA.legacy_test+= required_user="unprivileged"
SUBDIR+= builtins errors execution expansion parameters parser set-e
-.include <tap.test.mk>
+.include <bsd.test.mk>
diff --git a/bin/test/tests/Makefile b/bin/test/tests/Makefile
index be32dbb..5ee337a 100644
--- a/bin/test/tests/Makefile
+++ b/bin/test/tests/Makefile
@@ -12,4 +12,4 @@ TAP_TESTS_SH= legacy_test
# requested. See https://code.google.com/p/kyua/issues/detail?id=6
TEST_METADATA.legacy_test+= required_user="unprivileged"
-.include <tap.test.mk>
+.include <bsd.test.mk>
diff --git a/lib/atf/libatf-c++/tests/Makefile b/lib/atf/libatf-c++/tests/Makefile
index 1ab5fda..c5a1d24 100644
--- a/lib/atf/libatf-c++/tests/Makefile
+++ b/lib/atf/libatf-c++/tests/Makefile
@@ -28,4 +28,4 @@ SRCS.${_T}= ${_T}.cpp test_helpers.cpp
ATF_TESTS_SH= pkg_config_test
-.include <atf.test.mk>
+.include <bsd.test.mk>
diff --git a/lib/atf/libatf-c++/tests/detail/Makefile b/lib/atf/libatf-c++/tests/detail/Makefile
index 4e2e9cf..b3fd4dc 100644
--- a/lib/atf/libatf-c++/tests/detail/Makefile
+++ b/lib/atf/libatf-c++/tests/detail/Makefile
@@ -29,4 +29,4 @@ BINDIR.${p}= ${TESTSDIR}
version_helper.o: atf-version
.include "../../../common.mk"
-.include <atf.test.mk>
+.include <bsd.test.mk>
diff --git a/lib/atf/libatf-c/tests/Makefile b/lib/atf/libatf-c/tests/Makefile
index 14b199f..1a091d3 100644
--- a/lib/atf/libatf-c/tests/Makefile
+++ b/lib/atf/libatf-c/tests/Makefile
@@ -35,4 +35,4 @@ SRCS.${_T}= ${_T}.c test_helpers.c
ATF_TESTS_SH= pkg_config_test
-.include <atf.test.mk>
+.include <bsd.test.mk>
diff --git a/lib/atf/libatf-c/tests/detail/Makefile b/lib/atf/libatf-c/tests/detail/Makefile
index 472ff9c..aa85aa3 100644
--- a/lib/atf/libatf-c/tests/detail/Makefile
+++ b/lib/atf/libatf-c/tests/detail/Makefile
@@ -31,4 +31,4 @@ BINDIR.${p}= ${TESTSDIR}
version_helper.o: atf-version
.include "../../../common.mk"
-.include <atf.test.mk>
+.include <bsd.test.mk>
diff --git a/lib/atf/tests/test-programs/Makefile b/lib/atf/tests/test-programs/Makefile
index 8ff3333..b0c1c23 100644
--- a/lib/atf/tests/test-programs/Makefile
+++ b/lib/atf/tests/test-programs/Makefile
@@ -21,4 +21,4 @@ ATF_TESTS_SH+= ${_T}
ATF_TESTS_SH_SRC_${_T}= common.sh ${_T}.sh
.endfor
-.include <atf.test.mk>
+.include <bsd.test.mk>
diff --git a/lib/libcrypt/tests/Makefile b/lib/libcrypt/tests/Makefile
index 51adc2d..2a0f1fb 100644
--- a/lib/libcrypt/tests/Makefile
+++ b/lib/libcrypt/tests/Makefile
@@ -9,4 +9,4 @@ ATF_TESTS_C= crypt_tests
CFLAGS+= -I${.CURDIR:H}
LDADD+= -L${.OBJDIR:H} -lcrypt
-.include <atf.test.mk>
+.include <bsd.test.mk>
diff --git a/libexec/atf/atf-check/tests/Makefile b/libexec/atf/atf-check/tests/Makefile
index 0f237e6..43a7498 100644
--- a/libexec/atf/atf-check/tests/Makefile
+++ b/libexec/atf/atf-check/tests/Makefile
@@ -9,4 +9,4 @@ ATF= ${.CURDIR:H:H:H:H}/contrib/atf
ATF_TESTS_SH= atf-check_test
-.include <atf.test.mk>
+.include <bsd.test.mk>
diff --git a/share/examples/tests/tests/atf/Makefile b/share/examples/tests/tests/atf/Makefile
index d93813da..c7bd46f 100644
--- a/share/examples/tests/tests/atf/Makefile
+++ b/share/examples/tests/tests/atf/Makefile
@@ -27,4 +27,4 @@ ATF_TESTS_SH= cp_test
# definitions from above.
KYUAFILE= yes
-.include <atf.test.mk>
+.include <bsd.test.mk>
diff --git a/share/examples/tests/tests/plain/Makefile b/share/examples/tests/tests/plain/Makefile
index 309dbef..7348c5a 100644
--- a/share/examples/tests/tests/plain/Makefile
+++ b/share/examples/tests/tests/plain/Makefile
@@ -27,4 +27,4 @@ PLAIN_TESTS_SH= cp_test
# definitions from above.
KYUAFILE= yes
-.include <plain.test.mk>
+.include <bsd.test.mk>
diff --git a/share/mk/atf.test.mk b/share/mk/atf.test.mk
index 3ffb2cb..1be7244 100644
--- a/share/mk/atf.test.mk
+++ b/share/mk/atf.test.mk
@@ -1,9 +1,13 @@
# $FreeBSD$
#
+# You must include bsd.test.mk instead of this file from your Makefile.
+#
# Logic to build and install ATF test programs; i.e. test programs linked
# against the ATF libraries.
-.include <bsd.init.mk>
+.if !target(__<bsd.test.mk>__)
+.error atf.test.mk cannot be included directly.
+.endif
# List of C, C++ and shell test programs to build.
#
@@ -164,5 +168,3 @@ realtest: .PHONY
.endif
.endif
-
-.include <bsd.test.mk>
diff --git a/share/mk/bsd.test.mk b/share/mk/bsd.test.mk
index ee96f77..94b22b1 100644
--- a/share/mk/bsd.test.mk
+++ b/share/mk/bsd.test.mk
@@ -2,16 +2,14 @@
#
# Generic build infrastructure for test programs.
#
-# The code in this file is independent of the implementation of the test
-# programs being built; this file just provides generic infrastructure for the
-# build and the definition of various helper variables and targets.
-#
-# Makefiles should never include this file directly. Instead, they should
-# include one of the various *.test.mk depending on the specific test programs
-# being built.
+# This is the only public file that should be included by Makefiles when
+# tests are to be built. All other *.test.mk files are internal and not
+# to be included directly.
.include <bsd.init.mk>
+__<bsd.test.mk>__:
+
# Directory in which to install tests defined by the current Makefile.
# Makefiles have to override this to point to a subdirectory of TESTSBASE.
TESTSDIR?= .
@@ -67,11 +65,6 @@ TESTS_ENV+= PATH=${TESTS_PATH:tW:C/ +/:/g}
TESTS_LD_LIBRARY_PATH+= ${DESTDIR}/lib ${DESTDIR}/usr/lib
TESTS_ENV+= LD_LIBRARY_PATH=${TESTS_LD_LIBRARY_PATH:tW:C/ +/:/g}
-# List of all tests being built. This variable is internal should not be
-# defined by the Makefile. The various *.test.mk modules extend this variable
-# as needed.
-_TESTS?=
-
# Path to the prefix of the installed Kyua CLI, if any.
#
# If kyua is installed from ports, we automatically define a realtest target
@@ -79,6 +72,15 @@ _TESTS?=
# hierarchy specified by this variable.
KYUA_PREFIX?= /usr/local
+# List of all tests being built. The various *.test.mk modules extend this
+# variable as needed.
+_TESTS=
+
+# Pull in the definitions of all supported test interfaces.
+.include <atf.test.mk>
+.include <plain.test.mk>
+.include <tap.test.mk>
+
.if !empty(TESTS_SUBDIRS)
SUBDIR+= ${TESTS_SUBDIRS}
.endif
diff --git a/share/mk/plain.test.mk b/share/mk/plain.test.mk
index 2e2752d..99685ef 100644
--- a/share/mk/plain.test.mk
+++ b/share/mk/plain.test.mk
@@ -1,10 +1,14 @@
# $FreeBSD$
#
+# You must include bsd.test.mk instead of this file from your Makefile.
+#
# Logic to build and install plain test programs. A plain test programs it not
# supposed to use any specific testing framework: all it does is run some code
# and report the test's pass or fail status via a 0 or 1 exit code.
-.include <bsd.init.mk>
+.if !target(__<bsd.test.mk>__)
+.error plain.test.mk cannot be included directly.
+.endif
# List of C, C++ and shell test programs to build.
#
@@ -58,5 +62,3 @@ ${_T}: ${PLAIN_TESTS_SH_SRC_${_T}}
mv ${.TARGET}.tmp ${.TARGET}
.endfor
.endif
-
-.include <bsd.test.mk>
diff --git a/share/mk/tap.test.mk b/share/mk/tap.test.mk
index 9c1ef54..4c05661 100644
--- a/share/mk/tap.test.mk
+++ b/share/mk/tap.test.mk
@@ -1,12 +1,16 @@
# $FreeBSD$
#
+# You must include bsd.test.mk instead of this file from your Makefile.
+#
# Logic to build and install TAP-compliant test programs.
#
# This is provided to support existing tests in the FreeBSD source tree
# (particularly those coming from tools/regression/) that comply with the
# Test Anything Protocol. It should not be used for new tests.
-.include <bsd.init.mk>
+.if !target(__<bsd.test.mk>__)
+.error tap.test.mk cannot be included directly.
+.endif
# List of C, C++ and shell test programs to build.
#
@@ -87,5 +91,3 @@ ${_T}: ${TAP_TESTS_SH_SRC_${_T}}
mv ${.TARGET}.tmp ${.TARGET}
.endfor
.endif
-
-.include <bsd.test.mk>
diff --git a/tests/sys/kern/Makefile b/tests/sys/kern/Makefile
index bf6ad55..4a1e671 100644
--- a/tests/sys/kern/Makefile
+++ b/tests/sys/kern/Makefile
@@ -10,4 +10,4 @@ LDADD.unix_seqpacket_test+= -lpthread
WARNS?= 5
-.include <atf.test.mk>
+.include <bsd.test.mk>
diff --git a/usr.bin/atf/atf-sh/tests/Makefile b/usr.bin/atf/atf-sh/tests/Makefile
index b43b649..4fc0ed7 100644
--- a/usr.bin/atf/atf-sh/tests/Makefile
+++ b/usr.bin/atf/atf-sh/tests/Makefile
@@ -23,4 +23,4 @@ misc_helpers: misc_helpers.sh
chmod +x ${.TARGET}.tmp
mv ${.TARGET}.tmp ${.TARGET}
-.include <atf.test.mk>
+.include <bsd.test.mk>
OpenPOWER on IntegriCloud