2 # Copyright (C) 2010, Parrot Foundation.
7 use lib qw( . lib ../lib ../../lib );
14 t/distro/manifest_generated.t - check sanity of MANIFEST.generated file
18 % prove t/distro/manifest_generated.t
22 Checks that MANIFEST.generated is in the required format (eg: sorted) and that it
23 contains appropriate items (eg: PMC generated files).
27 ok( -e 'MANIFEST.generated', 'MANIFEST.generated exists' );
29 # slurp MANIFEST.generated, ignoring comment lines
30 open my $fh, '<', 'MANIFEST.generated'
31 or die "open MANIFEST.generated: $!";
32 my @contents = grep {!/^#/} map {chomp; $_} <$fh>;
35 is_deeply([sort @contents], \@contents, 'MANIFEST.generated is sorted');
40 my $match = m/^ (\S+) \s+ (\[ \w* \] \w*) $/x;
41 push @records, [$1, $2] if $match;
42 not $match } @contents],
44 'MANIFEST.generated contains no irregular records' );
46 # check for appropriate contents
47 my %contained_files = map {$$_[0] => 1} @records;
49 [grep {not exists $contained_files{$_}} glob('include/pmc/*.h')],
50 'MANIFEST.generated lists all core PMC headers' );
53 [grep {not exists $contained_files{$_}} glob('src/pmc/*.dump')],
54 'MANIFEST.generated lists all core PMC dump files' )
58 # cperl-indent-level: 4
61 # vim: expandtab shiftwidth=4: