]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
Added a --verbose option to runtests.sh that the tinderbox scripts can use to get...
authorjustdave%syndicomm.com <>
Sat, 1 Sep 2001 10:06:13 +0000 (10:06 +0000)
committerjustdave%syndicomm.com <>
Sat, 1 Sep 2001 10:06:13 +0000 (10:06 +0000)
runtests.sh
t/1.t

index d220f7c20471e53f5c2a1084699ac5dd205f4718..c558fcf7dc29058b5045ae7fd5c6319392cb2921 100755 (executable)
@@ -1,3 +1,12 @@
 #!/bin/sh
 
-/usr/bonsaitools/bin/perl -e 'use Test::Harness qw(&runtests $verbose); $verbose=0; runtests @ARGV;' t/*.t
+export VERBOSE=0
+PART1='use Test::Harness qw(&runtests $verbose); $verbose='
+PART2='; runtests @ARGV;'
+for f in $*; do
+  if [ $f == "--verbose" ] ; then
+    export VERBOSE=1
+  fi
+done
+
+/usr/bonsaitools/bin/perl -e "${PART1}${VERBOSE}${PART2}" t/*.t
diff --git a/t/1.t b/t/1.t
index c748a56e41e3fd8ebfb57a03d93fccf3de923523..39cdc9a15d11771369fc2a1674ca5778292c837f 100644 (file)
--- a/t/1.t
+++ b/t/1.t
@@ -48,7 +48,7 @@ BEGIN { use_ok('RelationSet'); }
 BEGIN { use_ok('Bug'); }
 
 # and now we test the scripts
-@testitems = qw(
+@testitems = split("\n",qq(
 bug_form.pl #4
 buglist.cgi #5
 changepassword.cgi #6
@@ -97,20 +97,26 @@ token.cgi #48
 userprefs.cgi #49
 whineatnews.pl #50
 xml.cgi #51
-);
+));
 our $warnings;
+my $verbose = $::ENV{VERBOSE};
 $perlapp='/usr/bonsaitools/bin/perl';
 foreach $file (@testitems) {
+        $file =~ s/\s.*$//; # nuke everything after the first space (#comment)
+        next if (!$file); # skip null entries
        $command = "$perlapp"." -c $file 2>&1";
        $loginfo=`$command`;
 #        print '@@'.$loginfo.'##';
        if ($loginfo =~ /syntax ok$/im) {
                $warnings{$_} = 1 foreach ($loginfo =~ /\((W.*?)\)/mg);
-               if ($1) { ok(0,$file."--WARNING"); }
-               else {
-                       ok(1,$file."--ERROR-AND-WARNING-FREE");
+               if ($1) {
+                        if ($verbose) { print STDERR $loginfo; }
+                        ok(0,$file."--WARNING");
+                } else {
+                       ok(1,$file);
                }
        } else {
+                if ($verbose) { print STDERR $loginfo; }
                ok(0,$file."--ERROR");
-       }
+        }
 }