diff options
author | amdmi3 <amdmi3@FreeBSD.org> | 2015-09-29 01:20:42 +0800 |
---|---|---|
committer | amdmi3 <amdmi3@FreeBSD.org> | 2015-09-29 01:20:42 +0800 |
commit | ff2e1513055cac9087cc18a9abf2580c32f0498b (patch) | |
tree | acb73643f4fe5f57790ed056215bc1db842b57ce /Mk/Uses | |
parent | cca6c325aeb2ff3ff53127a2b3a415a6273ef856 (diff) | |
download | freebsd-ports-graphics-ff2e1513055cac9087cc18a9abf2580c32f0498b.tar.gz freebsd-ports-graphics-ff2e1513055cac9087cc18a9abf2580c32f0498b.tar.zst freebsd-ports-graphics-ff2e1513055cac9087cc18a9abf2580c32f0498b.zip |
Implemented complete support for test target.
You can now `make test' on any port to run test sequence, no-op by default.
If a port defines TEST_TARGET, it'll run sub-make with specified target,
usually `check' or `test', useful if upstream supports that. The port may
instead define custom do-test target, as well as usual satellite targets:
{pre,do,post}-test, {pre,do,post}-test-OPT, {pre,do,post}-test-OPT-off
`make test' builds and stages port first, so test may use both WRKDIR and
STAGEDIR, and both BUILD and RUN depends are available for test target.
Additionally, TEST_DEPENDS is now properly supported and may be used to
define additional depends specifically for testing.
Framework may define default tests for specific cases. For instance,
perl5.mk and cran.mk already provide default test target on their own.
This commit also converts my ports which have tests to this new framework.
Approved by: portmgr (bapt)
Differential Revision: D3680
Diffstat (limited to 'Mk/Uses')
-rw-r--r-- | Mk/Uses/cran.mk | 4 | ||||
-rw-r--r-- | Mk/Uses/perl5.mk | 13 |
2 files changed, 6 insertions, 11 deletions
diff --git a/Mk/Uses/cran.mk b/Mk/Uses/cran.mk index dd600640933..20f16a0500e 100644 --- a/Mk/Uses/cran.mk +++ b/Mk/Uses/cran.mk @@ -41,14 +41,14 @@ WRKSRC?= ${WRKDIR}/${PORTNAME} NO_BUILD= yes R_COMMAND= ${LOCALBASE}/bin/R -.if !target(regression-test) +.if !target(do-test) R_POSTCMD_CHECK_OPTIONS?= --timings .if !exists(${LOCALBASE}/bin/pdflatex) R_POSTCMD_CHECK_OPTIONS+= --no-manual --no-rebuild-vignettes .endif -regression-test: build +do-test: @cd ${WRKDIR} ; ${SETENV} ${MAKE_ENV} _R_CHECK_FORCE_SUGGESTS_=FALSE \ ${R_COMMAND} ${R_PRECMD_CHECK_OPTIONS} CMD check \ ${R_POSTCMD_CHECK_OPTIONS} ${PORTNAME} diff --git a/Mk/Uses/perl5.mk b/Mk/Uses/perl5.mk index 818954fb2c2..58201234d71 100644 --- a/Mk/Uses/perl5.mk +++ b/Mk/Uses/perl5.mk @@ -308,19 +308,14 @@ fix-perl-things: @${RM} -f ${STAGEDIR}${PREFIX}/lib/perl5/${PERL_VER}/${PERL_ARCH}/perllocal.pod* || : @${RMDIR} -p ${STAGEDIR}${PREFIX}/lib/perl5/${PERL_VER}/${PERL_ARCH} 2>/dev/null || : -.if !target(regression-test) -TEST_ARGS?= ${MAKE_ARGS} -TEST_ENV?= ${MAKE_ENV} +.if !target(do-test) TEST_TARGET?= test TEST_WRKSRC?= ${BUILD_WRKSRC} -.if !target(test) -test: regression-test -.endif # test -regression-test: build +do-test: .if ${USE_PERL5:Mmodbuild*} - -cd ${TEST_WRKSRC}/ && ${SETENV} ${TEST_ENV} ${PERL5} ${PL_BUILD} ${TEST_TARGET} ${TEST_ARGS} + cd ${TEST_WRKSRC}/ && ${SETENV} ${TEST_ENV} ${PERL5} ${PL_BUILD} ${TEST_TARGET} ${TEST_ARGS} .elif ${USE_PERL5:Mconfigure} - -cd ${TEST_WRKSRC}/ && ${SETENV} ${TEST_ENV} ${MAKE_CMD} ${TEST_ARGS} ${TEST_TARGET} + cd ${TEST_WRKSRC}/ && ${SETENV} ${TEST_ENV} ${MAKE_CMD} ${TEST_ARGS} ${TEST_TARGET} .endif # USE_PERL5:Mmodbuild* .endif # regression-test .endif # defined(_POSTMKINCLUDED) |