slight improvement to the error output of the test framework
This commit is contained in:
parent
62506c0592
commit
9fda810ad0
2 changed files with 35 additions and 4 deletions
|
|
@ -18,6 +18,7 @@ use POE::Component::IKC::ClientLite;
|
|||
use POE::Component::IKC::Server;
|
||||
use POE::Component::IKC::Specifier;
|
||||
use WebGUI::Session;
|
||||
use WebGUI::Workflow;
|
||||
|
||||
$|=1; # disable output buffering
|
||||
my $help;
|
||||
|
|
@ -73,7 +74,9 @@ POE::Session->create(
|
|||
inline_states => {
|
||||
_start => \&serviceStart,
|
||||
_stop => \&serviceStop,
|
||||
"shutdown" => \&serviceStop
|
||||
"shutdown" => \&serviceStop,
|
||||
initializeWorkflowScheduler => \&initializeWorkflowScheduler,
|
||||
loadSchedule => \&loadSchedule
|
||||
}
|
||||
);
|
||||
|
||||
|
|
@ -81,6 +84,22 @@ POE::Kernel->run();
|
|||
exit 0;
|
||||
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
sub initializeWorkflowScheduler {
|
||||
my ($kernel, $session) = @_[KERNEL, SESSION];
|
||||
foreach my $config (keys %{WebGUI::Config::readAllConfigs("..")}) {
|
||||
$kernel->post($session,"loadSchedule", $config);
|
||||
}
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
sub loadSchedule {
|
||||
my ($heap, $config) = @_[HEAP, ARG0];
|
||||
sessionOpen($config);
|
||||
$heap->{workflowSchedules}{$config} = WebGUI::Workflow::getSchedules();
|
||||
sessionClose();
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
sub serviceShutdown {
|
||||
my $kernel = $_[KERNEL];
|
||||
|
|
@ -90,11 +109,12 @@ sub serviceShutdown {
|
|||
#-------------------------------------------------------------------
|
||||
sub serviceStart {
|
||||
print "Starting WebGUI Spectre...";
|
||||
my ( $kernel, $heap ) = @_[ KERNEL, HEAP ];
|
||||
my ( $kernel, $heap, $session) = @_[ KERNEL, HEAP, SESSION ];
|
||||
my $serviceName = "Spectre";
|
||||
$kernel->alias_set($serviceName);
|
||||
$kernel->call( IKC => publish => $serviceName, ["shutdown"] );
|
||||
$kernel->call( IKC => publish => $serviceName, ["shutdown", "loadSchedule"] );
|
||||
print "OK\n";
|
||||
$kernel->post($session, "initializeWorkflowScheduler");
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
|
@ -116,6 +136,7 @@ sub sessionOpen {
|
|||
|
||||
#-------------------------------------------------------------------
|
||||
sub sessionClose {
|
||||
WebGUI::Session::end();
|
||||
WebGUI::Session::close();
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -42,6 +42,7 @@ closedir(DIR);
|
|||
|
||||
chdir("../t");
|
||||
my $someTestFailed = 0;
|
||||
my @failedModules;
|
||||
foreach my $file (@files) {
|
||||
next unless $file =~ m/^(.*?)\.t$/;
|
||||
my $testType = $1;
|
||||
|
|
@ -50,7 +51,8 @@ foreach my $file (@files) {
|
|||
unless (system("$^X $file --configFile=$configFile")) {
|
||||
print "All $testType tests were successful.\n";
|
||||
} else {
|
||||
$someTestFailed = 1;
|
||||
push(@failedModules,$testType);
|
||||
$someTestFailed++;
|
||||
print "----------------------------\n";
|
||||
print "Some $testType tests failed!\n";
|
||||
print "----------------------------\n";
|
||||
|
|
@ -58,5 +60,13 @@ foreach my $file (@files) {
|
|||
}
|
||||
print "\n";
|
||||
}
|
||||
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;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue