ports/164896: [exp-run] add support for testing perl modules
Steve Wills
swills at FreeBSD.org
Wed Feb 8 04:10:15 UTC 2012
>Number: 164896
>Category: ports
>Synopsis: [exp-run] add support for testing perl modules
>Confidential: no
>Severity: non-critical
>Priority: low
>Responsible: freebsd-ports-bugs
>State: open
>Quarter:
>Keywords:
>Date-Required:
>Class: sw-bug
>Submitter-Id: current-users
>Arrival-Date: Wed Feb 08 04:10:15 UTC 2012
>Closed-Date:
>Last-Modified:
>Originator: Steve Wills
>Release:
>Organization:
>Environment:
>Description:
I'm working on testing perl modules. This patch is the first part of a more complete solution for testing perl modules. This will make it possible to run tests. The second part will need to add support for installing TEST_DEPENDS, either in a separate "stage" or as a normal target. Feedback on the approach would be appreciated. In the mean time, an exp-run for this patch is requested.
>How-To-Repeat:
>Fix:
Patch attached with submission follows:
Index: Mk/bsd.perl.mk
===================================================================
RCS file: /home/pcvs/ports/Mk/bsd.perl.mk,v
retrieving revision 1.22
diff -u -r1.22 bsd.perl.mk
--- Mk/bsd.perl.mk 15 Aug 2011 06:50:00 -0000 1.22
+++ Mk/bsd.perl.mk 29 Jan 2012 04:39:58 -0000
@@ -225,3 +225,15 @@
.endif # !defined(USE_GMAKE)
.endif # defined(PERL_MODBUILD)
.endif # defined(_POSTMKINCLUDED) && !defined(Perl_Post_Include)
+
+# run tests if requested
+.if defined(USE_PERL_TEST) && !defined(NO_TEST)
+.if !target(test)
+test: build
+.if defined(PERL_MODBUILD)
+ @cd ${WRKSRC} && ${SETENV} ${MAKE_ENV} ${PERL5} ${PL_BUILD} test
+.elif defined(PERL_CONFIGURE)
+ @cd ${WRKSRC} && ${SETENV} ${MAKE_ENV} ${MAKE} test
+.endif # defined(PERL_MODBUILD)
+.endif # !target(test)
+.endif # defined(USE_PERL_TEST) && !defined(NO_TEST)
Index: Mk/bsd.port.mk
===================================================================
RCS file: /home/pcvs/ports/Mk/bsd.port.mk,v
retrieving revision 1.703
diff -u -r1.703 bsd.port.mk
--- Mk/bsd.port.mk 22 Jan 2012 15:41:33 -0000 1.703
+++ Mk/bsd.port.mk 29 Jan 2012 04:39:59 -0000
@@ -6306,6 +6306,16 @@
@${DO_NADA}
.endif
+.if !target(regression-test)
+regression-test: test
+ @${DO_NADA}
+.endif
+
+.if !target(test)
+test: build
+ @${DO_NADA}
+.endif
+
.endif
# End of post-makefile section.
>Release-Note:
>Audit-Trail:
>Unformatted:
More information about the freebsd-ports-bugs
mailing list