#!/bin/sh
-export TEST_VERBOSE=0
+TEST_VERBOSE=0
PART1='use Test::Harness qw(&runtests $verbose); $verbose='
PART2='; runtests @ARGV;'
for f in $*; do
if [ $f == "--verbose" ] ; then
- export TEST_VERBOSE=1
+ TEST_VERBOSE=1
fi
done
# 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) {
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");
}
}
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)
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) {
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");
}
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.
use strict;
my @testitems = @Support::Files::testitems;
-my $verbose = $::ENV{TEST_VERBOSE};
foreach my $file (@testitems) {
open (FILE, "$file");