Keep It Simple and Stupid version of readonly hash support.
[p5sagit/p5-mst-13.2.git] / ext / B / t / stash.t
CommitLineData
87a42246 1#!./perl
2
3BEGIN {
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 }
10}
11
12$| = 1;
13use warnings;
14use strict;
15use Config;
16
17print "1..1\n";
18
19my $test = 1;
20
21sub ok { print "ok $test\n"; $test++ }
22
23
24my $a;
25my $Is_VMS = $^O eq 'VMS';
26my $Is_MacOS = $^O eq 'MacOS';
27
28my $path = join " ", map { qq["-I$_"] } @INC;
c614a829 29$path = '"-I../lib" "-Iperl_root:[lib]"' if $Is_VMS; # gets too long otherwise
87a42246 30my $redir = $Is_MacOS ? "" : "2>&1";
31
32
33chomp($a = `$^X $path "-MB::Stash" "-Mwarnings" -e1`);
34$a = join ',', sort split /,/, $a;
5456cc46 35$a =~ s/-u(PerlIO|open)(?:::\w+)?,//g;
87a42246 36$a =~ s/-uWin32,// if $^O eq 'MSWin32';
2986a63f 37$a =~ s/-uNetWare,// if $^O eq 'NetWare';
87a42246 38$a =~ s/-u(Cwd|File|File::Copy|OS2),//g if $^O eq 'os2';
39$a =~ s/-uCwd,// if $^O eq 'cygwin';
1b1f1335 40 $b = '-uCarp,-uCarp::Heavy,-uDB,-uExporter,-uExporter::Heavy,-uaccess,-uattributes,'
87a42246 41 . '-umain,-ustrict,-uutf8,-uwarnings';
38535c98 42if ($Is_VMS) {
43 $a =~ s/-uFile,-uFile::Copy,//;
44 $a =~ s/-uVMS,-uVMS::Filespec,//;
96e176bf 45 $a =~ s/-uvmsish,//;
38535c98 46 $a =~ s/-uSocket,//; # Socket is optional/compiler version dependent
47}
371ddd85 48
49{
50 no strict 'vars';
51 use vars '$OS2::is_aout';
52}
c614a829 53if ((($Config{static_ext} eq ' ') || ($Config{static_ext} eq ''))
347fb945 54 && !($^O eq 'os2' and $OS2::is_aout)
371ddd85 55 ) {
56 if (ord('A') == 193) { # EBCDIC sort order is qw(a A) not qw(A a)
57 $b = join ',', sort split /,/, $b;
58 }
59 print "# [$a]\n# vs.\n# [$b]\nnot " if $a ne $b;
60 ok;
87a42246 61} else {
371ddd85 62 print "ok $test # skipped: one or more static extensions\n"; $test++;
87a42246 63}
371ddd85 64