| 1 |
NAME |
| 2 |
POE::Test::Loops - Reusable tests for POE::Loop authors |
| 3 |
|
| 4 |
SYNOPSIS |
| 5 |
#!/usr/bin/perl -w |
| 6 |
|
| 7 |
use strict; |
| 8 |
use Getopt::Long; |
| 9 |
use POE::Test::Loops; |
| 10 |
|
| 11 |
my ($dir_base, $flag_help, @loop_modules, $flag_verbose); |
| 12 |
my $result = GetOptions( |
| 13 |
'dirbase=s' => \$dir_base, |
| 14 |
'loop=s' => \@loop_modules, |
| 15 |
'verbose' => \$flag_verbose, |
| 16 |
'help' => \$flag_help, |
| 17 |
); |
| 18 |
|
| 19 |
if ( |
| 20 |
!$result or !$dir_base or $flag_help or !@loop_modules |
| 21 |
) { |
| 22 |
die( |
| 23 |
"$0 usage:\n", |
| 24 |
" --dirbase DIR (required) base directory for tests\n", |
| 25 |
" --loop MODULE (required) loop modules to test\n", |
| 26 |
" --verbose show some extra output\n", |
| 27 |
" --help you're reading it\n", |
| 28 |
); |
| 29 |
} |
| 30 |
|
| 31 |
POE::Test::Loops::generate($dir_base, \@loop_modules, $flag_verbose); |
| 32 |
exit 0; |
| 33 |
|
| 34 |
DESCRIPTION |
| 35 |
POE::Test::Loops contains one function, generate(), which will generate |
| 36 |
all the loop tests for one or more POE::Loop subclasses. |
| 37 |
|
| 38 |
The "SYNOPSIS" example is a version of poe-gen-tests, which is a |
| 39 |
stand-alone utility to generate the actual tests. poe-gen-tests also |
| 40 |
documents the POE::Test::Loops system in more detail. |
| 41 |
|
| 42 |
FUNCTIONS |
| 43 |
generate( $DIRBASE, \@LOOPS, $VERBOSE ) |
| 44 |
Generates the loop tests. DIRBASE is the (relative) directory in which a |
| 45 |
subdirectory for each of the LOOPS is created. If VERBOSE is set to a |
| 46 |
TRUE value some progress reporting is printed. |
| 47 |
|
| 48 |
POE::Test::Loops::generate( |
| 49 |
"./t", |
| 50 |
[ "POE::Loop::Yours" ], |
| 51 |
1, |
| 52 |
); |
| 53 |
|
| 54 |
SEE ALSO |
| 55 |
POE::Loop and poe-gen-tests. |
| 56 |
|
| 57 |
AUTHOR & COPYRIGHT |
| 58 |
See poe-gen-tests. |
| 59 |
|