Subject: | Don't turn on threads |
Test::Tester::Capture turns on threads if Perl is configured to have
them. This is not necessary to support threads, the test just has to
load them before Test::Tester (same as Test::More).
It is impolite for a module to load threads if they're not going to use
them and can change the result of a test. It can also confuse other
modules which may load threads::shared before Test::Tester (ie.
threads::shared looks to see if threads are on only once, when it's
first loaded).
Specifically, it can confuse Test::Builder which can load
threads::shared BEFORE Test::Tester::Capture (loaded via
Test::Tester::CaptureRunner). It only happens to work now because
Test::Builder currently doesn't load threads::shared unless threads are
already enabled in the process.
Patch attached.
This affects Test::Builder1.5, and any module which uses Test::Tester.
It would help the effort if a release could be made as soon as you have
a chance. Thank you very much.
Subject: | ttcapture.patch |
diff --git a/lib/Test/Tester/Capture.pm b/lib/Test/Tester/Capture.pm
index b1b4de6..a349e3d 100644
--- a/lib/Test/Tester/Capture.pm
+++ b/lib/Test/Tester/Capture.pm
@@ -11,7 +11,6 @@ use vars qw( @ISA );
BEGIN {
use Config;
if( $] >= 5.008 && $Config{useithreads} ) {
- require threads;
require threads::shared;
threads::shared->import;
}