On Sat, Jul 21, 2007 at 04:52:08PM +0200, Simon Bertrang wrote:
> Hi porters,
> a few weeks ago steven@ sent a diff for cpan.port.mk that provides
> regress reporting functionality via p5-Test-Reporter. When i saw that
> the cpantest script directly sends out emails i stepped in and changed
> a few bits to write the report mail into a file.
> Unfortunately the output was not correct and additionally the existing
> code of cpantest made my eys bleed, so i wrote build/cpanreport.
> It's very simple, still depends on p5-Test-Reporter but does the job.
> I've got a bit feedback already but i want more solid replies before i
> commit this.
>
After newer versions of p5-Test-Reporter got cleaned up a bit i gave
cpantest a new chance, fixed the -dump output and retried with it (bug
filed and diff attached).
> To use it, apply the diff, set CPAN_REPORT=Yes, create a directory for
> the reports (i.e. /usr/ports/mystuff/reports) and set CPAN_REPORT_DB to
> point to it.
> With this all perl ports using the cpan.port.mk will write files you can
> email to [EMAIL PROTECTED] after you `make regress'.
>
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}.
This time with the corresponding manpage bits.
Objections?
Regards,
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 11:44:28 -0000
@@ -21,3 +21,24 @@ PKG_ARCH?= *
REGRESS_DEPENDS+=::devel/p5-Test-Pod \
::devel/p5-Test-Pod-Coverage
.endif
+
+CPAN_REPORT?= No
+
+.if ${CPAN_REPORT:L} == "yes"
+REGRESS_DEPENDS+=::devel/p5-Test-Reporter
+REGRESS_FLAGS+= TEST_VERBOSE=1
+CPAN_REPORT_FROM?=${MAINTAINER}
+. if !defined(CPAN_REPORT_DB) || !exists(${CPAN_REPORT_DB})
+ERRORS+= "Fatal: CPAN_REPORT_DB must point to a directory"
+. 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 11:41:59 -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 written to a directory
+.Po
+see also
+.Ev CPAN_REPORT_DB
+.Pc .
+Default is
+.Sq \&No .
+The reports are written to a file 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 for the reports created with
+.Ev CPAN_REPORT ,
+defaults to
+.Pa ${MAINTAINER} .
.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.
Index: Makefile
===================================================================
RCS file: /cvs/ports/devel/p5-Test-Reporter/Makefile,v
retrieving revision 1.2
diff -u -p -r1.2 Makefile
--- Makefile 16 Sep 2007 02:53:10 -0000 1.2
+++ Makefile 5 Oct 2007 15:58:39 -0000
@@ -3,7 +3,7 @@
COMMENT= sends test results to [EMAIL PROTECTED]
MODULES= cpan
-DISTNAME= Test-Reporter-1.27
+DISTNAME= Test-Reporter-1.34
CATEGORIES= devel
# perl
Index: distinfo
===================================================================
RCS file: /cvs/ports/devel/p5-Test-Reporter/distinfo,v
retrieving revision 1.2
diff -u -p -r1.2 distinfo
--- distinfo 5 Apr 2007 15:38:03 -0000 1.2
+++ distinfo 5 Oct 2007 15:58:39 -0000
@@ -1,5 +1,5 @@
-MD5 (Test-Reporter-1.27.tar.gz) = Pntw7Xl5QhkvtJ0oupuKyQ==
-RMD160 (Test-Reporter-1.27.tar.gz) = JtMo0J6jD20r4Q0BomVg2TXCs3w=
-SHA1 (Test-Reporter-1.27.tar.gz) = s6pD2eT5Rk2OGfqc+WjVYb8xJlc=
-SHA256 (Test-Reporter-1.27.tar.gz) =
LQjTbg5FOCGQvMd57eHPJoXJGZQVmBIMa9kRrHRmBN0=
-SIZE (Test-Reporter-1.27.tar.gz) = 23808
+MD5 (Test-Reporter-1.34.tar.gz) = ifPwMECYSqH8DLp45r+AQg==
+RMD160 (Test-Reporter-1.34.tar.gz) = 3RFhUCQA4NiUrEJJPYO1MT2lYVc=
+SHA1 (Test-Reporter-1.34.tar.gz) = gvcOaDlvps8EvV2ybaF0Yjaltpw=
+SHA256 (Test-Reporter-1.34.tar.gz) =
puNr18REE3LAQP6HRujurUNBSR02Ns1fN6ytKDNjMGg=
+SIZE (Test-Reporter-1.34.tar.gz) = 22089
Index: patches/patch-bin_cpantest
===================================================================
RCS file: patches/patch-bin_cpantest
diff -N patches/patch-bin_cpantest
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ patches/patch-bin_cpantest 5 Oct 2007 15:58:39 -0000
@@ -0,0 +1,13 @@
+$OpenBSD$
+--- bin/cpantest.orig Mon Aug 13 05:24:03 2007
++++ bin/cpantest Fri Oct 5 17:55:02 2007
+@@ -47,7 +47,8 @@ $Reporter = Test::Reporter->new();
+
+ if ($Dump) {
+ my $fh; open($fh, '>-') or die "Can't open STDOUT: $!";
+- print $Reporter->write($fh);
++ $Reporter->write($fh);
++ print $fh "\n";
+ } else {
+ &confirm_send() if not $Automatic;
+ &send();
Index: pkg/PLIST
===================================================================
RCS file: /cvs/ports/devel/p5-Test-Reporter/pkg/PLIST,v
retrieving revision 1.1.1.1
diff -u -p -r1.1.1.1 PLIST
--- pkg/PLIST 3 Dec 2006 13:09:30 -0000 1.1.1.1
+++ pkg/PLIST 5 Oct 2007 15:58:39 -0000
@@ -1,16 +1,6 @@
@comment $OpenBSD: PLIST,v 1.1.1.1 2006/12/03 13:09:30 steven Exp $
bin/cpantest
${P5SITE}/Test/
-${P5SITE}/Test/Reporter/
${P5SITE}/Test/Reporter.pm
-${P5SITE}/Test/Reporter/Date/
-${P5SITE}/Test/Reporter/Date/Format.pm
-${P5SITE}/Test/Reporter/Mail/
-${P5SITE}/Test/Reporter/Mail/Util.pm
-${P5SITE}/Test/Reporter/Time/
-${P5SITE}/Test/Reporter/Time/Zone.pm
@man man/man1/cpantest.1
@man man/man3p/Test::Reporter.3p
[EMAIL PROTECTED] man/man3p/Test::Reporter::Date::Format.3p
[EMAIL PROTECTED] man/man3p/Test::Reporter::Mail::Util.3p
[EMAIL PROTECTED] man/man3p/Test::Reporter::Time::Zone.3p