1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-23 17:34:34 +03:00

r24665: Close file handles properly.

(This used to be commit 7f914b08a7)
This commit is contained in:
Jelmer Vernooij 2007-08-26 14:07:23 +00:00 committed by Gerald (Jerry) Carter
parent cc253ae4a0
commit 8e789517b7

View File

@ -5,6 +5,7 @@ use Exporter;
@ISA = qw(Exporter); @ISA = qw(Exporter);
use strict; use strict;
use warnings;
sub new($$$$) { sub new($$$$) {
my ($class, $dirname, $statistics) = @_; my ($class, $dirname, $statistics) = @_;
@ -48,9 +49,9 @@ sub output_msg($$$)
my ($self, $state, $output) = @_; my ($self, $state, $output) = @_;
unless (defined($self->{active_test})) { unless (defined($self->{active_test})) {
print TEST "$output<br>"; print TEST "$output<br/>";
} else { } else {
$self->{msg} .= "$output<br>"; $self->{msg} .= "$output<br/>";
} }
} }
@ -63,17 +64,17 @@ sub end_testsuite($$$$$)
close(TEST); close(TEST);
print {$self->{INDEX}} "<tr><td><a href=\"$state->{HTMLFILE}\">$state->{NAME}</a></td><td>$state->{ENVNAME}</td>"; print INDEX "<tr><td><a href=\"$state->{HTMLFILE}\">$state->{NAME}</a></td><td>$state->{ENVNAME}</td>";
if ($ret == $expected_ret) { if ($ret == $expected_ret) {
print {$self->{INDEX}} "<td bgcolor=\"green\">OK</td>"; print INDEX "<td bgcolor=\"green\">OK</td>";
} else { } else {
print {$self->{INDEX}} "<td bgcolor=\"red\">FAIL</td>"; print INDEX "<td bgcolor=\"red\">FAIL</td>";
} }
print {$self->{INDEX}} "<td>" . (time() - $state->{START_TIME}) . "</td>\n"; print INDEX "<td>" . (time() - $state->{START_TIME}) . "</td>\n";
print {$self->{INDEX}} "</tr>\n"; print INDEX "</tr>\n";
} }
sub start_test($$$) sub start_test($$$)
@ -106,11 +107,13 @@ sub end_test($$$$$)
sub summary($) sub summary($)
{ {
my ($self) = @_; my ($self) = @_;
print {$self->{INDEX}} "</table>\n"; print INDEX "</table>\n";
print {$self->{INDEX}} "FAILED ($self->{statistics}->{TESTS_UNEXPECTED_FAIL} failures and $self->{statistics}->{TESTS_ERROR} errors in $self->{statistics}->{SUITES_FAIL} testsuites)\n"; print INDEX "FAILED ($self->{statistics}->{TESTS_UNEXPECTED_FAIL} failures and $self->{statistics}->{TESTS_ERROR} errors in $self->{statistics}->{SUITES_FAIL} testsuites)\n";
print {$self->{INDEX}} "</body>\n"; print INDEX "</body>\n";
print {$self->{INDEX}} "</html>\n"; print INDEX "</html>\n";
close(INDEX);
} }
sub missing_env($$$) sub missing_env($$$)
@ -124,7 +127,7 @@ sub skip_testsuite($$)
{ {
my ($self, $name) = @_; my ($self, $name) = @_;
print {$self->{INDEX}} "<tr><td>$name</td><td>N/A</td><td bgcolor=\"yellow\">SKIPPED</td><td>N/A</td></tr>\n"; print INDEX "<tr><td>$name</td><td>N/A</td><td bgcolor=\"yellow\">SKIPPED</td><td>N/A</td></tr>\n";
} }
1; 1;