This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
INADDR_ANY INADDR_BROADCAST INADDR_LOOPBACK INADDR_NONE
[perl5.git] / t / lib / b-stash.t
CommitLineData
87a42246
MS
1#!./perl
2
3BEGIN {
4 if ($^O eq 'MacOS') {
5 @INC = qw(: ::lib ::macos:lib);
6 }
7}
8
9$| = 1;
10use warnings;
11use strict;
12use Config;
13
14print "1..1\n";
15
16my $test = 1;
17
18sub ok { print "ok $test\n"; $test++ }
19
20
21my $a;
22my $Is_VMS = $^O eq 'VMS';
23my $Is_MacOS = $^O eq 'MacOS';
24
25my $path = join " ", map { qq["-I$_"] } @INC;
26my $redir = $Is_MacOS ? "" : "2>&1";
27
28
29chomp($a = `$^X $path "-MB::Stash" "-Mwarnings" -e1`);
30$a = join ',', sort split /,/, $a;
31$a =~ s/-u(PerlIO|open)(?:::\w+)?,//g if defined $Config{'useperlio'} and $Config{'useperlio'} eq 'define';
32$a =~ s/-uWin32,// if $^O eq 'MSWin32';
33$a =~ s/-u(Cwd|File|File::Copy|OS2),//g if $^O eq 'os2';
34$a =~ s/-uCwd,// if $^O eq 'cygwin';
87a42246
MS
35 $b = '-uCarp,-uCarp::Heavy,-uDB,-uExporter,-uExporter::Heavy,-uattributes,'
36 . '-umain,-ustrict,-uutf8,-uwarnings';
38535c98
PP
37if ($Is_VMS) {
38 $a =~ s/-uFile,-uFile::Copy,//;
39 $a =~ s/-uVMS,-uVMS::Filespec,//;
40 $a =~ s/-uSocket,//; # Socket is optional/compiler version dependent
41}
371ddd85
JH
42
43{
44 no strict 'vars';
45 use vars '$OS2::is_aout';
46}
347fb945
IZ
47if (($Config{static_ext} eq ' ' ||
48 ($Config{static_ext} eq 'Socket' && $Is_VMS))
49 && !($^O eq 'os2' and $OS2::is_aout)
371ddd85
JH
50 ) {
51 if (ord('A') == 193) { # EBCDIC sort order is qw(a A) not qw(A a)
52 $b = join ',', sort split /,/, $b;
53 }
54 print "# [$a]\n# vs.\n# [$b]\nnot " if $a ne $b;
55 ok;
87a42246 56} else {
371ddd85 57 print "ok $test # skipped: one or more static extensions\n"; $test++;
87a42246 58}
371ddd85 59