diff options
Diffstat (limited to 't/porting/regen.t')
-rw-r--r-- | t/porting/regen.t | 32 |
1 files changed, 31 insertions, 1 deletions
diff --git a/t/porting/regen.t b/t/porting/regen.t index 810aa3547f..edae912a75 100644 --- a/t/porting/regen.t +++ b/t/porting/regen.t @@ -18,6 +18,36 @@ $ENV{PERL5LIB} = rel2abs($lib); chdir '..' if $in_t; -print "1..18\n"; # I can't see a clean way to calculate this automatically. +$INC[0] = 'lib'; +require 'regen/regen_lib.pl'; +require 't/test.pl'; +$::NO_ENDING = $::NO_ENDING = 1; + +my $in_regen_pl = 18; # I can't see a clean way to calculate this automatically. +my @files = qw(perly.act perly.h perly.tab); + +plan (tests => $in_regen_pl + @files); + +OUTER: foreach my $file (@files) { + open my $fh, '<', $file or die "Can't open $file: $!"; + 1 while defined($_ = <$fh>) and !/Generated from:/; + if (eof $fh) { + fail("Can't find 'Generated from' line in $file"); + next; + } + my @bad; + while (<$fh>) { + last if /ex: set ro:/; + unless (/^(?: \* | #)([0-9a-f]+) (\S+)$/) { + chomp $_; + fail("Bad line in $file: '$_'"); + next OUTER; + } + my $digest = digest($2); + note("$digest $2"); + push @bad, $2 unless $digest eq $1; + } + is("@bad", '', "generated $file is up to date"); +} system "$^X regen.pl --tap"; |