blob: 194f80e072c93591a18919f863b2914b847f4a7b (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
|
#!./perl -w
# Verify that all files generated by perl scripts are up to date.
BEGIN {
@INC = '..' if -f '../TestInit.pm';
}
use TestInit qw(T A); # T is chdir to the top level, A makes paths absolute
use strict;
require 'regen/regen_lib.pl';
require 't/test.pl';
$::NO_ENDING = $::NO_ENDING = 1;
if ( $^O eq "VMS" ) {
skip_all( "- regen.pl needs porting." );
}
my $in_regen_pl = 24; # I can't see a clean way to calculate this automatically.
my @files = qw(perly.act perly.h perly.tab keywords.c keywords.h uconfig.h);
my @progs = qw(regen/regcharclass.pl regen/mk_PL_charclass.pl
regen/unicode_constants.pl regen/genpacksizetables.pl);
plan (tests => $in_regen_pl + @files + @progs + 2);
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");
}
foreach (@progs, 'regen.pl') {
system "$^X $_ --tap";
}
foreach ( '-y', '-j' ) {
system "$^X Porting/makemeta --tap $_";
}
|