NAME
Perlbug::Testing - Perlbug testing module
DESCRIPTION
Utility functions for Perlbug test scripts.
If run within a 'make test' sequence, the prints will normally only appear from the todo
, ok
and notOK
calls.
Output is seen from output
when TEST_VERBOSE
is set to 1, or when the script is being run directly.
Note that files with iseven(filename)s (test_2, test_8, etc) are normally expected to succeed with the given function test, and odd names are expected to fail, thus giving a checkable failure.
Names with only a zero, ie: my_test_0 are purely placeholders, and should be ignored.
SYNOPSIS
use Perlbug::Testing;
use Testing;
plan('todo' => 8); # will do nine(9)
my $test = 0;
my $o_test = Perlbug::Testing->new('Email'); # currently ignored
my @tests = get_tests('testmails/head2head', qw(this that etc));
my ($i_ok, $data) = $o_test->check_header(*STDIN); # for example
if ($i_ok == 1) { # == 1 (hopefully :-) || 0 :-(
ok($test);
} else {
notok($test);
}
output($test, 'data');
output("done test($test)");
METHODS
- new
-
Create new Perlbug::Testing object:
my $o_test = Perlbug::Testing->new(); # generic my $o_email_test = Perlbug::Testing->new('Email'); # guess :-)
- output
-
prints given args
- iseven
-
Return 0(odd) or 1(even) based on last number of given filename
my $num = iseven($filename);
- get_tests
-
Wraps getting test material from test directory, incorporates test count.
my @test = get_tests($t_dir, qw(this that and the other));
AUTHOR
Richard Foley perlbug@rfi.net 2000