From owner-freebsd-ports-bugs@FreeBSD.ORG Fri Jul 16 21:30:08 2010 Return-Path: Delivered-To: freebsd-ports-bugs@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1A8301065673 for ; Fri, 16 Jul 2010 21:30:08 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id EA78D8FC1D for ; Fri, 16 Jul 2010 21:30:07 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.4/8.14.4) with ESMTP id o6GLU70V068680 for ; Fri, 16 Jul 2010 21:30:07 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.4/8.14.4/Submit) id o6GLU7xL068674; Fri, 16 Jul 2010 21:30:07 GMT (envelope-from gnats) Resent-Date: Fri, 16 Jul 2010 21:30:07 GMT Resent-Message-Id: <201007162130.o6GLU7xL068674@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-ports-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Christopher Key Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CAF4B1065672 for ; Fri, 16 Jul 2010 21:21:07 +0000 (UTC) (envelope-from cjk32@cam.ac.uk) Received: from chacal.cjkey.org.uk (chacal.cjkey.org.uk [88.97.163.217]) by mx1.freebsd.org (Postfix) with ESMTP id 472888FC13 for ; Fri, 16 Jul 2010 21:21:06 +0000 (UTC) Received: from chacal.wzl33 (localhost [127.0.0.1]) by chacal.cjkey.org.uk (8.14.3/8.14.3) with ESMTP id o6GLL5WC005857 for ; Fri, 16 Jul 2010 22:21:05 +0100 (BST) (envelope-from chris@chacal.wzl33) Received: (from chris@localhost) by chacal.wzl33 (8.14.3/8.14.3/Submit) id o6GLL5pM005856; Fri, 16 Jul 2010 22:21:05 +0100 (BST) (envelope-from chris) Message-Id: <201007162121.o6GLL5pM005856@chacal.wzl33> Date: Fri, 16 Jul 2010 22:21:05 +0100 (BST) From: Christopher Key To: FreeBSD-gnats-submit@FreeBSD.org X-Send-Pr-Version: 3.113 Cc: Subject: ports/148695: [patch] Easier / automatic regression-test target for ports X-BeenThere: freebsd-ports-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Christopher Key List-Id: Ports bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 Jul 2010 21:30:08 -0000 >Number: 148695 >Category: ports >Synopsis: [patch] Easier / automatic regression-test target for ports >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-ports-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: change-request >Submitter-Id: current-users >Arrival-Date: Fri Jul 16 21:30:07 UTC 2010 >Closed-Date: >Last-Modified: >Originator: Christopher Key >Release: FreeBSD 8.0-RELEASE-p2 amd64 >Organization: >Environment: System: FreeBSD chacal.wzl33 8.0-RELEASE-p2 FreeBSD 8.0-RELEASE-p2 #2: Sat Jun 19 15:45:05 BST 2010 root@chacal.wzl33:/usr/obj/usr/src/sys/CHACAL amd64 >Description: At the moment, many ported applications/libraries provide some form of regression testing, but very few ports actually expose this via the standard regression-test target. The regression-test target will be called by tinderbox if available, and should also make debugging misbehaving ports easier. Attached is a patch which aims to remedy this situation. Firstly, it simplifies the creation of a regression-test target, with the addition of a REGRESSION_TEST_TARGET variable. For audio/flac for example, this means that: #v+ regression-test: build @cd ${WRKSRC}; ${SETENV} ${MAKE_ENV} ${MAKE} check #v- can be replaced with: #v+ REGRESSION_TEST_TARGET= check #v- Secondly, rather more aggressively, it assumes that anything using GNU_CONFIGURE or PERL_CONFIGURE implements a check or test target respectively, and sets REGRESSION_TEST_TARGET accordingly. As far as I am aware, these target are always present, although it is not guaranteed that any tests will actually be run. Most perl modules do provide tests, but gnu software seems less likely to do so. If no useful testing will be performed, the automatic creation of a regression-test target can be overridden by setting REGRESSION_TEST_TARGET to an empty string. The attached patch probably isn't doing things in the correct places, or doing them in them in the correct way, but does work to illustrate the intent. >How-To-Repeat: >Fix: --- ports-regression-test.patch begins here --- Index: ports/Mk/bsd.port.mk =================================================================== RCS file: /home/ncvs/ports/Mk/bsd.port.mk,v retrieving revision 1.642 diff -u -r1.642 bsd.port.mk --- ports/Mk/bsd.port.mk 4 Jun 2010 08:09:17 -0000 1.642 +++ ports/Mk/bsd.port.mk 5 Jul 2010 16:26:20 -0000 @@ -1605,6 +1605,16 @@ WWWOWN?= www WWWGRP?= www +# Regression test targets +.if defined(GNU_CONFIGURE) +REGRESSION_TEST_TARGET?= check +.endif + +.if defined(PERL_CONFIGURE) +REGRESSION_TEST_TARGET?= test +.endif + + .endif # End of pre-makefile section. @@ -3818,6 +3828,19 @@ .endif .endif +# Regression test + +.if !target(regression-test) +.if defined(REGRESSION_TEST_TARGET) && !empty(REGRESSION_TEST_TARGET) +regression-test: build +.if defined(USE_GMAKE) + @cd ${BUILD_WRKSRC}; ${SETENV} ${MAKE_ENV} ${GMAKE} ${MAKE_FLAGS} ${MAKEFILE} ${_MAKE_JOBS} ${MAKE_ARGS} ${REGRESSION_TEST_TARGET} +.else + @cd ${BUILD_WRKSRC}; ${SETENV} ${MAKE_ENV} ${MAKE} ${MAKE_FLAGS} ${MAKEFILE} ${_MAKE_JOBS} ${MAKE_ARGS} ${REGRESSION_TEST_TARGET} +.endif +.endif +.endif + # Check conflicts .if !target(check-conflicts) --- ports-regression-test.patch ends here --- >Release-Note: >Audit-Trail: >Unformatted: