blob: db84b2f28b9dd440c1b69bac4eea08cf55cba084 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
|
#!/usr/bin/perl -w
BEGIN {
if( $ENV{PERL_CORE} ) {
chdir 't' if -d 't';
chdir '../lib/parent';
@INC = '..';
}
}
use strict;
use Test::More;
use Config;
use lib 't/lib';
plan skip_all => ".pmc are only available with 5.6 and later" if $] < 5.006;
# Skip this test if perl is compiled with PERL_DISABLE_PMC
#
my $pmc = 1;
if (Config->can('non_bincompat_options')) { # $] ge '5.014'
$pmc = 0
if grep { $_ eq 'PERL_DISABLE_PMC' } Config::non_bincompat_options();
} elsif (eval {
require Config::Perl::V;
Config::Perl::V->VERSION('0.10');
}) {
$pmc = 0
if Config::Perl::V::myconfig()->{options}{PERL_DISABLE_PMC};
} else {
$pmc = 0
if $Config::Config{ccflags} =~ /(?:^|\s)-DPERL_DISABLE_PMC\b/;
}
plan skip_all => 'Perl is built with PERL_DISABLE_PMC' unless $pmc;
plan tests => 3;
our $got_here;
my $res = eval q{
package MyTest;
use parent 'FileThatOnlyExistsAsPMC';
1
};
my $error = $@;
is $res, 1, "Block ran until the end";
is $error, '', "No error";
my $obj = bless {}, 'FileThatOnlyExistsAsPMC';
can_ok $obj, 'exclaim';
|