r24687: Registry tests are succeeding now so remove from known failure list, add...
authorJelmer Vernooij <jelmer@samba.org>
Sun, 26 Aug 2007 23:22:54 +0000 (23:22 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 20:02:43 +0000 (15:02 -0500)
source/samba4-knownfail
source/selftest/output/html.pm
source/selftest/selftest.pl

index e7f4560ec1877e3cd0f39adc7330cf684026e4cd..465c463ed22e1fee4c4566f21f24114afc4dda1b 100644 (file)
@@ -1,4 +1,3 @@
-LOCAL-REGISTRY/(nt4|ldb|dir) # Not implemented yet
 LOCAL-RESOLVE/async
 LOCAL-ICONV/next_codepoint()
 BASE-DELAYWRITE/finfo update on close
index 3b95a3d9b839f18034b9eb4bee83041eb093b126..383556903d6c6f8ed404c67cd5e45211810fc940 100644 (file)
@@ -14,22 +14,25 @@ sub new($$$$) {
                statistics => $statistics,
                active_test => undef,
                local_statistics => {},
-               msg => ""
+               msg => "",
+               error_summary => { 
+                       skip => [],
+                       expected_success => [],
+                       unexpected_success => [],
+                       expected_failure => [],
+                       unexpected_failure => [],
+                       error => []
+               }
        };
 
        link("selftest/output/testresults.css", "$dirname/testresults.css");
 
        open(INDEX, ">$dirname/index.html");
 
-       print INDEX "<html lang=\"en\">\n";
-       print INDEX "<head>\n";
-       print INDEX "  <title>Samba Testsuite Run</title>\n";
-       print INDEX "  <link rel=\"stylesheet\" type=\"text/css\" href=\"testresults.css\"/>\n";
-       print INDEX "</head>\n";
-       print INDEX "<body>\n";
-       print INDEX "<table width=\"100%\" border=\"0\" cellspacing=\"0\">\n";
-       print INDEX "  <tr><td class=\"title\">Samba Testsuite Run</td></tr>\n";
-       print INDEX "  <tr><td>\n";
+       bless($self, $class);
+
+       $self->print_html_header("Samba Testsuite Run", *INDEX);
+
        print INDEX "  <center>";
        print INDEX "  <table>\n";
        print INDEX "  <tr>\n";
@@ -38,7 +41,32 @@ sub new($$$$) {
        print INDEX "    <td class=\"tableHead\">Result</td>\n";
        print INDEX "  </tr>\n";
 
-       bless($self, $class);
+       return $self;
+}
+
+sub print_html_header($$$)
+{
+       my ($self, $title, $fh) = @_;
+
+       print $fh "<html lang=\"en\">\n";
+       print $fh "<head>\n";
+       print $fh "  <title>$title</title>\n";
+       print $fh "  <link rel=\"stylesheet\" type=\"text/css\" href=\"testresults.css\"/>\n";
+       print $fh "</head>\n";
+       print $fh "<body>\n";
+       print $fh "<table width=\"100%\" border=\"0\" cellspacing=\"0\">\n";
+       print $fh "  <tr><td class=\"title\">$title</td></tr>\n";
+       print $fh "  <tr><td>\n";
+}
+
+sub print_html_footer($$)
+{
+       my ($self, $fh) = @_;
+
+       print $fh "</td></tr>\n";
+       print $fh "</table>\n";
+       print $fh "</body>\n";
+       print $fh "</html>\n";
 }
 
 sub output_msg($$$);
@@ -59,17 +87,8 @@ sub start_testsuite($$)
 
        open(TEST, ">$self->{dirname}/$state->{HTMLFILE}") or die("Unable to open $state->{HTMLFILE} for writing");
 
-       my $title = "Test Results for $state->{NAME}";
-
-       print TEST "<html lang=\"en\">\n";
-       print TEST "<head>\n";
-       print TEST "  <title>$title</title>\n";
-       print TEST "  <link rel=\"stylesheet\" type=\"text/css\" href=\"testresults.css\"/>\n";
-       print TEST "</head>\n";
-       print TEST "<body>\n";
-       print TEST "<table width=\"100%\" border=\"0\" cellspacing=\"0\">\n";
-       print TEST "  <tr><td class=\"title\">$title</td></tr>\n";
-       print TEST "  <tr><td>\n";
+       $self->print_html_header("Test Results for $state->{NAME}",
+                                    *TEST);
        print TEST "  <table>\n";
 }
 
@@ -98,8 +117,8 @@ sub end_testsuite($$$$$)
        print TEST "</table>\n";
 
        print TEST "<div class=\"duration\">Duration: " . (time() - $state->{START_TIME}) . "s</div>\n";
