summaryrefslogtreecommitdiffstats
path: root/t/001compile.t
diff options
context:
space:
mode:
authorjake%acutex.net <>2001-10-20 07:39:46 +0200
committerjake%acutex.net <>2001-10-20 07:39:46 +0200
commited4af4249961a69449820e27b0baaf5116142b9e (patch)
tree09425865e2c77171faec1a1a66d2210b7dc6fdf7 /t/001compile.t
parentb929c22527a9f97d4e03937d255542dfb5384f02 (diff)
downloadbugzilla-ed4af4249961a69449820e27b0baaf5116142b9e.tar.gz
bugzilla-ed4af4249961a69449820e27b0baaf5116142b9e.tar.xz
Bug 103664 - Tests should "use strict;" and not contain any tabs. We should also use the TEST_VERBOSE environment variable instead of VERBOSE.
Patch by David D. Kilzer <ddkilzer@theracingworld.com> Additional edits by myself to add the emacs mode line. Also, the change to runtests.sh was done by me.
Diffstat (limited to 't/001compile.t')
-rw-r--r--t/001compile.t37
1 files changed, 18 insertions, 19 deletions
diff --git a/t/001compile.t b/t/001compile.t
index edaa9cacd..78c1ab477 100644
--- a/t/001compile.t
+++ b/t/001compile.t
@@ -1,4 +1,5 @@
-#
+# -*- Mode: perl; indent-tabs-mode: nil -*-
+#
# The contents of this file are subject to the Mozilla Public
# License Version 1.1 (the "License"); you may not use this file
# except in compliance with the License. You may obtain a copy of
@@ -40,17 +41,15 @@ BEGIN { use Support::Files; }
BEGIN { $tests = @Support::Files::testitems + 4; }
BEGIN { use Test::More tests => $tests; }
-sub foo {
-$warnings = "foo"; #oy!
-}
+use strict;
# First now we test the scripts
-@testitems = @Support::Files::testitems;
+my @testitems = @Support::Files::testitems;
+my %warnings;
+my $verbose = $::ENV{TEST_VERBOSE};
+my $perlapp = $^X;
-my $warnings;
-my $verbose = $::ENV{VERBOSE};
-$perlapp=$^X;
-foreach $file (@testitems) {
+foreach my $file (@testitems) {
$file =~ s/\s.*$//; # nuke everything after the first space (#comment)
next if (!$file); # skip null entries
open (FILE,$file);
@@ -60,20 +59,20 @@ foreach $file (@testitems) {
if ($bang =~ m/#!\S*perl\s+-.*T/) {
$T = "T";
}
- $command = "$perlapp"." -c$T $file 2>&1";
- $loginfo=`$command`;
-# print '@@'.$loginfo.'##';
- if ($loginfo =~ /syntax ok$/im) {
- $warnings{$_} = 1 foreach ($loginfo =~ /\((W.*?)\)/mg);
- if ($1) {
+ my $command = "$perlapp"." -c$T $file 2>&1";
+ my $loginfo=`$command`;
+ #print '@@'.$loginfo.'##';
+ if ($loginfo =~ /syntax ok$/im) {
+ $warnings{$_} = 1 foreach ($loginfo =~ /\((W.*?)\)/mg);
+ if ($1) {
if ($verbose) { print STDERR $loginfo; }
ok(0,$file."--WARNING");
} else {
- ok(1,$file);
- }
- } else {
+ ok(1,$file);
+ }
+ } else {
if ($verbose) { print STDERR $loginfo; }
- ok(0,$file."--ERROR");
+ ok(0,$file."--ERROR");
}
}