Commit de2a3a6b authored by jake%acutex.net's avatar jake%acutex.net

Bug 112914 - This test was relying on the existance of the unix "cat" command…

Bug 112914 - This test was relying on the existance of the unix "cat" command instead of using perl's standard open() function. This caused a test failed when running the tinderbox script on win32.
parent 668ec7da
...@@ -18,6 +18,7 @@ ...@@ -18,6 +18,7 @@
# Rights Reserved. # Rights Reserved.
# #
# Contributor(s): Zach Lipton <zach@zachlipton.com> # Contributor(s): Zach Lipton <zach@zachlipton.com>
# Jacob Steenhagen <jake@acutex.net>
# #
# Alternatively, the contents of this file may be used under the # Alternatively, the contents of this file may be used under the
# terms of the GNU General Public License Version 2 or later (the # terms of the GNU General Public License Version 2 or later (the
...@@ -48,16 +49,18 @@ my @testitems = @Support::Files::testitems; # get the files to test. ...@@ -48,16 +49,18 @@ my @testitems = @Support::Files::testitems; # get the files to test.
foreach my $file (@testitems) { foreach my $file (@testitems) {
$file =~ s/\s.*$//; # nuke everything after the first space (#comment) $file =~ s/\s.*$//; # nuke everything after the first space (#comment)
next if (!$file); # skip null entries next if (!$file); # skip null entries
my $filecontent = `cat $file`; open (FILE, $file);
if ($filecontent !~ /\/usr\/bonsaitools\/bin\/perl/) { my @file = <FILE>;
close (FILE);
if ($file[0] !~ /\/usr\/bonsaitools\/bin\/perl/) {
ok(1,"$file does not have a shebang"); ok(1,"$file does not have a shebang");
next; next;
} else { } else {
if ($filecontent =~ m#/usr/bonsaitools/bin/perl -w#) { if ($file[0] =~ m#/usr/bonsaitools/bin/perl -w#) {
ok(1,"$file uses -w"); ok(1,"$file uses -w");
next; next;
} else { } else {
ok(0,"$file is MISSING -w"); ok(0,"$file is MISSING -w --WARNING");
next; next;
} }
} }
...@@ -65,11 +68,13 @@ foreach my $file (@testitems) { ...@@ -65,11 +68,13 @@ foreach my $file (@testitems) {
foreach my $file (@testitems) { foreach my $file (@testitems) {
$file =~ s/\s.*$//; # nuke everything after the first space (#comment) $file =~ s/\s.*$//; # nuke everything after the first space (#comment)
next if (!$file); # skip null entries next if (!$file); # skip null entries
my $filecontent = `cat $file`; open (FILE, $file);
if ($filecontent !~ /use strict/) { my @file = <FILE>;
ok(0,"$file DOES NOT use strict"); close (FILE);
} else { if (grep /^\s*use strict/, @file) {
ok(1,"$file uses strict"); ok(1,"$file uses strict");
} else {
ok(0,"$file DOES NOT use strict --WARNING");
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment