From owner-svn-src-user@freebsd.org Sun Oct 18 01:21:31 2015 Return-Path: Delivered-To: svn-src-user@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 68101A1028B for ; Sun, 18 Oct 2015 01:21:31 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 262A81789; Sun, 18 Oct 2015 01:21:31 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t9I1LUH3059902; Sun, 18 Oct 2015 01:21:30 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t9I1LTL8059898; Sun, 18 Oct 2015 01:21:29 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201510180121.t9I1LTL8059898@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Sun, 18 Oct 2015 01:21:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: svn commit: r289478 - user/ngie/more-tests2/share/mk X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 Oct 2015 01:21:31 -0000 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 .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