diff options
author | Daniel Dragan <bulk88@hotmail.com> | 2014-11-23 16:14:40 -0500 |
---|---|---|
committer | Tony Cook <tony@develop-help.com> | 2014-11-27 15:46:27 +1100 |
commit | ebfad2b9fea703468a88acb6a1afbb759366ffd5 (patch) | |
tree | 294ea272542016ed9a57987d575880565c0638b3 /t | |
parent | 3d50e539516253e2d26166a3eca071cba7bd72b8 (diff) | |
download | perl-ebfad2b9fea703468a88acb6a1afbb759366ffd5.tar.gz |
allow PERL_DISABLE_PMC to be defined from anywhere
I enable PERL_DISABLE_PMC in a .h, not in CCFLAGS. CCFLAGS on Unix
typically has no -Ds in it, build options go into config.h, not
Config.pm's CCFLAGS. This change allows PERL_DISABLE_PMC option to pass
tests regardless of where it is defined. cpan/parent/t/parent-pmc.t is not
fixed by this patch.
Diffstat (limited to 't')
-rw-r--r-- | t/comp/require.t | 11 | ||||
-rw-r--r-- | t/run/switchM.t | 10 |
2 files changed, 17 insertions, 4 deletions
diff --git a/t/comp/require.t b/t/comp/require.t index f817527495..ea569ad08f 100644 --- a/t/comp/require.t +++ b/t/comp/require.t @@ -243,13 +243,18 @@ EOT require Config; die "Failed to load Config for some reason" unless $Config::Config{version}; - my $ccflags = $Config::Config{ccflags}; - die "Failed to get ccflags for some reason" unless defined $ccflags; my $simple = ++$i; my $pmc_older = ++$i; my $pmc_dies = ++$i; - if ($ccflags =~ /(?:^|\s)-DPERL_DISABLE_PMC\b/) { + my $no_pmc; + foreach(Config::non_bincompat_options()) { + if($_ eq "PERL_DISABLE_PMC"){ + $no_pmc = 1; + last; + } + } + if ($no_pmc) { print "# .pmc files are ignored, so test that\n"; write_file_not_thing('krunch.pmc', '.pmc', $pmc_older); write_file('urkkk.pm', qq(print "ok $simple - urkkk.pm branch A\n")); diff --git a/t/run/switchM.t b/t/run/switchM.t index 603d5c5fa0..d2b1d2d6ce 100644 --- a/t/run/switchM.t +++ b/t/run/switchM.t @@ -24,7 +24,15 @@ like(runperl(switches => ['-Irun/flib/', '-Mbroken'], stderr => 1), "Ensure -Irun/flib/ produces correct filename in warnings"); SKIP: { - if ( $Config{ccflags} =~ /(?:^|\s)-DPERL_DISABLE_PMC\b/ ) { + my $no_pmc; + foreach(Config::non_bincompat_options()) { + if($_ eq "PERL_DISABLE_PMC"){ + $no_pmc = 1; + last; + } + } + + if ( $no_pmc ) { skip('Tests fail without PMC support', 2); } |