diff --git a/sbin/testCodebase.pl b/sbin/testCodebase.pl index e6ea4b5d4..d29b4105a 100644 --- a/sbin/testCodebase.pl +++ b/sbin/testCodebase.pl @@ -17,8 +17,10 @@ use Getopt::Long; my $configFile; my $help; +my $verbose; GetOptions( + 'verbose'=>\$verbose, 'configFile=s'=>\$configFile, 'help'=>\$help ); @@ -33,40 +35,14 @@ if ($help || !$configFile) { use a production config file as some tests may be destructive. + --verbose Turns on additional output. + STOP exit; } -my $someTestFailed = 0; -my @failedModules; -File::Find::find(\&runTests, "../t"); -if ($someTestFailed) { - print "\n\n"; - print "---------------------------------------\n"; - print " $someTestFailed test modules experienced failures:\n"; - print "\t".join("\n\t",@failedModules)."\n"; - print "---------------------------------------\n"; - print "\n\n"; -} -exit $someTestFailed; - -sub runTests { - my $file = $_; - return undef unless $file =~ m/^(.*?)\.t$/; - my $testType = $1; - $testType =~ s/_/ /g; - print "Running $testType tests...\n"; - unless (system("$^X $file --configFile=$configFile")) { - print "All $testType tests were successful.\n"; - } else { - push(@failedModules,$testType); - $someTestFailed++; - print "----------------------------\n"; - print "Some $testType tests failed!\n"; - print "----------------------------\n"; - sleep(2); - } - print "\n"; -} +my $verboseFlag = "-v" if ($verbose); +system("WEBGUI_LIB=../lib WEBGUI_CONFIG=../etc/".$configFile." prove ".$verboseFlag." -r ../t"); + diff --git a/t/lib/WebGUI/Test.pm b/t/lib/WebGUI/Test.pm index 7e6f44314..9892868a3 100644 --- a/t/lib/WebGUI/Test.pm +++ b/t/lib/WebGUI/Test.pm @@ -48,6 +48,7 @@ BEGIN { $WEBGUI_LIB ||= File::Spec->catpath( $WEBGUI_ROOT, 'lib' ); lib->import( $WEBGUI_LIB ); + push (@INC,$WEBGUI_LIB); # http://thread.gmane.org/gmane.comp.apache.apreq/3378 # http://article.gmane.org/gmane.comp.apache.apreq/3388