use strict;
-sub new($$$$) {
- my ($class, $statistics) = @_;
+sub new($$$) {
+ my ($class) = @_;
my $self = {
- statistics => $statistics,
- test_output => {}
+ test_output => {},
+ start_time => time()
};
bless($self, $class);
}
$state->{NAME} = $name;
$state->{START_TIME} = time();
- my $duration = $state->{START_TIME} - $self->{statistics}->{START_TIME};
+ my $duration = $state->{START_TIME} - $self->{start_time};
$out .= "--==--==--==--==--==--==--==--==--==--==--\n";
$out .= "Running test $name (level 0 stdout)\n";
$out .= "--==--==--==--==--==--==--==--==--==--==--\n";
sub summary($)
{
my ($self) = @_;
+
+ print "DURATION: " . (time() - $self->{start_time}) . " seconds\n";
}
sub skip_testsuite($$$$)
use FindBin qw($RealBin);
-sub new($$$$) {
+sub new$($$$) {
my ($class, $dirname, $statistics) = @_;
my $self = {
dirname => $dirname,
- statistics => $statistics,
active_test => undef,
local_statistics => {},
+ statistics => {},
msg => "",
error_summary => {
skip => [],
print INDEX "<tr>\n";
print INDEX " <td class=\"testSuiteTotal\">Total</td>\n";
- if ($st->{SUITES_FAIL} == 0) {
+ if ($st->{TESTS_UNEXPECTED_OK} == 0 and
+ $st->{TESTS_UNEXPECTED_FAIL} == 0 and
+ $st->{TESTS_ERROR} == 0) {
print INDEX " <td class=\"resultOk\">";
} else {
print INDEX " <td class=\"resultFailure\">";
use strict;
-sub new($$$$$$) {
+sub new($$$$$$$) {
my ($class, $summaryfile, $verbose, $immediate, $statistics, $totaltests) = @_;
my $self = {
verbose => $verbose,
immediate => $immediate,
statistics => $statistics,
+ start_time => time(),
test_output => {},
suitesfailed => [],
+ suites_ok => 0,
skips => {},
summaryfile => $summaryfile,
index => 0,
$state->{NAME} = $name;
$state->{START_TIME} = time();
- my $duration = $state->{START_TIME} - $self->{statistics}->{START_TIME};
+ my $duration = $state->{START_TIME} - $self->{start_time};
$self->{test_output}->{$name} = "" unless($self->{verbose});
my $out = "";
$out .= "[$self->{index}/$self->{totalsuites} in ".$duration."s";
- $out .= sprintf(", %d errors", $self->{statistics}->{SUITES_FAIL}) if ($self->{statistics}->{SUITES_FAIL} > 0);
+ $out .= sprintf(", %d errors", ($#{$self->{suitesfailed}}+1)) if ($#{$self->{suitesfailed}} > -1);
$out .= "] $name\n",
print "$out";
}
if ($unexpected) {
$self->output_msg($state, "ERROR: $reason\n");
+ push (@{$self->{suitesfailed}}, $name);
+ } else {
+ $self->{suites_ok}++;
}
if ($unexpected and $self->{immediate} and not $self->{verbose}) {
$out .= $self->{test_output}->{$name};
- push (@{$self->{suitesfailed}}, $name);
}
+
print $out;
}
print "\nA summary with detailed informations can be found in:\n $self->{summaryfile}\n";
- if ($self->{statistics}->{SUITES_FAIL} == 0) {
+ if ($#{$self->{suitesfailed}} == -1) {
my $ok = $self->{statistics}->{TESTS_EXPECTED_OK} +
$self->{statistics}->{TESTS_EXPECTED_FAIL};
- print "\nALL OK ($ok tests in $self->{statistics}->{SUITES_OK} testsuites)\n";
+ print "\nALL OK ($ok tests in $self->{suites_ok} testsuites)\n";
} else {
- print "\nFAILED ($self->{statistics}->{TESTS_UNEXPECTED_FAIL} failures and $self->{statistics}->{TESTS_ERROR} errors in $self->{statistics}->{SUITES_FAIL} testsuites)\n";
+ print "\nFAILED ($self->{statistics}->{TESTS_UNEXPECTED_FAIL} failures and $self->{statistics}->{TESTS_ERROR} errors in ". ($#{$self->{suitesfailed}}+1) ." testsuites)\n";
}
}
my @excludes = ();
my $statistics = {
- START_TIME => time(),
-
SUITES_FAIL => 0,
- SUITES_OK => 0,
- SUITES_SKIPPED => 0,
TESTS_UNEXPECTED_OK => 0,
TESTS_EXPECTED_OK => 0,
if ($ret != $expected_ret) {
$statistics->{SUITES_FAIL}++;
exit(1) if ($opt_one);
- } else {
- $statistics->{SUITES_OK}++;
}
return ($ret == $expected_ret);
my $skipreason = skip($name);
if ($skipreason) {
$msg_ops->skip_testsuite($name, $skipreason);
- $statistics->{SUITES_SKIPPED}++;
} else {
push(@todo, $_);
}
my $envvars = setup_env($envname);
if (not defined($envvars)) {
- $statistics->{SUITES_SKIPPED}++;
$msg_ops->skip_testsuite($name, "unable to set up environment $envname");
next;
}
$target->stop();
-$statistics->{END_TIME} = time();
-my $duration = ($statistics->{END_TIME}-$statistics->{START_TIME});
$msg_ops->summary();
-print "DURATION: $duration seconds\n";
my $failed = 0;