cleanup tests, make testCodebase.pl work with traditional --configFile syntax

This commit is contained in:
Colin Kuskie 2006-03-09 01:00:27 +00:00
parent d0fca48a32
commit 9a6e77c4eb
3 changed files with 14 additions and 19 deletions

View file

@ -13,6 +13,7 @@ $|=1;
use strict;
use FindBin;
use lib "$FindBin::Bin/../t/lib";
use File::Spec qw[];
use Getopt::Long;
my $configFile;
@ -45,16 +46,23 @@ my $helpmsg=<<STOP;
STOP
my $verboseFlag = "-v" if ($verbose);
my $config = $ENV{WEBGUI_CONFIG};
$perlBase .= '/bin/' if ($perlBase);
if ( $configFile ) {
system("WEBGUI_CONFIG=".$configFile." ".$perlBase."prove ".$verboseFlag." -r ../t");
exit;
if (! -e $configFile) {
##Probably given the name of the config file with no path, prepend
##the path to it.
$configFile = File::Spec->canonpath($FindBin::Bin.'/../etc/'.$configFile);
}
if (-e $configFile) {
system("WEBGUI_CONFIG=".$configFile." ".$perlBase."prove ".$verboseFlag." -r ../t");
}
else {
die "Unable to use $configFile as a WebGUI config file\n";
}
} elsif ( defined @ENV{WEBGUI_CONFIG} ) {
system($perlBase."prove ".$verboseFlag." -r ../t");
exit;
} else {
print $helpmsg;
}