6 $ENV{PERL5LIB} = '../lib';
11 my $Is_VMS = $^O eq 'VMS';
12 my $tmpfile = "tmp0000";
14 1 while -f ++$tmpfile;
15 END { if ($tmpfile) { 1 while unlink $tmpfile; } }
19 foreach (sort glob("pragma/strict-*")) {
21 next if /(~|\.orig)$/;
23 open F, "<$_" or die "Cannot open $_: $!\n" ;
30 @prgs = (@prgs, split "\n########\n", <F>) ;
37 print "1..", scalar @prgs, "\n";
46 my($prog,$expected) = split(/\nEXPECT\n/, $_);
47 if ( $prog =~ /--FILE--/) {
48 my(@files) = split(/\n--FILE--\s*([^\s\n]*)\s*\n/, $prog) ;
50 die "Internal error test $i didn't split into pairs, got " .
51 scalar(@files) . "[" . join("%%%%", @files) ."]\n"
54 my $filename = shift @files ;
55 my $code = shift @files ;
56 push @temps, $filename ;
57 open F, ">$filename" or die "Cannot open $filename: $!\n" ;
62 $prog = shift @files ;
64 open TEST, ">$tmpfile";
65 print TEST $prog,"\n";
67 my $results = $Is_VMS ?
68 `MCR $^X $switch $tmpfile` :
69 `sh -c './perl $switch $tmpfile' 2>&1`;
72 # allow expected output to be written as if $prog is on STDIN
73 $results =~ s/tmp\d+/-/g;
74 $results =~ s/\n%[A-Z]+-[SIWEF]-.*$// if $Is_VMS; # clip off DCL status msg
75 $expected =~ s/\n+$//;
76 my $prefix = ($results =~ s/^PREFIX\n//) ;
77 if ( $results =~ s/^SKIPPED\n//) {
80 elsif (($prefix and $results !~ /^\Q$expected/) or
81 (!$prefix and $results ne $expected)){
82 print STDERR "PROG: $switch\n$prog\n";
83 print STDERR "EXPECTED:\n$expected\n";
84 print STDERR "GOT:\n$results\n";
87 print "ok ", ++$i, "\n";