On Sat, Oct 06, 2007 at 05:36:25PM +0200, Marc Espie wrote:
> On Sat, Oct 06, 2007 at 02:01:18PM +0200, Simon Bertrang wrote:
> > This hasn't changed but i added a new variable CPAN_REPORT_FROM to set
> > the report sender address.  Defaults to ${MAINTAINER}.
> > Further i changed the report file name from ${DISTNAME} to ${PKGNAME}.
> 
> I disagree about this. CPAN_REPORT_FROM should not default. In fact, it
> should error out if it's not set.
> 
> You should have to set it to whomever is running the tests. Anything else
> is totally bogus.

Agreed.  Updated diffs attached.

Simon
Index: cpan.port.mk
===================================================================
RCS file: /cvs/ports/infrastructure/mk/cpan.port.mk,v
retrieving revision 1.4
diff -u -p -r1.4 cpan.port.mk
--- cpan.port.mk        25 Nov 2006 13:14:40 -0000      1.4
+++ cpan.port.mk        6 Oct 2007 15:59:40 -0000
@@ -21,3 +21,28 @@ PKG_ARCH?=   * 
 REGRESS_DEPENDS+=::devel/p5-Test-Pod \
                 ::devel/p5-Test-Pod-Coverage
 .endif
+
+CPAN_REPORT?=  No
+CPAN_REPORT_FROM?=
+
+.if ${CPAN_REPORT:L} == "yes"
+REGRESS_DEPENDS+=::devel/p5-Test-Reporter
+REGRESS_FLAGS+=        TEST_VERBOSE=1
+.  if !defined(CPAN_REPORT_DB) || !exists(${CPAN_REPORT_DB})
+ERRORS+=       "Fatal: CPAN_REPORT_DB must point to a directory"
+.  endif
+.  if !defined(CPAN_REPORT_FROM) || empty(CPAN_REPORT_FROM)
+ERRORS+=       "Fatal: CPAN_REPORT_FROM needs an email address"
+.  endif
+
+CPANTEST=      cpantest
+CPANTEST_FLAGS=        -f ${REGRESS_LOGFILE} -p ${DISTNAME} -from \
+               ${CPAN_REPORT_FROM:Q} -nc -dump > ${CPAN_REPORT_DB}/${PKGNAME}
+CPANTEST_PASS= -g pass ${CPANTEST_FLAGS}
+CPANTEST_FAIL= -g fail ${CPANTEST_FLAGS}
+
+post-regress:
+       @if grep 'All tests successful' ${REGRESS_LOGFILE}; then \
+               ${CPANTEST} ${CPANTEST_PASS}; \
+       else ${CPANTEST} ${CPANTEST_FAIL}; fi
+.endif
Index: bsd.port.mk.5
===================================================================
RCS file: /cvs/src/share/man/man5/bsd.port.mk.5,v
retrieving revision 1.201
diff -u -p -r1.201 bsd.port.mk.5
--- bsd.port.mk.5       23 Jun 2007 09:42:24 -0000      1.201
+++ bsd.port.mk.5       6 Oct 2007 15:57:42 -0000
@@ -817,6 +817,30 @@ User settings.
 Supplementary options appended to ${CFLAGS} for building.
 Since most ports ignore the COPTS convention, they are actually told to use
 ${CFLAGS} ${COPTS} as CFLAGS.
+.It Ev CPAN_REPORT
+User setting.
+Set to
+.Sq Yes
+the results of regression tests are stored in the
+.Ev CPAN_REPORT_DB
+directory in email format
+.Po
+see also
+.Ev CPAN_REPORT_FROM
+.Pc .
+Default is
+.Sq \&No .
+The reports are written to files named after
+.Ev PKGNAME
+and should be sent to [EMAIL PROTECTED]
+.It Ev CPAN_REPORT_DB
+User setting.
+Sets the report directory to use with
+.Ev CPAN_REPORT .
+.It Ev CPAN_REPORT_FROM
+User setting.
+Sets the sender address of the reports created with
+.Ev CPAN_REPORT .
 .It Ev CXXDIAGFLAGS
 Flags appended to
 .Ev CXXFLAGS
@@ -962,7 +986,7 @@ Indicates that the port, using
 magic, will properly fake installation into ${WRKINST}, to be packaged
 and properly installed from the package.
 Set to
-.Sq No
+.Sq \&No
 in very rare cases, and during port creation.
 .It Ev FAKE_FLAGS
 Flags passed to ${MAKE_PROGRAM} on fake invocation.

Reply via email to