Skip Menu |
 

This queue is for tickets about the TAP-Parser CPAN distribution.

Report information
The Basics
Id: 27125
Status: resolved
Worked: 10 min
Priority: 0/
Queue: TAP-Parser

People
Owner: andy [...] hexten.net
Requestors: DROLSKY [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Subject: 120-harness.t has failures if TAP::Harness::Color cannot load optional modules
MIME-Version: 1.0
X-Mailer: MIME-tools 5.418 (Entity 5.418)
X-RT-Original-Encoding: utf-8
Content-Type: multipart/mixed; boundary="----------=_1179160914-31197-1"
Content-Length: 0
Content-Type: text/plain; charset="utf8"
Content-Disposition: inline
Content-Transfer-Encoding: binary
Content-Length: 182
Download (untitled) / with headers
text/plain 182b
I saw this on Windows, but I think it could happen on Linux too, if Term::ANSIColor wasn't installed. I've attached a patch that skips the color harness tests if we can't colorize.
Subject: th.patch
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="----------=_1179160913-31197-0"
X-Mailer: MIME-tools 5.418 (Entity 5.418)
Content-Length: 0
Content-Type: text/plain; charset="utf8"
Content-Disposition: inline
Content-Transfer-Encoding: binary
X-RT-Original-Encoding: utf-8
Content-Length: 0
Content-Type: text/x-patch; name="th.patch"
Content-Disposition: inline; filename="th.patch"
Content-Transfer-Encoding: binary
X-RT-Original-Encoding: ascii
Content-Length: 1804
Download th.patch
text/x-diff 1.7k
diff -ru ../TAP-Parser-0.51.orig/lib/TAP/Harness/Color.pm ./lib/TAP/Harness/Color.pm --- ../TAP-Parser-0.51.orig/lib/TAP/Harness/Color.pm 2007-05-14 11:39:45.000000000 -0500 +++ ./lib/TAP/Harness/Color.pm 2007-05-14 11:40:46.000000000 -0500 @@ -139,6 +139,21 @@ } return $class->SUPER::new(@_); } +############################################################################## + +=head3 C<CanColor> + + Test::Harness::Color->CanColor() + +Returns a boolean indicating whether or not this module can actually +generate colored output. This will be false if it could not load the +modules needed for the current platform. + +=cut + +sub CanColor { + return 0 ! $NO_COLOR; +} ############################################################################## diff -ru ../TAP-Parser-0.51.orig/t/120-harness.t ./t/120-harness.t --- ../TAP-Parser-0.51.orig/t/120-harness.t 2007-05-14 11:39:45.000000000 -0500 +++ ./t/120-harness.t 2007-05-14 11:34:48.000000000 -0500 @@ -4,7 +4,7 @@ use lib 'lib'; -use Test::More tests => 132; +use Test::More; # these tests cannot be run from the t/ directory due to checking for the # existence of execrc @@ -30,11 +30,17 @@ use TAP::Harness; use TAP::Harness::Color; +my @HARNESSES = 'TAP::Harness'; +push @HARNESSES, 'TAP::Harness::Color' + if TAP::Harness::Color->CanColor(); + +plan tests => TAP::Harness::Color->CanColor() ? 132 : 83; + # note that this test will always pass when run through 'prove' ok $ENV{HARNESS_ACTIVE}, 'HARNESS_ACTIVE env variable should be set'; ok $ENV{HARNESS_VERSION}, 'HARNESS_VERSION env variable should be set'; -foreach my $HARNESS (qw<TAP::Harness TAP::Harness::Color>) { +foreach my $HARNESS (@HARNESSES) { #foreach my $HARNESS ( () ) { # XXX can_ok $HARNESS, 'new'; Only in .: th.patch
MIME-Version: 1.0
X-Mailer: MIME-tools 5.418 (Entity 5.418)
Content-Disposition: inline
Message-Id: <rt-3.6.HEAD-31153-1179170244-126.27125-0-0 [...] rt.cpan.org>
Content-Type: text/plain; charset="utf8"
Content-Transfer-Encoding: binary
From: andy at hexten dot net
X-RT-Original-Encoding: utf-8
X-RT-Original-Encoding: utf-8
Content-Length: 302
Download (untitled) / with headers
text/plain 302b
On Mon May 14 12:42:02 2007, DROLSKY wrote: Show quoted text
> I saw this on Windows, but I think it could happen on Linux too, if > Term::ANSIColor wasn't installed. > > I've attached a patch that skips the color harness tests if we can't > colorize.
Thanks Dave - patch applied with a couple of minor modifications.
MIME-Version: 1.0
X-Mailer: MIME-tools 5.418 (Entity 5.418)
Content-Disposition: inline
Message-Id: <rt-3.6.HEAD-31161-1179170330-512.27125-0-0 [...] rt.cpan.org>
Content-Type: text/plain; charset="utf8"
Content-Transfer-Encoding: binary
X-RT-Original-Encoding: utf-8
X-RT-Original-Encoding: utf-8
Content-Length: 32
Oops - I /can/ mark it closed :)


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.