From: wurblzap%gmail.com <> Date: Sun, 1 Mar 2009 10:31:14 +0000 (+0000) Subject: Bug 295205 - runtests.pl should check that the line endings of files conform to... X-Git-Tag: bugzilla-3.3.4~19 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e43d323b6348537adf58d8f1b8b5d1193220f7ac;p=thirdparty%2Fbugzilla.git Bug 295205 - runtests.pl should check that the line endings of files conform to your OS standard. Patch by Marc Schumann . r=LpSolit,mkanat; a=mkanat. --- diff --git a/t/005whitespace.t b/t/005whitespace.t index 75f5329562..e6bd07f4ec 100644 --- a/t/005whitespace.t +++ b/t/005whitespace.t @@ -19,6 +19,8 @@ # # Contributor(s): Jacob Steenhagen # David D. Kilzer +# Colin Ogilvie +# Marc Schumann # ################# @@ -34,7 +36,7 @@ use Support::Templates; use File::Spec; use Test::More tests => ( scalar(@Support::Files::testitems) - + $Support::Templates::num_actual_files); + + $Support::Templates::num_actual_files) * 2; my @testitems = @Support::Files::testitems; for my $path (@Support::Templates::include_paths) { @@ -42,9 +44,12 @@ for my $path (@Support::Templates::include_paths) { Support::Templates::find_actual_files($path))); } +my %results; + foreach my $file (@testitems) { open (FILE, "$file"); - if (grep /\t/, ) { + my @contents = ; + if (grep /\t/, @contents) { ok(0, "$file contains tabs --WARNING"); } else { ok(1, "$file has no tabs"); @@ -52,4 +57,15 @@ foreach my $file (@testitems) { close (FILE); } +foreach my $file (@testitems) { + open (FILE, "$file"); + my @contents = ; + if (grep /\r/, @contents) { + ok(0, "$file contains non-OS-conformant line endings --WARNING"); + } else { + ok(1, "All line endings of $file are OS conformant"); + } + close (FILE); +} + exit 0;