Date: Sun, 18 Oct 2015 01:21:29 +0000 (UTC) From: Garrett Cooper <ngie@FreeBSD.org> To: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: svn commit: r289478 - user/ngie/more-tests2/share/mk Message-ID: <201510180121.t9I1LTL8059898@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: ngie Date: Sun Oct 18 01:21:29 2015 New Revision: 289478 URL: https://svnweb.freebsd.org/changeset/base/289478 Log: Port over diff from ^/user/ngie/more-tests to replace `make test` with `make regress` Modified: user/ngie/more-tests2/share/mk/bsd.README user/ngie/more-tests2/share/mk/bsd.test.mk user/ngie/more-tests2/share/mk/suite.test.mk Modified: user/ngie/more-tests2/share/mk/bsd.README ============================================================================== --- user/ngie/more-tests2/share/mk/bsd.README Sun Oct 18 01:03:43 2015 (r289477) +++ user/ngie/more-tests2/share/mk/bsd.README Sun Oct 18 01:21:29 2015 (r289478) @@ -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: Modified: user/ngie/more-tests2/share/mk/bsd.test.mk ============================================================================== --- user/ngie/more-tests2/share/mk/bsd.test.mk Sun Oct 18 01:03:43 2015 (r289477) +++ user/ngie/more-tests2/share/mk/bsd.test.mk Sun Oct 18 01:21:29 2015 (r289478) @@ -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 Modified: user/ngie/more-tests2/share/mk/suite.test.mk ============================================================================== --- user/ngie/more-tests2/share/mk/suite.test.mk Sun Oct 18 01:03:43 2015 (r289477) +++ user/ngie/more-tests2/share/mk/suite.test.mk Sun Oct 18 01:21:29 2015 (r289478) @@ -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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201510180121.t9I1LTL8059898>