summaryrefslogtreecommitdiff
path: root/t/op/magic.t
diff options
context:
space:
mode:
authorSteve Hay <steve.m.hay@googlemail.com>2013-06-18 09:02:14 +0100
committerSteve Hay <steve.m.hay@googlemail.com>2013-06-18 12:59:12 +0100
commit88348cbd8676d112510b173227aad493ecf0c759 (patch)
tree6955312700bf26f6fffef5abe9f0191e6c61b67b /t/op/magic.t
parentc1b30ad9d14ad1617d1aab860bdd5cf4ac66833a (diff)
downloadperl-88348cbd8676d112510b173227aad493ecf0c759.tar.gz
Fix t\op\magic.t when building with ALL_STATIC=define on Windows
Two tests must be skipped in this case since Tie::Hash::NamedCapture is already loaded, but the existing skip doesn't cover this case. The Windows static build statically links extensions into perl519.dll, not perl.exe (although there is a separate perl-static.exe as well for anyone wanting that), so $Config{usedl} is still set to 'define'. So instead, check $Config{static_ext} to see if the package is really statically linked, which is a more accurate check anyway and renders the $Config{usedl} check redundant.
Diffstat (limited to 't/op/magic.t')
-rw-r--r--t/op/magic.t12
1 files changed, 7 insertions, 5 deletions
diff --git a/t/op/magic.t b/t/op/magic.t
index ac66b60083..fc7e205a44 100644
--- a/t/op/magic.t
+++ b/t/op/magic.t
@@ -466,11 +466,13 @@ SKIP: {
}
# Check that we don't auto-load packages
-SKIP: {
- skip "staticly linked; may be preloaded", 4 unless $Config{usedl};
- foreach (['powie::!', 'Errno'],
- ['powie::+', 'Tie::Hash::NamedCapture']) {
- my ($symbol, $package) = @$_;
+foreach (['powie::!', 'Errno'],
+ ['powie::+', 'Tie::Hash::NamedCapture']) {
+ my ($symbol, $package) = @$_;
+ SKIP: {
+ (my $extension = $package) =~ s|::|/|g;
+ skip "$package is statically linked", 2
+ if $Config{static_ext} =~ m|\b\Q$extension\E\b|;
foreach my $scalar_first ('', '$$symbol;') {
my $desc = qq{Referencing %{"$symbol"}};
$desc .= qq{ after mentioning \${"$symbol"}} if $scalar_first;