Skip to content

Commit 089e6b5

Browse files
committed
Fixes for XSConfig
1 parent 1f2d4ae commit 089e6b5

File tree

6 files changed

+29
-5
lines changed

6 files changed

+29
-5
lines changed

t/lib/NoFork.pm

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,21 @@ BEGIN {
44
*CORE::GLOBAL::fork = sub { die "you should not fork" };
55
}
66
use Config;
7-
tied(%Config)->{d_fork} = 0; # blatant lie
7+
if ($Config::Config{d_fork}) {
8+
if (exists &Config::KEYS) { # compiled Config
9+
*Config_FETCHorig = \&Config::FETCH;
10+
no warnings 'redefine';
11+
*Config::FETCH = sub {
12+
if ($_[0] and $_[1] eq 'd_fork') {
13+
return 0;
14+
} else {
15+
return Config_FETCHorig(@_);
16+
}
17+
}
18+
} else {
19+
tied(%Config)->{d_fork} = 0; # uncompiled Config
20+
}
21+
}
822

923
=begin TEST
1024

t/multiplexer.t

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,12 @@
22

33
use strict;
44
use warnings;
5+
BEGIN {
6+
chdir 'cpan/Test-Harness' unless -e 't/sample-tests/simple';
7+
}
58
use lib 't/lib';
69

10+
use Config ();
711
use Test::More qw( no_plan );
812

913
use File::Spec;

t/nofork.t

100755100644
Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
# NOTE maybe a good candidate for xt/author or something.
55

66
BEGIN {
7+
chdir 'cpan/Test-Harness' unless -e 't/lib/NoFork.pm';
78
use lib 't/lib';
89
}
910

@@ -15,7 +16,8 @@ use Test::More (
1516
$Config{d_fork}
1617
? 'no_plan'
1718
: ( 'skip_all' => 'your system already has no fork' )
18-
);
19+
);
20+
1921
use IO::c55Capture; # for util
2022

2123
use TAP::Harness;

t/regression.t

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,13 @@ BEGIN {
77
use strict;
88
use warnings;
99

10+
use Config;
11+
if ($Config::Config{usecperl}) {
12+
use Test::More 'skip_all' => 'cperl bug CM-834';
13+
}
1014
use Test::More 'no_plan';
1115

1216
use File::Spec;
13-
use Config;
1417

1518
use constant TRUE => "__TRUE__";
1619
use constant FALSE => "__FALSE__";

t/sample-tests/switches

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
print "1..1\n";
2-
print $INC{'strict.pm'} ? "ok 1\n" : "not ok 1\n";
2+
print $INC{'vars.pm'} ? "ok 1\n" : "not ok 1\n";

t/source_handler.t

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -355,7 +355,8 @@ sub test_handler {
355355

356356
SKIP:
357357
{
358-
%int::; # init the coretype if missing
358+
no warnings 'void';
359+
%int:: unless %int::; # init the coretype if missing
359360
my int $planned = 1;
360361
$planned += 1 + scalar @{ $test->{output} } if $test->{output};
361362
skip "$test->{skip_reason}", $planned if $test->{skip};

0 commit comments

Comments
 (0)