3 # Verify that all files generated by perl scripts are up to date.
6 @INC = '..' if -f '../TestInit.pm';
8 use TestInit qw(T A); # T is chdir to the top level, A makes paths absolute
11 require 'regen/regen_lib.pl';
13 $::NO_ENDING = $::NO_ENDING = 1;
16 skip_all( "- regen.pl needs porting." );
19 my $in_regen_pl = 19; # I can't see a clean way to calculate this automatically.
20 my @files = qw(perly.act perly.h perly.tab keywords.c keywords.h uconfig.h);
21 my @progs = qw(Porting/makemeta regen/regcharclass.pl regen/mk_PL_charclass.pl);
23 plan (tests => $in_regen_pl + @files + @progs);
25 OUTER: foreach my $file (@files) {
26 open my $fh, '<', $file or die "Can't open $file: $!";
27 1 while defined($_ = <$fh>) and !/Generated from:/;
29 fail("Can't find 'Generated from' line in $file");
34 last if /ex: set ro:/;
35 unless (/^(?: \* | #)([0-9a-f]+) (\S+)$/) {
37 fail("Bad line in $file: '$_'");
40 my $digest = digest($2);
42 push @bad, $2 unless $digest eq $1;
44 is("@bad", '', "generated $file is up to date");
47 foreach (@progs, 'regen.pl') {
48 system "$^X $_ --tap";