xref: /onnv-gate/usr/src/cmd/perl/5.8.4/distrib/ext/B/t/showlex.t (revision 0:68f95e015346)
1*0Sstevel@tonic-gate#!./perl
2*0Sstevel@tonic-gate
3*0Sstevel@tonic-gateBEGIN {
4*0Sstevel@tonic-gate    chdir 't' if -d 't';
5*0Sstevel@tonic-gate    if ($^O eq 'MacOS') {
6*0Sstevel@tonic-gate	@INC = qw(: ::lib ::macos:lib);
7*0Sstevel@tonic-gate    } else {
8*0Sstevel@tonic-gate	@INC = '../lib';
9*0Sstevel@tonic-gate    }
10*0Sstevel@tonic-gate}
11*0Sstevel@tonic-gate
12*0Sstevel@tonic-gate$|  = 1;
13*0Sstevel@tonic-gateuse warnings;
14*0Sstevel@tonic-gateuse strict;
15*0Sstevel@tonic-gateuse Config;
16*0Sstevel@tonic-gate
17*0Sstevel@tonic-gateprint "1..1\n";
18*0Sstevel@tonic-gate
19*0Sstevel@tonic-gatemy $test = 1;
20*0Sstevel@tonic-gate
21*0Sstevel@tonic-gatesub ok { print "ok $test\n"; $test++ }
22*0Sstevel@tonic-gate
23*0Sstevel@tonic-gatemy $a;
24*0Sstevel@tonic-gatemy $Is_VMS = $^O eq 'VMS';
25*0Sstevel@tonic-gatemy $Is_MacOS = $^O eq 'MacOS';
26*0Sstevel@tonic-gate
27*0Sstevel@tonic-gatemy $path = join " ", map { qq["-I$_"] } @INC;
28*0Sstevel@tonic-gate$path = '"-I../lib" "-Iperl_root:[lib]"' if $Is_VMS;   # gets too long otherwise
29*0Sstevel@tonic-gatemy $redir = $Is_MacOS ? "" : "2>&1";
30*0Sstevel@tonic-gatemy $is_thread = $Config{use5005threads} && $Config{use5005threads} eq 'define';
31*0Sstevel@tonic-gate
32*0Sstevel@tonic-gateif ($is_thread) {
33*0Sstevel@tonic-gate    print "# use5005threads: test $test skipped\n";
34*0Sstevel@tonic-gate} else {
35*0Sstevel@tonic-gate    $a = `$^X $path "-MO=Showlex" -e "my \@one" $redir`;
36*0Sstevel@tonic-gate    print "# [$a]\nnot " unless $a =~ /sv_undef.*PVNV.*\@one.*sv_undef.*AV/s;
37*0Sstevel@tonic-gate}
38*0Sstevel@tonic-gateok;
39