Skip Menu |

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

Report information
The Basics
Id: 99944
Status: resolved
Priority: 0/
Queue: Test-Memory-Cycle

People
Owner: Nobody in particular
Requestors: SREZIC [...] cpan.org
Cc: AVENJ [...] cpan.org
PLICEASE [...] cpan.org
AdminCc:

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



Subject: CGI.pm not declared as a dependency
Since perl 5.21.x CGI.pm is not anymore part of a standard perl install, so tests may fail if it's not manually installed. See http://www.cpantesters.org/cpan/report/3d097034-41f2-11e4-b1f2-c3882c6f0924 for a sample fail report.
Perl 5.22 is now available, and CGI.pm has been removed from core. I'd like to be able to use this _without_ installing CGI.pm under 5.22 if possible. Anything I can do to help get this cleaned up?
Looks to me that it's only used in t/good.t to test an arbitrary non-failing module, and that I picked CGI.pm because it was core back in 2006. I'm also surprised that anyone's using this module at all. Is it helpful? Have you caught problems with it?
On 2015-06-09 14:54:47, PETDANCE wrote: Show quoted text
> I'm also surprised that anyone's using this module at all. Is it > helpful? Have you caught problems with it?
The module has a huge reverse dependency list: https://metacpan.org/requires/distribution/Test-Memory-Cycle?sort=[[2,1]] And this is only first level dependencies! So it would be good to have this fixed...
Well, that's certainly surprising. I had no idea anyone was using it, much less as dependencies in anything, much less Moose and Dancer.
On Tue Jun 09 21:04:42 2015, PETDANCE wrote: Show quoted text
> Well, that's certainly surprising. I had no idea anyone was using it, > much less as dependencies in anything, much less Moose and Dancer.
I also use it at the end of all Config::Model tests. Thanks for this module
On Tue Jun 09 15:04:42 2015, PETDANCE wrote: Show quoted text
> Well, that's certainly surprising. I had no idea anyone was using it, > much less as dependencies in anything, much less Moose and Dancer.
I'm using it in a few places; e.g.: https://metacpan.org/source/PEVANS/Tangence-0.21/t/30props-cbs.t#L162 I too have been caught out by the lack of CGI post 5.20 -- Paul Evans
It seems to me that it has been established that this module is useful and is being used by a number of other modules. Can we agree that it should be fixed and determine the best way to do that? If perhaps the current owner does not have the time or interest in fixing this, then perhaps someone can adopt this module? A simple solution would be to skip the test in the case that CGI is not available: https://github.com/plicease/Test-Memory-Cycle/commit/910f53e8d47f1a805ef31ab766e806216a7504a0.diff A better fix would be to replace it with a test that does not use CGI at all. To my mind good.t is not a very good test because it is testing CGI instead of Test::Memory::Cycle. If someone does introduce a memory cycle into CGI it should not cause this module to fail its tests.
I'd be glad to have a better test.
On Thu Oct 29 10:51:31 2015, PETDANCE wrote: Show quoted text
> I'd be glad to have a better test.
Please find attached diff'd versions of the two better tests that I proposed.
Subject: bundled.diff
diff --git a/t/Foo.pm b/t/Foo.pm new file mode 100644 index 0000000..17336ca --- /dev/null +++ b/t/Foo.pm @@ -0,0 +1,12 @@ +package + Foo; + +use strict; +use warnings; + +sub new { + my($class) = @_; + bless {}, $class; +} + +1; diff --git a/t/good.t b/t/good.t index 71d3373..cbad33f 100644 --- a/t/good.t +++ b/t/good.t @@ -4,14 +4,15 @@ use strict; use Test::Builder::Tester tests => 2; use Test::More; -use CGI; +use lib 't'; +use Foo; BEGIN { use_ok( 'Test::Memory::Cycle' ); } GOOD: { - my $cgi = new CGI; + my $cgi = new Foo; - memory_cycle_ok( $cgi, "CGI doesn't leak" ); + memory_cycle_ok( $cgi, "Foo doesn't leak" ); }
Subject: skip.diff
diff --git a/t/good.t b/t/good.t index 71d3373..24e72a4 100644 --- a/t/good.t +++ b/t/good.t @@ -2,11 +2,13 @@ use strict; -use Test::Builder::Tester tests => 2; +use Test::Builder::Tester; use Test::More; -use CGI; BEGIN { + eval q{ use CGI }; + plan skip_all => 'test requires CGI' if $@; + plan tests => 2; use_ok( 'Test::Memory::Cycle' ); }
I have removed the CGI.pm from the testing in 1.06.