From owner-svn-src-all@FreeBSD.ORG Sat Oct 19 06:50:18 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id CA95EB3A; Sat, 19 Oct 2013 06:50:18 +0000 (UTC) (envelope-from rpaulo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id A766D2A08; Sat, 19 Oct 2013 06:50:18 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9J6oIat036196; Sat, 19 Oct 2013 06:50:18 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9J6oIGG036194; Sat, 19 Oct 2013 06:50:18 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <201310190650.r9J6oIGG036194@svn.freebsd.org> From: Rui Paulo Date: Sat, 19 Oct 2013 06:50:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r256762 - head/share/mk X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 19 Oct 2013 06:50:19 -0000 Author: rpaulo Date: Sat Oct 19 06:50:17 2013 New Revision: 256762 URL: http://svnweb.freebsd.org/changeset/base/256762 Log: Add the automatic generation of Atffile files. These are only used by the deprecated atf-run and atf-report tools. Generating them is easy and provides a mechanism for people to experiment with these tools if they wish. But, because these tools and files are deprecated, doing this only happens if the user has explicitly set ALLOW_DEPRECATED_ATF_TOOLS to yes. Submitted by: Julio Merino jmmv google.com MFC after: 2 weeks Modified: head/share/mk/atf.test.mk head/share/mk/bsd.test.mk Modified: head/share/mk/atf.test.mk ============================================================================== --- head/share/mk/atf.test.mk Sat Oct 19 06:48:49 2013 (r256761) +++ head/share/mk/atf.test.mk Sat Oct 19 06:50:17 2013 (r256762) @@ -18,6 +18,24 @@ ATF_TESTS_C?= ATF_TESTS_CXX?= ATF_TESTS_SH?= +# Whether to allow using the deprecated ATF tools or not. +# +# If 'yes', this file will generate Atffiles when requested and will also +# support using the deprecated atf-run tool to execute the tests. +ALLOW_DEPRECATED_ATF_TOOLS?= no + +# Knob to control the handling of the Atffile for this Makefile. +# +# If 'yes', an Atffile exists in the source tree and is installed into +# TESTSDIR. +# +# If 'auto', an Atffile is automatically generated based on the list of test +# programs built by the Makefile and is installed into TESTSDIR. This is the +# default and is sufficient in the majority of the cases. +# +# If 'no', no Atffile is installed. +ATFFILE?= auto + .if !empty(ATF_TESTS_C) PROGS+= ${ATF_TESTS_C} .for _T in ${ATF_TESTS_C} @@ -55,4 +73,31 @@ ${_T}: ${ATF_TESTS_SH_SRC_${_T}} .endfor .endif +.if ${ALLOW_DEPRECATED_ATF_TOOLS} != "no" + +.if ${ATFFILE:tl} != "no" +FILES+= Atffile +FILESDIR_Atffile= ${TESTSDIR} + +.if ${ATFFILE:tl} == "auto" +CLEANFILES+= Atffile Atffile.tmp + +Atffile: Makefile + @{ echo 'Content-Type: application/X-atf-atffile; version="1"'; \ + echo; \ + echo '# Automatically generated by atf-test.mk.'; \ + echo; \ + echo 'prop: test-suite = "'${TESTSUITE}'"'; \ + echo; \ + for tp in ${ATF_TESTS_C} ${ATF_TESTS_CXX} ${ATF_TESTS_SH} \ + ${TESTS_SUBDIRS}; \ + do \ + echo "tp: $${tp}"; \ + done; } >Atffile.tmp + @mv Atffile.tmp Atffile +.endif +.endif + +.endif + .include Modified: head/share/mk/bsd.test.mk ============================================================================== --- head/share/mk/bsd.test.mk Sat Oct 19 06:48:49 2013 (r256761) +++ head/share/mk/bsd.test.mk Sat Oct 19 06:50:17 2013 (r256762) @@ -20,6 +20,10 @@ TESTSBASE?= /usr/tests # Makefiles have to override this to point to a subdirectory of TESTSBASE. TESTSDIR?= . +# Name of the test suite these tests belong to. Should rarely be changed for +# Makefiles built into the FreeBSD src tree. +TESTSUITE?= FreeBSD + # List of subdirectories containing tests into which to recurse. This has the # same semantics as SUBDIR at build-time. However, the directories listed here # get registered into the run-time test suite definitions so that the test @@ -82,6 +86,8 @@ test: aftertest .if !empty(PROGS) || !empty(PROGS_CXX) || !empty(SCRIPTS) .include +.elif !empty(FILES) +.include .endif .include