Tests: Fix t_dist_whitespace.pl --golden, bug1451

Signed-off-by: Wilson Snyder <wsnyder@wsnyder.org>
This commit is contained in:
Todd Strader 2019-05-30 20:34:35 -04:00 committed by Wilson Snyder
parent a58e7d94ec
commit 97fef7c60b

View File

@ -28,8 +28,10 @@ foreach my $file (sort keys %files) {
|| $file =~ m!^README$!
|| $file =~ m!/gtkwave/!);
if ($ENV{HARNESS_UPDATE_GOLDEN}) {
$contents =~ s/[ \t]+\n/\n/g;
$contents =~ s/\n\n+$/\n/g unless $eol_ws_exempt;
my $changes = undef;
$changes = 1 if ($contents =~ s/[ \t]+\n/\n/g);
$changes = 1 if (!$eol_ws_exempt && $contents =~ s/\n\n+$/\n/g);
next if (!$changes);
$warns{$file} = "Updated whitespace at $file";
write_wholefile($filename, $contents);
next;