]> xenbits.xensource.com Git - people/julieng/freebsd.git/commitdiff
Port over diff from ^/user/ngie/more-tests to replace `make test` with `make regress`
authorngie <ngie@FreeBSD.org>
Sun, 18 Oct 2015 01:21:29 +0000 (01:21 +0000)
committerngie <ngie@FreeBSD.org>
Sun, 18 Oct 2015 01:21:29 +0000 (01:21 +0000)
share/mk/bsd.README
share/mk/bsd.test.mk
share/mk/suite.test.mk

index cb6e41f3cf07c482d443053d3dadbb9a0816ff32..a12d0a81e4c659e4270a8774dd780ab4421bc7be 100644 (file)
@@ -463,14 +463,14 @@ It has seven targets:
                 install target is executed.
        lint:
                run lint on the source files.
-       tags:
-               create a tags file for the source files.
-       test:
+       regress:
                runs the test programs from the object directory; if the
                Makefile does not itself define the target test, the
-               targets beforetest and aftertest may also be used to
+               targets beforeregress and afterregress may also be used to
                cause actions immediately before and after the test
                target is executed.
+       tags:
+               create a tags file for the source files.
 
 It sets/uses the following variables, among many others:
 
index 86351cff3c6c4fae8c60b3cc8fbf2001f46a7715..69ada898cb3bb41eba9a5002963b26b6feff2bd0 100644 (file)
@@ -76,19 +76,14 @@ PROGS_TARGETS+= install
 .include <suite.test.mk>
 .endif
 
-.if !target(realtest)
-realtest: .PHONY
+.if !target(realregress)
+realregress: .PHONY
        @echo "$@ not defined; skipping"
 .endif
 
-test: .PHONY
-.ORDER: beforetest realtest
-test: beforetest realtest
-
-.if target(aftertest)
-.ORDER: realtest aftertest
-test: aftertest
-.endif
+beforeregress realregress afterregress regress: .PHONY
+.ORDER: beforeregress realregress afterregress
+regress: beforeregress realregress afterregress
 
 .ifdef PROG
 # we came here via bsd.progs.mk below
index c447a171bf52cd74d7528cac8239d557b346b954..0b244c8b7660cfb7db469f47967da47ccc28c845 100644 (file)
@@ -51,7 +51,7 @@ KYUAFILE?= auto
 
 # Path to the prefix of the installed Kyua CLI, if any.
 #
-# If kyua is installed from ports, we automatically define a realtest target
+# If kyua is installed from ports, we automatically define a realregress target
 # below to run the tests using this tool.  The tools are searched for in the
 # hierarchy specified by this variable.
 KYUA_PREFIX?= /usr/local
@@ -92,9 +92,13 @@ Kyuafile.auto: Makefile
        @mv Kyuafile.auto.tmp Kyuafile.auto
 .endif
 
+_kyuafile=     ${DESTDIR}${TESTSDIR}/Kyuafile
+
 KYUA?= ${KYUA_PREFIX}/bin/kyua
+
+realregress: .PHONY
 .if exists(${KYUA})
-# Definition of the "make test" target and supporting variables.
+# Definition of the "make regress" target and supporting variables.
 #
 # This target, by necessity, can only work for native builds (i.e. a FreeBSD
 # host building a release for the same system).  The target runs Kyua, which is
@@ -103,35 +107,5 @@ KYUA?= ${KYUA_PREFIX}/bin/kyua
 # Due to the dependencies of the binaries built by the source tree and how they
 # are used by tests, it is highly possible for a execution of "make test" to
 # report bogus results unless the new binaries are put in place.
-realtest: .PHONY
-       @echo "*** WARNING: make test is experimental"
-       @echo "***"
-       @echo "*** Using this test does not preclude you from running the tests"
-       @echo "*** installed in ${TESTSBASE}.  This test run may raise false"
-       @echo "*** positives and/or false negatives."
-       @echo
-       @${KYUA} test -k ${DESTDIR}${TESTSDIR}/Kyuafile; \
-       result=0; \
-       echo; \
-       echo "*** Once again, note that "make test" is unsupported."; \
-       test $${result} -eq 0
-.endif
-
-beforetest: .PHONY
-.if defined(TESTSDIR)
-.if ${TESTSDIR} == ${TESTSBASE}
-# Forbid running from ${TESTSBASE}.  It can cause false positives/negatives and
-# it does not cover all the tests (e.g. it misses testing software in external).
-       @echo "*** Sorry, you cannot use make test from src/tests.  Install the"
-       @echo "*** tests into their final location and run them from ${TESTSBASE}"
-       @false
-.else
-       @echo "*** Using this test does not preclude you from running the tests"
-       @echo "*** installed in ${TESTSBASE}.  This test run may raise false"
-       @echo "*** positives and/or false negatives."
-.endif
-.else
-       @echo "*** No TESTSDIR defined; nothing to do."
-       @false
+       @${KYUA} test -k ${DESTDIR}${TESTSDIR}/Kyuafile
 .endif
-       @echo