<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;"># $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;

package Test::Tester::CaptureRunner;

our $VERSION = '1.302199';


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()-&gt;reset;

	$self-&gt;{StartLevel} = $Test::Builder::Level;
	&amp;$test();
}

sub get_results
{
	my $self = shift;
	my @results = capture()-&gt;details;

	my $start = $self-&gt;{StartLevel};
	foreach my $res (@results)
	{
		next if defined $res-&gt;{depth};
		my $depth = $res-&gt;{_depth} - $res-&gt;{_level} - $start - 3;
#		print "my $depth = $res-&gt;{_depth} - $res-&gt;{_level} - $start - 1\n";
		$res-&gt;{depth} = $depth;
	}

	return @results;
}

sub get_premature
{
	return capture()-&gt;premature;
}

sub capture
{
	return Test::Tester::Capture-&gt;new;
}

__END__

=head1 NAME

Test::Tester::CaptureRunner - Help testing test modules built with Test::Builder

=head1 DESCRIPTION

This stuff if needed to allow me to play with other ways of monitoring the
test results.

=head1 AUTHOR

Copyright 2003 by Fergal Daly &lt;fergal@esatclear.ie&gt;.

=head1 LICENSE

Under the same license as Perl itself

See L&lt;https://dev.perl.org/licenses/&gt;

=cut
</pre></body></html>