diff options
Diffstat (limited to 'cpan/Test-Simple/lib/Test/Tester/CaptureRunner.pm')
-rw-r--r-- | cpan/Test-Simple/lib/Test/Tester/CaptureRunner.pm | 67 |
1 files changed, 62 insertions, 5 deletions
diff --git a/cpan/Test-Simple/lib/Test/Tester/CaptureRunner.pm b/cpan/Test-Simple/lib/Test/Tester/CaptureRunner.pm index a9815328a5..f14a4c145a 100644 --- a/cpan/Test-Simple/lib/Test/Tester/CaptureRunner.pm +++ b/cpan/Test-Simple/lib/Test/Tester/CaptureRunner.pm @@ -1,19 +1,76 @@ +# $Header: /home/fergal/my/cvs/Test-Tester/lib/Test/Tester/CaptureRunner.pm,v 1.3 2003/03/05 01:07:55 fergal Exp $ use strict; -use warnings; + package Test::Tester::CaptureRunner; -warn "Test::Tester::CaptureRunner is deprecated"; +use Test::Tester::Capture; +require Exporter; + +sub new +{ + my $pkg = shift; + my $self = bless {}, $pkg; + return $self; +} + +sub run_tests +{ + my $self = shift; + + my $test = shift; + + capture()->reset; + + $self->{StartLevel} = $Test::Builder::Level; + &$test(); +} + +sub get_results +{ + my $self = shift; + my @results = capture()->details; + + my $start = $self->{StartLevel}; + foreach my $res (@results) + { + next if defined $res->{depth}; + my $depth = $res->{_depth} - $res->{_level} - $start - 3; +# print "my $depth = $res->{_depth} - $res->{_level} - $start - 1\n"; + $res->{depth} = $depth; + } -1; + return @results; +} + +sub get_premature +{ + return capture()->premature; +} + +sub capture +{ + return Test::Tester::Capture->new; +} __END__ =head1 NAME -Test::Tester::CaptureRunner - Deprecated +Test::Tester::CaptureRunner - Help testing test modules built with Test::Builder =head1 DESCRIPTION -DEPRECATED. This package is now just a stub. +This stuff if needed to allow me to play with other ways of monitoring the +test results. + +=head1 AUTHOR + +Copyright 2003 by Fergal Daly <fergal@esatclear.ie>. + +=head1 LICENSE + +Under the same license as Perl itself + +See http://www.perl.com/perl/misc/Artistic.html =cut |