diff options
author | jake%acutex.net <> | 2001-10-25 01:41:49 +0000 |
---|---|---|
committer | jake%acutex.net <> | 2001-10-25 01:41:49 +0000 |
commit | 3d46ba59b73c584ab534896c2ae61398ef3940d9 (patch) | |
tree | 1a7bb625032e6d1919a5d2728d2068da250bed99 /t | |
parent | Bug 106424 - We weren't going orange on warnings such as "used only once". T... (diff) | |
download | bugzilla-3d46ba59b73c584ab534896c2ae61398ef3940d9.tar.gz bugzilla-3d46ba59b73c584ab534896c2ae61398ef3940d9.tar.bz2 bugzilla-3d46ba59b73c584ab534896c2ae61398ef3940d9.zip |
Don't rely on the TEST_VERBOSE environment variable (no longer exported from runtests.sh) and instead print to the TESTOUT file handle pulled in from Test::More. This will allow the testing backend to check for verbosity rather than having to handle it in the .t files.
Diffstat (limited to 't')
-rw-r--r-- | t/001compile.t | 10 | ||||
-rw-r--r-- | t/002goodperl.t | 1 | ||||
-rw-r--r-- | t/003safesys.t | 6 | ||||
-rw-r--r-- | t/004template.t | 1 | ||||
-rw-r--r-- | t/005no_tabs.t | 1 |
5 files changed, 9 insertions, 10 deletions
diff --git a/t/001compile.t b/t/001compile.t index c297241df..4fc568662 100644 --- a/t/001compile.t +++ b/t/001compile.t @@ -45,8 +45,9 @@ use strict; # First now we test the scripts my @testitems = @Support::Files::testitems; -#my %warnings; -my $verbose = $::ENV{TEST_VERBOSE}; +# Capture the TESTERR from Test::More for printing errors. +# This will handle verbosity for us automatically +*TESTOUT = \*Test::More::TESTOUT; my $perlapp = $^X; foreach my $file (@testitems) { @@ -63,15 +64,14 @@ foreach my $file (@testitems) { my $loginfo=`$command`; #print '@@'.$loginfo.'##'; if ($loginfo =~ /syntax ok$/im) { -# $warnings{$_} = 1 foreach ($loginfo =~ /\((W.*?)\)/mg); if ($loginfo ne "$file syntax OK\n") { - if ($verbose) { print STDERR $loginfo; } + print TESTOUT $loginfo; ok(0,$file."--WARNING"); } else { ok(1,$file); } } else { - if ($verbose) { print STDERR $loginfo; } + print TESTOUT $loginfo; ok(0,$file."--ERROR"); } } diff --git a/t/002goodperl.t b/t/002goodperl.t index 3615d489a..9047e09ff 100644 --- a/t/002goodperl.t +++ b/t/002goodperl.t @@ -44,7 +44,6 @@ BEGIN { use Test::More tests => $tests; } use strict; my @testitems = @Support::Files::testitems; # get the files to test. -my $verbose = $::ENV{TEST_VERBOSE}; foreach my $file (@testitems) { $file =~ s/\s.*$//; # nuke everything after the first space (#comment) diff --git a/t/003safesys.t b/t/003safesys.t index 94d137aa9..98e9d2d64 100644 --- a/t/003safesys.t +++ b/t/003safesys.t @@ -44,7 +44,9 @@ BEGIN { use Test::More tests => $tests; } use strict; my @testitems = @Support::Files::testitems; -my $verbose = $::ENV{TEST_VERBOSE}; +# Capture the TESTERR from Test::More for printing errors. +# This will handle verbosity for us automatically +*TESTOUT = \*Test::More::TESTOUT; my $perlapp = $^X; foreach my $file (@testitems) { @@ -54,7 +56,7 @@ foreach my $file (@testitems) { my $loginfo=`$command`; if ($loginfo =~ /arguments for Support::Systemexec::(system|exec)/im) { ok(0,"$file DOES NOT use proper system or exec calls"); - if ($verbose) { print STDERR $loginfo; } + print TESTOUT $loginfo; } else { ok(1,"$file uses proper system and exec calls"); } diff --git a/t/004template.t b/t/004template.t index f66176a72..92d9c511c 100644 --- a/t/004template.t +++ b/t/004template.t @@ -34,7 +34,6 @@ use Template; my @testitems = @Support::Templates::testitems; my $include_path = $Support::Templates::include_path; -my $verbose = $::ENV{TEST_VERBOSE}; # Check to make sure all templates that are referenced in # Bugzilla exist in the proper place. diff --git a/t/005no_tabs.t b/t/005no_tabs.t index 66b2af5d6..e420baaaa 100644 --- a/t/005no_tabs.t +++ b/t/005no_tabs.t @@ -32,7 +32,6 @@ BEGIN { use Test::More tests => $tests; } use strict; my @testitems = @Support::Files::testitems; -my $verbose = $::ENV{TEST_VERBOSE}; foreach my $file (@testitems) { open (FILE, "$file"); |