From 00a0bd35b266e67fba17d6672cc0968cd5d4a63a Mon Sep 17 00:00:00 2001 From: "jake%acutex.net" Date: Fri, 4 Jan 2002 16:04:09 +0000 Subject: [PATCH] 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. git-svn-id: svn://10.0.0.236/trunk@111359 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/webtools/bugzilla/t/002goodperl.t | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/mozilla/webtools/bugzilla/t/002goodperl.t b/mozilla/webtools/bugzilla/t/002goodperl.t index 9047e09ff59..e9ade39001c 100644 --- a/mozilla/webtools/bugzilla/t/002goodperl.t +++ b/mozilla/webtools/bugzilla/t/002goodperl.t @@ -18,6 +18,7 @@ # Rights Reserved. # # Contributor(s): Zach Lipton +# Jacob Steenhagen # # Alternatively, the contents of this file may be used under 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. foreach my $file (@testitems) { $file =~ s/\s.*$//; # nuke everything after the first space (#comment) next if (!$file); # skip null entries - my $filecontent = `cat $file`; - if ($filecontent !~ /\/usr\/bonsaitools\/bin\/perl/) { + open (FILE, $file); + my @file = ; + close (FILE); + if ($file[0] !~ /\/usr\/bonsaitools\/bin\/perl/) { ok(1,"$file does not have a shebang"); next; } else { - if ($filecontent =~ m#/usr/bonsaitools/bin/perl -w#) { + if ($file[0] =~ m#/usr/bonsaitools/bin/perl -w#) { ok(1,"$file uses -w"); next; } else { - ok(0,"$file is MISSING -w"); + ok(0,"$file is MISSING -w --WARNING"); next; } } @@ -65,11 +68,13 @@ foreach my $file (@testitems) { foreach my $file (@testitems) { $file =~ s/\s.*$//; # nuke everything after the first space (#comment) next if (!$file); # skip null entries - my $filecontent = `cat $file`; - if ($filecontent !~ /use strict/) { - ok(0,"$file DOES NOT use strict"); - } else { + open (FILE, $file); + my @file = ; + close (FILE); + if (grep /^\s*use strict/, @file) { ok(1,"$file uses strict"); + } else { + ok(0,"$file DOES NOT use strict --WARNING"); } }