Skip Menu |

Preferred bug tracker

Please visit the preferred bug tracker to report your issue.

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

Report information
The Basics
Id: 33587
Status: resolved
Priority: 0/
Queue: Test-Simple

People
Owner: Nobody in particular
Requestors: ANDK [...] cpan.org
ovid [...] cpan.org
Cc: ADIE [...] cpan.org
AdminCc:

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



CC: ADIE [...] cpan.org
Subject: Test-Simple-0.75 breaks Test-Class-0.28
Today my smoke machine reported broken Test-Class-0.28. A quick glance over the recent changes in all dependencies revealed that it's coming from Test-Simple-0.75. Downgrading to Test-Simple-0.74 fixes things. Regards,
Subject: Re: [rt.cpan.org #33574] Test-Simple-0.75 breaks Test-Class-0.28
Date: Mon, 25 Feb 2008 17:07:24 -0800
To: bug-Test-Simple [...] rt.cpan.org
From: Michael G Schwern <schwern [...] pobox.com>
Andreas Koenig via RT wrote: Show quoted text
> Today my smoke machine reported broken Test-Class-0.28. A quick glance > over the recent changes in all dependencies revealed that it's coming > from Test-Simple-0.75. Downgrading to Test-Simple-0.74 fixes things.
I see the problem. I "fixed" the way it finds $TODO to match the documentation but made it much more rigid. It now honors exported_to(). I think the "broken" way DTRT much more often by relying on caller(). -- Just call me 'Moron Sugar'. http://www.somethingpositive.net/sp05182002.shtml
From: ADIE [...] cpan.org
On Mon Feb 25 20:09:58 2008, schwern@pobox.com wrote: Show quoted text
> Andreas Koenig via RT wrote:
> > Today my smoke machine reported broken Test-Class-0.28. A quick glance > > over the recent changes in all dependencies revealed that it's coming > > from Test-Simple-0.75. Downgrading to Test-Simple-0.74 fixes things.
> > I see the problem. I "fixed" the way it finds $TODO to match the > documentation but made it much more rigid. It now honors exported_to(). I > think the "broken" way DTRT much more often by relying on caller().
So - should I be looking to fix this or are you going to break T::S again ;-) Not really been paying attention recently coz I've been busy with conference stuff. Should have a little more free time to fix bugs now! Cheers, Adrian
Subject: TODO broken when another package uses Test::More
We've test failures at the BBC do to the following simplified test case: #!/usr/bin/env perl use strict; use warnings; use Test::Builder 0.75; use Test::More qw/no_plan/; BEGIN { package Foo; use Test::More; } TODO: { local $TODO = 'foobar'; ok 0, 'testing todo'; } The problem is in Test::Builder::ok. You now have: my $todo = $self->todo; That used to be: my($pack, $file, $line) = $self->caller; my $todo = $self->todo($pack); Because the first argument to &todo is now undefined, the &todo method breaks: sub todo { my($self, $pack) = @_; $pack = $pack || $self->exported_to || $self->caller($Level); return 0 unless $pack; no strict 'refs'; ## no critic return defined ${$pack.'::TODO'} ? ${$pack.'::TODO'} : 0; } $self->exported_to reports the last package that the functions were exported to, and in my sample code, this means that package $Foo::TODO is checked instead of $main::TODO. This appears to be a similar bug to http://rt.cpan.org/Ticket/Display.html?id=33574 The simple work around is to ensure that Test::More in your testing code is always loaded after the other classes, but because load order is important, if you have tests being run in more than one package at the same time, TODO tests are now very fragile. Yes, you can argue that we shouldn't do this, but it does play havoc with code already out there. Cheers, Ovid
Short version: I'm putting it back the way it was. The whole idea of exported_to() is fundamentally broken, Test::Builder modules can be exported several times in one process but only the last one wins. Also there's nothing saying a test can't switch packages. I'll likely drop it from the TODO logic entirely and let it just rely on caller(), which is what it was doing before. That's much more user friendly.
0.77 fixes this problem.
CC: ANDK [...] cpan.org, ovid [...] cpan.org, ADIE [...] cpan.org
Subject: Re: [rt.cpan.org #33587] TODO broken when another package uses Test::More
Date: Wed, 27 Feb 2008 10:29:14 +0000
To: bug-Test-Simple [...] rt.cpan.org
From: Adrian Howard <adrianh [...] quietstars.com>
On 27 Feb 2008, at 10:06, Michael G Schwern via RT wrote: Show quoted text
> > <URL: http://rt.cpan.org/Ticket/Display.html?id=33587 > > > 0.77 fixes this problem.
You are a lovely man. Ta. I'll throw out a new T::C with a dependency on it when I get a spare second. Adrian.
Reclosing.