POE::Test::Loops(3pm)

πŸ“¦
version 1.360 Β· 5 versions
, in debian bookworm, debian trixie, ubuntu noble, ubuntu resolute, ubuntu stonking

✨ NAME ✨

POE::Test::Loops β€” it's the reusable test suite for all you POE::Loop authors out there πŸ’– (this is the POE::Test::Loops(3pm) page, from the User Contributed Perl Documentation, bestie 🫢)


🌸 SYNOPSIS 🌸

okay so here's the whole vibe, copy-paste ready:

#!/usr/bin/perl -w

use strict;
use Getopt::Long;
use POE::Test::Loops;

my ($dir_base, $flag_help, @loop_modules, $flag_verbose);
my $result = GetOptions(
        'dirbase=s' => \$dir_base,
        'loop=s' => \@loop_modules,
        'verbose' => \$flag_verbose,
        'help' => \$flag_help,
);

if (
        !$result or !$dir_base or $flag_help or !@loop_modules
) {
        die(
                "$0 usage:\n",
                "  --dirbase DIR   (required) base directory for tests\n",
                "  --loop MODULE   (required) loop modules to test\n",
                "  --verbose   show some extra output\n",
                "  --help   you're reading it\n",
        );
}

POE::Test::Loops::generate($dir_base, \@loop_modules, $flag_verbose);
exit 0;

no cap, that's the whole thing πŸ’…


πŸ¦‹ DESCRIPTION πŸ¦‹

POE::Test::Loops has literally one function. One. Iconic minimalism. ✨ That function is generate(), and what it does is generate all the loop tests for one or more POE::Loop subclasses. So if you're out here writing your own POE::Loop subclass, this is the bestie that makes your tests for you πŸŽ€

And that SYNOPSIS example up there? That's a version of poe-gen-tests, which is a stand-alone utility that generates the actual tests. poe-gen-tests also documents the whole POE::Test::Loops system in wayyy more detail, so go read that if you want the full lore πŸ“–


πŸ’– FUNCTIONS πŸ’–

🌈 generate( $DIRBASE, @LOOPS, $VERBOSE )

Generates the loop tests. That's the job. That's the whole job 🫑

  • $DIRBASE β€” the (relative) directory where a subdirectory gets created for each of the @LOOPS. Note the relative part, bestie, it's right there in the original, don't come for me πŸ™ˆ
  • \@LOOPS β€” arrayref of the loop modules you're testing, one subdirectory each πŸ’…
  • $VERBOSE β€” if you set it to a TRUE value, it prints some progress reporting. so you get to watch it cook πŸ‘€

like this:

POE::Test::Loops::generate(
        "./t",
        [ "POE::Loop::Yours" ],
        1,
);

πŸ‘‘ SEE ALSO πŸ‘‘

Go look at POE::Loop and poe-gen-tests. that's the whole list, fr fr πŸŽ€


See poe-gen-tests. (yes that's really all it says, the lore lives over there ✨)


and that's the tea, bestie β€” this page is perl v5.36.0, dated 2022-11-19, and it's the POE::Test::Loops(3pm) manual. go forth and generate those tests, you absolute main character πŸŒŸπŸ’…

πŸ“¦ where this page comes from