Skip Menu |

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

Report information
The Basics
Id: 53657
Status: resolved
Priority: 0/
Queue: TAP-Harness-JUnit

People
Owner: Nobody in particular
Requestors: agoel [...] cal.berkeley.edu
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in: 0.32
Fixed in: 0.33



Subject: Error using namemangle option with ::new
Perl version: 5.10.0 for MSWin32-x86-multi-thread Operating System: Windows XP Distribution: TAP::Harness::JUnit v0.32 When trying to use the namemangle option, I get the following error in my distribution: ========== [exec] Unknown arguments to TAP::Harness::new (namemangle) at RunSeabedTestsBase.pl line 16 [exec] Result: 255 ========== When looking at the JUnit.pm code, I noticed that from lines 94-107, the code calls delete for the xmlfile and notimes arguments (which are not recognized by TAP::Harness::new. However, there is no corresponding delete for namemangle. I think that there should be delete statement for namemangle that is similar to the what exists on line 107 of JUnit.pm.
From: mzrinsky [...] redanvil.net
Attached a patch which fixes the namemangle error when using ->new() :)
Subject: junit_namemangle.patch
--- /TAP/Harness/JUnit.pm 2010-01-27 12:03:49.000000000 -0600 +++ /TAP/Harness/JUnit.pm 2010-01-26 16:47:13.000000000 -0600 @@ -106,17 +106,15 @@ sub new { my $notimes = delete $args->{notimes}; + my $namemangle = delete $args->{namemangle} || 'hudson'; + my $self = $class->SUPER::new($args); $self->{__xmlfile} = $xmlfile; $self->{__xml} = {testsuite => []}; $self->{__rawtapdir} = $rawtapdir; $self->{__cleantap} = not defined $ENV{PERL_TEST_HARNESS_DUMP_TAP}; $self->{__notimes} = $notimes; - if (defined $args->{namemangle}) { - $self->{__namemangle} = $args->{namemangle}; - } else { - $self->{__namemangle} = 'hudson'; - } + $self->{__namemangle} = $namemangle; return $self; }
On 2010-1月-27 水 13:08:28, pldoh wrote: Show quoted text
> Attached a patch which fixes the namemangle error when using ->new() > > :)
I've made git-formatted patch and a test.
Subject: namemangle-git.diff
diff --git a/lib/TAP/Harness/JUnit.pm b/lib/TAP/Harness/JUnit.pm index 9e8eb9b..2f54f0a 100644 --- a/lib/TAP/Harness/JUnit.pm +++ b/lib/TAP/Harness/JUnit.pm @@ -106,17 +106,15 @@ sub new { my $notimes = delete $args->{notimes}; + my $namemangle = delete $args->{namemangle} || 'hudson'; + my $self = $class->SUPER::new($args); $self->{__xmlfile} = $xmlfile; $self->{__xml} = {testsuite => []}; $self->{__rawtapdir} = $rawtapdir; $self->{__cleantap} = not defined $ENV{PERL_TEST_HARNESS_DUMP_TAP}; $self->{__notimes} = $notimes; - if (defined $args->{namemangle}) { - $self->{__namemangle} = $args->{namemangle}; - } else { - $self->{__namemangle} = 'hudson'; - } + $self->{__namemangle} = $namemangle; return $self; } diff --git a/t/namemangle.t b/t/namemangle.t new file mode 100644 index 0000000..60d810b --- /dev/null +++ b/t/namemangle.t @@ -0,0 +1,11 @@ +use strict; +use warnings; +use Test::More tests => 1; +use TAP::Harness::JUnit; + +my $harness = TAP::Harness::JUnit->new({ + namemangle => 1, + xmlfile => 'dummy.xml', + merge => 1, +}); +isa_ok($harness, 'TAP::Harness::JUnit');