This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
newPADOP()'s sv parameter is never NULL, so mark it as so.
[perl5.git] / mad / p55
CommitLineData
6a28abbc
NC
1#!/usr/bin/perl
2
3while (@ARGV and $ARGV[0] =~ /^-/) {
4 my $switch = shift;
5 if ($switch eq '-Y') {
6 $YAML = '-Y ';
7 }
8 else {
9 die "Unrecognized switch: -$switch";
10 }
11}
12
13my $file = shift;
14my $infile = $file;
15
16unlink "$file.msg";
17my $top = "/home/larry/src/p55";
18
19my $text;
20open(FILE, $file) or die "Can't open $file: $!\n";
21{
22 local $/;
23 $text = <FILE>;
24}
25close FILE;
26my $T;
27$switches = $1 if $text =~ /^#!.*?\s(-.*)/;
28$switches =~ s/\s+-[-*].*//;
29$switches =~ s/\s+#.*//;
30
31#if ($text =~ s/\bexit\b/DUMMYEXIT/g) {
32# $infile = "$file.tmp";
33# open FILE, ">$infile";
34# print FILE $text;
35# close FILE;
36#}
37
38unlink "$file.xml", "$file.msg", "$file.err", "$file.diff", "$file.p5";
39print "PERL_XMLDUMP='$file.xml' $top/perl $switches -I lib $infile 2>$file.err\n";
40system "PERL_XMLDUMP='$file.xml' $top/perl $switches -I lib $infile 2>$file.err";
41
42if ($?) {
43 print "Exit status $?\n";
44 system "cat $file.err";
45 exit 1;
46}
47
48if (not -s "$file.xml") {
49 die "Didn't produce an xml file!?!\n"
50}
51
52if ($YAML) {
53 system "$top/nomad -Y $file.xml";
54 exit;
55}
56
57system "$top/nomad $file.xml >$file.p5 2>$file.msg";
58
59if ($?) {
60 print "Oops!\n" unless -s "$file.msg";
61 system "cat $file.msg";
62 exit 1;
63}
64
65system "diff -u $file $file.p5 >$file.diff";
66if (-s "$file.diff") {
67 system "cat $file.diff";
68 exit 1;
69}