From ed4af4249961a69449820e27b0baaf5116142b9e Mon Sep 17 00:00:00 2001 From: "jake%acutex.net" <> Date: Sat, 20 Oct 2001 05:39:46 +0000 Subject: 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 Additional edits by myself to add the emacs mode line. Also, the change to runtests.sh was done by me. --- t/001compile.t | 37 ++++++++++++++++++------------------- 1 file changed, 18 insertions(+), 19 deletions(-) (limited to 't/001compile.t') 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"); } } -- cgit v1.2.3-24-g4f1b