Author: jelmer
Date: 2007-12-20 15:54:08 +0000 (Thu, 20 Dec 2007)
New Revision: 26549

WebSVN: 
http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=26549

Log:
Remove suite-specific bits.
Modified:
   branches/SAMBA_4_0/
   branches/SAMBA_4_0/source/selftest/output/buildfarm.pm
   branches/SAMBA_4_0/source/selftest/output/html.pm
   branches/SAMBA_4_0/source/selftest/output/plain.pm
   branches/SAMBA_4_0/source/selftest/selftest.pl


Changeset:

Property changes on: branches/SAMBA_4_0
___________________________________________________________________
Name: bzr:revision-info
...skipped...
Name: bzr:revision-id:v3-trunk0
...skipped...

Modified: branches/SAMBA_4_0/source/selftest/output/buildfarm.pm
===================================================================
--- branches/SAMBA_4_0/source/selftest/output/buildfarm.pm      2007-12-20 
15:54:05 UTC (rev 26548)
+++ branches/SAMBA_4_0/source/selftest/output/buildfarm.pm      2007-12-20 
15:54:08 UTC (rev 26549)
@@ -7,11 +7,11 @@
 
 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);
 }
@@ -24,7 +24,7 @@
        $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";
@@ -103,6 +103,8 @@
 sub summary($)
 {
        my ($self) = @_;
+
+       print "DURATION: " . (time() - $self->{start_time}) . " seconds\n";
 }
 
 sub skip_testsuite($$$$)

Modified: branches/SAMBA_4_0/source/selftest/output/html.pm
===================================================================
--- branches/SAMBA_4_0/source/selftest/output/html.pm   2007-12-20 15:54:05 UTC 
(rev 26548)
+++ branches/SAMBA_4_0/source/selftest/output/html.pm   2007-12-20 15:54:08 UTC 
(rev 26549)
@@ -9,13 +9,13 @@
 
 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 => [],
@@ -248,7 +248,9 @@
        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\">";

Modified: branches/SAMBA_4_0/source/selftest/output/plain.pm
===================================================================
--- branches/SAMBA_4_0/source/selftest/output/plain.pm  2007-12-20 15:54:05 UTC 
(rev 26548)
+++ branches/SAMBA_4_0/source/selftest/output/plain.pm  2007-12-20 15:54:08 UTC 
(rev 26549)
@@ -6,14 +6,16 @@
 
 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,
@@ -32,13 +34,13 @@
        $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";
 }
@@ -68,13 +70,16 @@
 
        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;
 }
 
@@ -151,12 +156,12 @@
 
        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";
        }
 
 }

Modified: branches/SAMBA_4_0/source/selftest/selftest.pl
===================================================================
--- branches/SAMBA_4_0/source/selftest/selftest.pl      2007-12-20 15:54:05 UTC 
(rev 26548)
+++ branches/SAMBA_4_0/source/selftest/selftest.pl      2007-12-20 15:54:08 UTC 
(rev 26549)
@@ -165,11 +165,7 @@
 my @excludes = ();
 
 my $statistics = {
-       START_TIME => time(),
-
        SUITES_FAIL => 0,
-       SUITES_OK => 0,
-       SUITES_SKIPPED => 0,
 
        TESTS_UNEXPECTED_OK => 0,
        TESTS_EXPECTED_OK => 0,
@@ -276,8 +272,6 @@
        if ($ret != $expected_ret) {
                $statistics->{SUITES_FAIL}++;
                exit(1) if ($opt_one);
-       } else {
-               $statistics->{SUITES_OK}++;
        }
 
        return ($ret == $expected_ret);
@@ -631,7 +625,6 @@
        my $skipreason = skip($name);
        if ($skipreason) {
                $msg_ops->skip_testsuite($name, $skipreason);
-               $statistics->{SUITES_SKIPPED}++;
        } else {
                push(@todo, $_); 
        }
@@ -791,7 +784,6 @@
                
                my $envvars = setup_env($envname);
                if (not defined($envvars)) {
-                       $statistics->{SUITES_SKIPPED}++;
                        $msg_ops->skip_testsuite($name, "unable to set up 
environment $envname");
                        next;
                }
@@ -813,10 +805,7 @@
 
 $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;
 

Reply via email to