Subject: | Not detecting threaded builds in tests |
'make test' incorrectly skips tests for threaded builds:
/usr/bin/perl.exe "-MExtUtils::Command::MM" "-e" "test_harness(0,
'blib/lib', 'blib/arch')" t/*.t
t/rebless.......ok
t/refhash.......ok
t/storable......ok
t/threaded......skipped: -- threads aren't enabled in your perl, or
Scalar::Util::weaken is missing
All tests successful.
Files=4, Tests=65, 1 wallclock secs ( 0.06 usr 0.03 sys + 0.84 cusr
0.20 csys = 1.13 CPU)
Result: PASS
This is caused by the eval relying on the return value of
threads->import which is not guaranteed to be true. The attached patch
fixes this.
Subject: | tr.patch |
--- t/threaded.t.orig 2008-01-17 09:32:15.676853400 -0500
+++ t/threaded.t 2008-01-17 09:42:40.639465800 -0500
@@ -21,7 +21,7 @@
}
if ( $Config{usethreads} and !$Config{use5005threads}
and defined(&Scalar::Util::weaken)
- and eval { require threads; "threads"->import }
+ and eval { require threads; threads->import; 1 }
) {
print "1..14\n";
} else {