From f1bb0bb7251cf6f737ec7f5e4e5e0dfd976c0910 Mon Sep 17 00:00:00 2001 From: Wilson Snyder Date: Sun, 11 Jul 2021 10:25:13 -0400 Subject: [PATCH] Tests: Whitespace check all git files --- .clang-format | 1 - test_regress/t/t_dist_whitespace.pl | 14 ++++++-------- 2 files changed, 6 insertions(+), 9 deletions(-) diff --git a/.clang-format b/.clang-format index ad282b495..251eebe52 100644 --- a/.clang-format +++ b/.clang-format @@ -108,4 +108,3 @@ Standard: Cpp11 TabWidth: 8 UseTab: Never ... - diff --git a/test_regress/t/t_dist_whitespace.pl b/test_regress/t/t_dist_whitespace.pl index 4056e1053..bf7f6ca36 100755 --- a/test_regress/t/t_dist_whitespace.pl +++ b/test_regress/t/t_dist_whitespace.pl @@ -14,10 +14,11 @@ my $root = ".."; my $Debug; ### 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) { my $filename = "$root/$file"; + next if !-f $file; # git file might be deleted but not yet staged my $contents = file_contents($filename); if ($file =~ /\.out$/) { # Ignore golden files @@ -79,15 +80,12 @@ if (keys %warns) { ok(1); 1; -sub get_manifest_files { +sub get_source_files { my $root = shift; - `cd $root && $ENV{MAKE} dist-file-list`; - my $manifest_files = `cd $root && $ENV{MAKE} dist-file-list`; - $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 $git_files = `cd $root && git ls-files`; + print "MF $git_files\n" if $Self->{verbose}; my %files; - foreach my $file (split /\s+/,$manifest_files) { + foreach my $file (split /\s+/, $git_files) { next if $file eq ''; $files{$file} |= 1; }