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