Tests: Whitespace check all git files

This commit is contained in:
Wilson Snyder 2021-07-11 10:25:13 -04:00
parent a8168d5d62
commit f1bb0bb725
2 changed files with 6 additions and 9 deletions

View File

@ -108,4 +108,3 @@ Standard: Cpp11
TabWidth: 8 TabWidth: 8
UseTab: Never UseTab: Never
... ...

View File

@ -14,10 +14,11 @@ my $root = "..";
my $Debug; my $Debug;
### Must trim output before and after our file list ### Must trim output before and after our file list
my %files = %{get_manifest_files($root)}; my %files = %{get_source_files($root)};
foreach my $file (sort keys %files) { foreach my $file (sort keys %files) {
my $filename = "$root/$file"; my $filename = "$root/$file";
next if !-f $file; # git file might be deleted but not yet staged
my $contents = file_contents($filename); my $contents = file_contents($filename);
if ($file =~ /\.out$/) { if ($file =~ /\.out$/) {
# Ignore golden files # Ignore golden files
@ -79,15 +80,12 @@ if (keys %warns) {
ok(1); ok(1);
1; 1;
sub get_manifest_files { sub get_source_files {
my $root = shift; my $root = shift;
`cd $root && $ENV{MAKE} dist-file-list`; my $git_files = `cd $root && git ls-files`;
my $manifest_files = `cd $root && $ENV{MAKE} dist-file-list`; print "MF $git_files\n" if $Self->{verbose};
$manifest_files =~ s!.*begin-dist-file-list:!!sg;
$manifest_files =~ s!end-dist-file-list:.*$!!sg;
print "MF $manifest_files\n" if $Self->{verbose};
my %files; my %files;
foreach my $file (split /\s+/,$manifest_files) { foreach my $file (split /\s+/, $git_files) {
next if $file eq ''; next if $file eq '';
$files{$file} |= 1; $files{$file} |= 1;
} }