Skip Menu |
 

This queue is for tickets about the Test-NoWarnings CPAN distribution.

Report information
The Basics
Id: 66485
Status: open
Priority: 0/
Queue: Test-NoWarnings

People
Owner: Nobody in particular
Requestors: tokuhirom+cpan [...] gmail.com
Cc:
AdminCc:

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



Subject: Test::NoWarnings does not works with done_testing.
Download (untitled) / with headers
text/plain 349b
Code: --------------------------------------------- use strict; use warnings; use Test::More; use Test::NoWarnings; note "Test::NoWarnings: $Test::NoWarnings::VERSION"; ok 1; done_testing; Output ------------------------------------------------- # Test::NoWarnings: 1.02 ok 1 1..1 ok 2 - no warnings # Looks like you planned 1 test but ran 2.
Download (untitled) / with headers
text/plain 277b
This is a duplicate of https://rt.cpan.org/Public/Bug/Display.html?id=52412 (and is the same problem I was about to report). Workaround: put "END { done_testing() }" before you "use Test::NoWarnings". Real fix is likely something in Test::Builder, but I don't really know.
Download (untitled) / with headers
text/plain 693b
On Thu Mar 10 17:53:31 2011, DMCBRIDE wrote: Show quoted text
> This is a duplicate of > https://rt.cpan.org/Public/Bug/Display.html?id=52412 > (and is the same problem I was about to report). > > Workaround: put "END { done_testing() }" before you "use > Test::NoWarnings". Real fix is likely something in Test::Builder, but > I don't > really know.
I don't think this is a good workaround, because if done_testing is in an END block, tests will seem to pass even if they shouldn't if exit() is called. The following test outputs: ok 1 1..1 #!/usr/bin/perl use strict; use warnings; use Test::More; ok(1); # Mimick some function that exits exit; ok(0, 'Got 1'); END { done_testing; }
Subject: Re: [rt.cpan.org #66485] Test::NoWarnings does not works with done_testing.
Date: Tue, 8 Nov 2011 08:32:40 +0900
To: bug-Test-NoWarnings [...] rt.cpan.org, Michael G Schwern <schwern [...] gmail.com>
From: Fergal Daly <fergal [...] esatclear.ie>
Download (untitled) / with headers
text/plain 424b
[+schwern] That's a good point. What would be nice is a hook in Test::Builder for this kind of "final" test to invoke it either on a call to done_testing or in the finalising code for T::B. I have no idea if that's feasible currently. Alternatively if T::NW had a way to invoke the warning check manually, you could call that before done_testing (and then the final check should be skipped). I'd take a patch for that, F
Subject: Re: [rt.cpan.org #66485] Test::NoWarnings does not works with done_testing.
Date: Tue, 8 Nov 2011 12:22:55 +1100
To: bug-Test-NoWarnings [...] rt.cpan.org
From: Adam Kennedy <adamkennedybackup [...] gmail.com>
Download (untitled) / with headers
text/plain 657b
done_warning; :) On 8 November 2011 10:32, Fergal Daly via RT <bug-Test-NoWarnings@rt.cpan.org> wrote: Show quoted text
>       Queue: Test-NoWarnings >  Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=66485 > > > [+schwern] > > That's a good point. What would be nice is a hook in Test::Builder for > this kind of "final" test to invoke it either on a call to > done_testing or in the finalising code for T::B. I have no idea if > that's feasible currently. > > Alternatively if T::NW had a way to invoke the warning check manually, > you could call that before done_testing (and then the final check > should be skipped). I'd take a patch for that, > > F > >
I see that r15475 adds some support for done_testing. Any plans to release it? -- Pavel Shaydo


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.