Date: Mon, 05 Jul 2010 17:29:24 +0100 From: Christopher Key <cjk32@cam.ac.uk> To: freebsd-ports@freebsd.org Subject: Easier / automatic regression-test target for ports Message-ID: <4C320864.2060107@cam.ac.uk>
next in thread | raw e-mail | index | archive | help
This is a multi-part message in MIME format. --------------090508000509050206010805 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit 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: regression-test: build @cd ${WRKSRC}; ${SETENV} ${MAKE_ENV} ${MAKE} check can be replaced with: REGRESSION_TEST_TARGET= check 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. Any feedback on concept or implementation would be much appreciated. Kind regards, Christopher Key --------------090508000509050206010805 Content-Type: text/plain; x-mac-type="0"; x-mac-creator="0"; name="ports-regression-test.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="ports-regression-test.patch" 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,20 @@ .endif .endif +# Regression test + +.if !target(regression-test) +.if defined(REGRESSION_TEST_TARGET) && !empty(REGRESSION_TEST_TARGET) +regression-test: build + echo HELLO _${REGRESSION_TEST_TARGET}_ +.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) --------------090508000509050206010805--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?4C320864.2060107>