Subject: | impossible to use without Test::More |
hi there --
Test::Memory::Cycle seems like a useful tool to add to the Mail::SpamAssassin test suite. however, we're still using Test, rather than Test::More, due to backwards compatibility with perl 5.6.1.
It seems Test::Memory::Cycle hooks heavily into the latter, and as far as I can see it's basically impossible (without some nasty kludging) to use unless we also make Test::More a requirement; I can't even *check* to see if Test::More is installed without making a mess ;) e.g.:
my $NUMTESTS = 3;
my $HAVE_TEST_MEM_CYCLE;
{
local $SIG{__DIE__} = 'warn';
open (OLD, ">&STDOUT");
open (STDOUT, ">log/stdout");
eval '
use Test::More tests => $NUMTESTS;
use Test::Memory::Cycle;
';
$HAVE_TEST_MEM_CYCLE = !(defined($@) && $@ ne '');
open (STDOUT, ">&OLD");
close OLD;
}
unless ($HAVE_TEST_MEM_CYCLE) {
print "1..0\n";
print "# Test::Memory::Cycle required for this test, skipped\n";
exit 0;
END { $? = 0; } # Test::Builder screws us around otherwise
}
# otherwise, we do have those modules and we can carry on
that's as far as I got before I gave up. it appears there's more stuff I'd
need to hook my way around before it could work, and that much wierd kludge
code isn't the sort of thing we'd want to put in our "t" -- given the wierd platforms people install SpamAssassin on ;)
Any chance you could consider a use qw() flag that would stop Test::Memory::Cycle hooking so heavily into Test::More?