From 8e789517b723955f1530837058d5e9fe98aba19f Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Sun, 26 Aug 2007 14:07:23 +0000 Subject: r24665: Close file handles properly. (This used to be commit 7f914b08a77c6035918d9f4463990f1dd8f3efb9) --- source4/selftest/output/html.pm | 27 +++++++++++++++------------ 1 file changed, 15 insertions(+), 12 deletions(-) (limited to 'source4/selftest') diff --git a/source4/selftest/output/html.pm b/source4/selftest/output/html.pm index 6e83d811e8..d181516002 100644 --- a/source4/selftest/output/html.pm +++ b/source4/selftest/output/html.pm @@ -5,6 +5,7 @@ use Exporter; @ISA = qw(Exporter); use strict; +use warnings; sub new($$$$) { my ($class, $dirname, $statistics) = @_; @@ -48,9 +49,9 @@ sub output_msg($$$) my ($self, $state, $output) = @_; unless (defined($self->{active_test})) { - print TEST "$output
"; + print TEST "$output
"; } else { - $self->{msg} .= "$output
"; + $self->{msg} .= "$output
"; } } @@ -63,17 +64,17 @@ sub end_testsuite($$$$$) close(TEST); - print {$self->{INDEX}} "{HTMLFILE}\">$state->{NAME}$state->{ENVNAME}"; + print INDEX "{HTMLFILE}\">$state->{NAME}$state->{ENVNAME}"; if ($ret == $expected_ret) { - print {$self->{INDEX}} "OK"; + print INDEX "OK"; } else { - print {$self->{INDEX}} "FAIL"; + print INDEX "FAIL"; } - print {$self->{INDEX}} "" . (time() - $state->{START_TIME}) . "\n"; + print INDEX "" . (time() - $state->{START_TIME}) . "\n"; - print {$self->{INDEX}} "\n"; + print INDEX "\n"; } sub start_test($$$) @@ -106,11 +107,13 @@ sub end_test($$$$$) sub summary($) { my ($self) = @_; - print {$self->{INDEX}} "\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 "\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}} "\n"; - print {$self->{INDEX}} "\n"; + print INDEX "\n"; + print INDEX "\n"; + + close(INDEX); } sub missing_env($$$) @@ -124,7 +127,7 @@ sub skip_testsuite($$) { my ($self, $name) = @_; - print {$self->{INDEX}} "$nameN/ASKIPPEDN/A\n"; + print INDEX "$nameN/ASKIPPEDN/A\n"; } 1; -- cgit