# (X)Emacs mode: -*- cperl -*-
package test;
=head1 NAME
test - tools for helping in test suites (not including running externalprograms).
=head1 SYNOPSIS
use FindBin 1.42 qw( $Bin );
use Test 1.13 qw( ok plan );
BEGIN { unshift @INC, $Bin };
use test qw( DATA_DIR
evcheck runcheck );
BEGIN {
plan tests => 3,
todo => [],
;
}
ok evcheck(sub {
open my $fh, '>', 'foo';
print $fh "$_\n"
for 'Bulgaria', 'Cholet';
close $fh;
}, 'write foo'), 1, 'write foo';
save_output('stderr', *STDERR{IO});
warn 'Hello, Mum!';
print restore_output('stderr');
=head1 DESCRIPTION
This package provides some variables, and sets up an environment, for test
scripts, such as those used in F.
This package does not including running external programs; that is provided by
C. This is so that suites not needing that can include only
test.pm, and so not require the presence of C.
Setting up the environment includes:
=over 4
=item Prepending F onto the path
=item Pushing the module F dir onto the @PERL5LIB var
For executed scripts.
=item Pushing the module F dir onto the @INC var
For internal C