Commit | Line | Data |
87a42246 |
1 | #!./perl |
2 | |
3 | BEGIN { |
5638aaac |
4 | if ($ENV{PERL_CORE}){ |
5 | chdir('t') if -d 't'; |
6 | if ($^O eq 'MacOS') { |
7 | @INC = qw(: ::lib ::macos:lib); |
8 | } else { |
9 | @INC = '.'; |
10 | push @INC, '../lib'; |
11 | } |
88587957 |
12 | } else { |
5638aaac |
13 | unshift @INC, 't'; |
87a42246 |
14 | } |
9cd8f857 |
15 | require Config; |
16 | if (($Config::Config{'extensions'} !~ /\bB\b/) ){ |
17 | print "1..0 # Skip -- Perl configured without B module\n"; |
18 | exit 0; |
19 | } |
87a42246 |
20 | } |
21 | |
22 | $| = 1; |
23 | use warnings; |
24 | use strict; |
25 | use Config; |
26 | |
27 | print "1..1\n"; |
28 | |
29 | my $test = 1; |
30 | |
31 | sub ok { print "ok $test\n"; $test++ } |
32 | |
33 | |
9fc0d0ff |
34 | my $got; |
87a42246 |
35 | my $Is_VMS = $^O eq 'VMS'; |
36 | my $Is_MacOS = $^O eq 'MacOS'; |
37 | |
38 | my $path = join " ", map { qq["-I$_"] } @INC; |
c614a829 |
39 | $path = '"-I../lib" "-Iperl_root:[lib]"' if $Is_VMS; # gets too long otherwise |
87a42246 |
40 | my $redir = $Is_MacOS ? "" : "2>&1"; |
41 | |
9fc0d0ff |
42 | chomp($got = `$^X $path "-MB::Stash" "-Mwarnings" -e1`); |
43 | |
44 | $got =~ s/-u//g; |
45 | |
46 | print "# got = $got\n"; |
47 | |
48 | my @got = map { s/^\S+ //; $_ } |
49 | sort { $a cmp $b } |
50 | map { lc($_) . " " . $_ } |
51 | split /,/, $got; |
52 | |
53 | print "# (after sorting)\n"; |
54 | print "# got = @got\n"; |
55 | |
56 | @got = grep { ! /^(PerlIO|open)(?:::\w+)?$/ } @got; |
57 | |
58 | print "# (after perlio censorings)\n"; |
59 | print "# got = @got\n"; |
60 | |
61 | @got = grep { ! /^Win32$/ } @got if $^O eq 'MSWin32'; |
62 | @got = grep { ! /^NetWare$/ } @got if $^O eq 'NetWare'; |
63 | @got = grep { ! /^(Cwd|File|File::Copy|OS2)$/ } @got if $^O eq 'os2'; |
85ca3158 |
64 | @got = grep { ! /^(Cwd|Cygwin)$/ } @got if $^O eq 'cygwin'; |
87a42246 |
65 | |
38535c98 |
66 | if ($Is_VMS) { |
9fc0d0ff |
67 | @got = grep { ! /^File(?:::Copy)?$/ } @got; |
68 | @got = grep { ! /^VMS(?:::Filespec)?$/ } @got; |
69 | @got = grep { ! /^vmsish$/ } @got; |
70 | # Socket is optional/compiler version dependent |
71 | @got = grep { ! /^Socket$/ } @got; |
38535c98 |
72 | } |
371ddd85 |
73 | |
9fc0d0ff |
74 | print "# (after platform censorings)\n"; |
75 | print "# got = @got\n"; |
76 | |
77 | $got = "@got"; |
78 | |
09e96b99 |
79 | my $expected = "attributes Carp Carp::Heavy DB Internals main Regexp utf8 version warnings"; |
9fc0d0ff |
80 | |
4581844a |
81 | if ($] < 5.009) { |
82 | $expected =~ s/version //; |
83 | $expected =~ s/DB/DB Exporter Exporter::Heavy/; |
84 | } |
7252851f |
85 | |
371ddd85 |
86 | { |
87 | no strict 'vars'; |
88 | use vars '$OS2::is_aout'; |
89 | } |
9fc0d0ff |
90 | |
c614a829 |
91 | if ((($Config{static_ext} eq ' ') || ($Config{static_ext} eq '')) |
347fb945 |
92 | && !($^O eq 'os2' and $OS2::is_aout) |
371ddd85 |
93 | ) { |
09e96b99 |
94 | print "# got [$got]\n# vs.\n# expected [$expected]\nnot " if $got ne $expected; |
371ddd85 |
95 | ok; |
87a42246 |
96 | } else { |
371ddd85 |
97 | print "ok $test # skipped: one or more static extensions\n"; $test++; |
87a42246 |
98 | } |
371ddd85 |
99 | |