-       print TEST "</body>\n";
-       print TEST "</html>\n";
+
+       $self->print_html_footer(*TEST);
 
        close(TEST);
 
@@ -164,15 +183,28 @@ sub end_test($$$$$$)
 
        $self->{local_statistics}->{$result}++;
 
+       my $track_class;
+
        if ($result eq "skip") {
                print TEST "<td class=\"outputSkipped\">\n";
+               $track_class = "skip";
        } elsif ($unexpected) {
                print TEST "<td class=\"outputFailure\">\n";
+               if ($result eq "error") {
+                       $track_class = "error";
+               } else {
+                       $track_class = "unexpected_$result";
+               }
        } else {
                print TEST "<td class=\"outputOk\">\n";
+               $track_class = "expected_$result";
        }
 
-       print TEST "<h3>$testname</h3>\n";
+       push(@{$self->{error_summary}->{$track_class}}, ,
+                [$state->{HTMLFILE}, $testname, $state->{NAME}, 
+                 $reason]);
+
+       print TEST "<a name=\"$testname\"><h3>$testname</h3></a>\n";
 
        print TEST $self->{msg};
 
@@ -199,7 +231,7 @@ sub summary($)
        } else {
                print INDEX "  <td class=\"resultFailure\">";
        }
-       print INDEX ($st->{TESTS_EXPECTED_OK} + $st->{TESTS_UNEXPECTED_OK}) + " ok";
+       print INDEX ($st->{TESTS_EXPECTED_OK} + $st->{TESTS_UNEXPECTED_OK}) . " ok";
        if ($st->{TESTS_UNEXPECTED_OK} > 0) {
                print INDEX " ($st->{TESTS_UNEXPECTED_OK} unexpected)";
        }
@@ -220,11 +252,40 @@ sub summary($)
 
        print INDEX "</table>\n";
        print INDEX "</center>\n";
-       print INDEX "</td></tr>\n";
-       print INDEX "</table>\n";
-       print INDEX "</body>\n";
-       print INDEX "</html>\n";
+       $self->print_html_footer(*INDEX);
        close(INDEX);
+
+       my $summ = $self->{error_summary};
+       open(SUMMARY, ">$self->{dirname}/summary.html");
+       $self->print_html_header("Summary", *SUMMARY);
+       sub print_table($$) {
+               my ($title, $list) = @_;
+               return if ($#$list == -1);
+               print SUMMARY "<h3>$title</h3>\n";
+               print SUMMARY "<table>\n";
+               print SUMMARY "<tr>\n";
+               print SUMMARY "  <td class=\"tableHead\">Testsuite</td>\n";
+               print SUMMARY "  <td class=\"tableHead\">Test</td>\n";
+               print SUMMARY "  <td class=\"tableHead\">Reason</td>\n";
+               print SUMMARY "</tr>\n";
+
+               foreach (@$list) {
+                       print SUMMARY "<tr>\n";
+                       print SUMMARY "  <td><a href=\"" . $$_[0] . "\">$$_[2]</a></td>\n";
+                       print SUMMARY "  <td><a href=\"" . $$_[0] . "#$$_[1]\">$$_[1]</a></td>\n";
+                       print SUMMARY "  <td>$$_[3]</td>\n";
+                       print SUMMARY "</tr>\n";
+               }
+
+               print SUMMARY "</table>";
+       }
+       print_table("Errors", $summ->{error});
+       print_table("Unexpected successes", $summ->{unexpected_success});
+       print_table("Unexpected failures", $summ->{unexpected_failure});
+       print_table("Skipped tests", $summ->{skip});
+       print_table("Expected failures", $summ->{expected_failure});
+       $self->print_html_footer(*SUMMARY);
+       close(SUMMARY);
 }
 
 sub missing_env($$$)
index 3506700f697df8ec7a5421497ed5d45e478ee73c..3abdd641c9ded510b4e65023df2b68e98aa30f3f 100755 (executable)
@@ -277,7 +277,7 @@ sub parse_subunit_results($$$$)
        return $expected_ret;
 }
 
-sub run_test($$$$$$)
+sub run_testsuite($$$$$$)
 {
        my ($envname, $name, $cmd, $i, $totalsuites, $msg_ops) = @_;
        my $msg_state = {
@@ -773,7 +773,7 @@ $envvarstr
                        next;
                }
 
-               run_test($envname, $name, $cmd, $i, $suitestotal, $msg_ops);
+               run_testsuite($envname, $name, $cmd, $i, $suitestotal, $msg_ops);
 
                if (defined($opt_analyse_cmd)) {
                        system("$opt_analyse_cmd \"$name\"");