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