2008-05-08 14:38:07 +00:00
|
|
|
#!/usr/bin/perl
|
2008-09-23 14:02:31 +00:00
|
|
|
if (!$::Driver) { use FindBin; exec("$FindBin::Bin/bootstrap.pl", @ARGV, $0); die; }
|
2008-05-08 14:38:07 +00:00
|
|
|
# DESCRIPTION: Verilator: Verilog Test driver/expect definition
|
|
|
|
#
|
|
|
|
# Copyright 2003 by Wilson Snyder. This program is free software; you can
|
|
|
|
# redistribute it and/or modify it under the terms of either the GNU
|
2009-05-04 21:07:57 +00:00
|
|
|
# Lesser General Public License Version 3 or the Perl Artistic License
|
|
|
|
# Version 2.0.
|
2008-05-08 14:38:07 +00:00
|
|
|
|
2018-05-08 00:42:28 +00:00
|
|
|
scenarios(dist => 1);
|
|
|
|
|
2008-05-08 14:38:07 +00:00
|
|
|
my $root = "..";
|
|
|
|
my $Debug;
|
|
|
|
|
2008-05-08 15:18:42 +00:00
|
|
|
### Must trim output before and after our file list
|
2017-09-11 23:18:58 +00:00
|
|
|
my %files = %{get_manifest_files($root)};
|
2008-05-08 14:38:07 +00:00
|
|
|
|
|
|
|
my $all_files = `cd $root && find . -type f -print`;
|
|
|
|
foreach my $file (split /\s+/,$all_files) {
|
|
|
|
next if $file eq '';
|
|
|
|
$file =~ s!^\./!!;
|
|
|
|
$files{$file} |= 2;
|
|
|
|
}
|
|
|
|
|
2009-11-15 14:15:33 +00:00
|
|
|
my %file_regexps;
|
2008-05-08 14:38:07 +00:00
|
|
|
my $skip = file_contents("$root/MANIFEST.SKIP");
|
|
|
|
foreach my $file (sort keys %files) {
|
|
|
|
foreach my $skip (split /\s+/,$skip) {
|
2018-05-07 02:39:18 +00:00
|
|
|
if ($file =~ /$skip/) {
|
|
|
|
$files{$file} |= 4;
|
|
|
|
$file_regexps{$file} = $skip;
|
|
|
|
}
|
2008-05-08 14:38:07 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2009-11-06 22:52:54 +00:00
|
|
|
my %warns;
|
2008-05-08 14:38:07 +00:00
|
|
|
foreach my $file (sort keys %files) {
|
|
|
|
my $tar = $files{$file}&1;
|
|
|
|
my $dir = $files{$file}&2;
|
|
|
|
my $skip = $files{$file}&4;
|
|
|
|
|
|
|
|
print +(($tar ? "TAR ":" ")
|
2018-05-07 02:39:18 +00:00
|
|
|
.($dir ? "DIR ":" ")
|
|
|
|
.($skip ? "SKIP ":" ")
|
|
|
|
." $file\n") if $Debug;
|
2008-05-08 14:38:07 +00:00
|
|
|
|
|
|
|
if ($dir && !$tar && !$skip) {
|
2018-05-07 02:39:18 +00:00
|
|
|
$warns{$file} = "File not in manifest or MANIFEST.SKIP: $file";
|
2008-05-08 14:38:07 +00:00
|
|
|
} elsif (!$dir && $tar && !$skip) {
|
2018-05-07 02:39:18 +00:00
|
|
|
$warns{$file} = "File in manifest, but not directory: $file";
|
2009-11-15 14:15:33 +00:00
|
|
|
} elsif ($dir && $tar && $skip) {
|
2018-05-07 02:39:18 +00:00
|
|
|
$warns{$file} = "File in manifest and also MANIFEST.SKIP, too general skip regexp '$file_regexps{$file}'?: $file";
|
2009-11-06 22:52:54 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (keys %warns) {
|
|
|
|
# First warning lists everything as that's shown in the driver summary
|
2018-05-08 00:42:28 +00:00
|
|
|
error("Files mismatch with manifest: ",join(' ',sort keys %warns));
|
2009-11-06 22:52:54 +00:00
|
|
|
foreach my $file (sort keys %warns) {
|
2018-05-08 00:42:28 +00:00
|
|
|
error($warns{$file});
|
2008-05-08 14:38:07 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
ok(1);
|
|
|
|
1;
|
2017-09-11 23:18:58 +00:00
|
|
|
|
|
|
|
sub get_manifest_files {
|
|
|
|
my $root = shift;
|
|
|
|
`cd $root && make dist-file-list`;
|
|
|
|
my $manifest_files = `cd $root && make dist-file-list`;
|
|
|
|
$manifest_files =~ s!.*begin-dist-file-list:!!sg;
|
|
|
|
$manifest_files =~ s!end-dist-file-list:.*$!!sg;
|
2017-09-19 01:36:18 +00:00
|
|
|
print "MF $manifest_files\n" if $Self->{verbose};
|
2017-09-11 23:18:58 +00:00
|
|
|
my %files;
|
|
|
|
foreach my $file (split /\s+/,$manifest_files) {
|
2018-05-07 02:39:18 +00:00
|
|
|
next if $file eq '';
|
|
|
|
$files{$file} |= 1;
|
2017-09-11 23:18:58 +00:00
|
|
|
}
|
|
|
|
return \%files;
|
|
|
|
}
|