Update of /cvsroot/http-webtest/HTTP-WebTest/lib/HTTP/WebTest/Plugin
In directory sc8-pr-cvs1:/tmp/cvs-serv20616/lib/HTTP/WebTest/Plugin
Modified Files:
HarnessReport.pm
Log Message:
Use Test::Builder
Index: HarnessReport.pm
===================================================================
RCS file: /cvsroot/http-webtest/HTTP-WebTest/lib/HTTP/WebTest/Plugin/HarnessReport.pm,v
retrieving revision 1.8
retrieving revision 1.9
diff -C2 -d -r1.8 -r1.9
*** HarnessReport.pm 12 Dec 2002 23:22:13 -0000 1.8
--- HarnessReport.pm 13 Dec 2002 00:54:22 -0000 1.9
***************
*** 16,20 ****
This plugin creates reports that are compatible with
L<Test::Harness|Test::Harness>.
! By default, this plugin is not loaded by
L<HTTP::WebTest|HTTP::WebTest>. To load it, use the global test parameter
C<plugins>.
--- 16,20 ----
This plugin creates reports that are compatible with
L<Test::Harness|Test::Harness>.
! By default, this plugin is not loaded by
L<HTTP::WebTest|HTTP::WebTest>. To load it, use the global test parameter
C<plugins>.
***************
*** 34,37 ****
--- 34,39 ----
use HTTP::WebTest::Utils qw(make_access_method);
+ use Test::Builder;
+
=head1 TEST PARAMETERS
***************
*** 40,52 ****
=cut
! sub start_tests {
! my $self = shift;
!
! $self->SUPER::start_tests;
!
! my $test_num = @{$self->webtest->tests};
!
! $self->print(1, '..', $test_num, "\n");
! }
sub report_test {
--- 42,46 ----
=cut
! my $TEST = Test::Builder->new;
sub report_test {
***************
*** 63,69 ****
}
! $self->print("\n");
! $self->print("# URL: $url\n");
! $self->print("# Test Name: $test_name\n") if defined $test_name;
my $all_ok = 1;
--- 57,63 ----
}
! $TEST->diag('-' x 60);
! $TEST->diag("URL: $url");
! $TEST->diag("Test Name: $test_name") if defined $test_name;
my $all_ok = 1;
***************
*** 75,79 ****
my @results = @$result[1 .. @$result - 1];
! $self->print("# ", uc($group_comment), "\n");
for my $subresult (@$result[1 .. @$result - 1]) {
--- 69,73 ----
my @results = @$result[1 .. @$result - 1];
! $TEST->diag(uc($group_comment));
for my $subresult (@$result[1 .. @$result - 1]) {
***************
*** 82,90 ****
$all_ok &&= $subresult->ok;
! $self->print("# $comment: $ok\n");
}
}
! $self->print(($all_ok ? 'ok' : 'not ok'), "\n");
}
--- 76,85 ----
$all_ok &&= $subresult->ok;
! $TEST->diag(" $comment: $ok\n");
}
}
! local $Test::Builder::Level = 3;
! $TEST->ok($all_ok);
}
|