WEBGUI_CONFIG and --configFile options work together

This commit is contained in:
kenperl 2006-01-25 09:05:21 +00:00
parent 734ef2fc1e
commit 7d1dfed519

View file

@ -11,8 +11,8 @@
$|=1;
use strict;
use lib '../lib';
use File::Find;
use FindBin;
use lib "$FindBin::Bin/../t/lib";
use Getopt::Long;
my $configFile;
@ -25,8 +25,7 @@ GetOptions(
'help'=>\$help
);
if ($help || !$configFile) {
print <<STOP;
my $helpmsg=<<STOP;
perl $0 --configFile
@ -38,11 +37,16 @@ if ($help || !$configFile) {
--verbose Turns on additional output.
STOP
exit;
}
my $verboseFlag = "-v" if ($verbose);
system("WEBGUI_LIB=../lib WEBGUI_CONFIG=../etc/".$configFile." prove ".$verboseFlag." -r ../t");
my $config = $ENV{WEBGUI_CONFIG};
if ( $configFile ) {
system("WEBGUI_CONFIG=".$configFile." prove ".$verboseFlag." -r ../t");
exit;
} elsif ( defined @ENV{WEBGUI_CONFIG} ) {
system("prove ".$verboseFlag." -r ../t");
exit;
} else {
print $helpmsg;
}