Test::SharedFork(3)

🌸 NAME 🌸

okay so welcome to the Test::SharedFork(3) page β€” it's a User Contributed Perl Documentation moment, and the module is Test::SharedFork, aka fork test. bestie, that's the name, that's the vibe. πŸ’…

✨ SYNOPSIS ✨

like, here's the whole group-chat demo, exactly:

use Test::More tests => 200;
use Test::SharedFork;

my $pid = fork();
if ($pid == 0) {
    # child
    ok 1, "child $_" for 1..100;
} elsif ($pid) {
    # parent
    ok 1, "parent $_" for 1..100;
    waitpid($pid, 0);
} else {
    die $!;
}

πŸ’– DESCRIPTION πŸ’–

Test::SharedFork is a utility module for Test::Builder. no cap.

this module makes fork(2) safety in your test case. literally, that's the whole serve.

and it merges test count with parent process & child process. that's the merge, bestie. 🫢

πŸ’€ LIMITATIONS πŸ’€

⚠️ real talk, bestie: this version of the Test::SharedFork does not support ithreads, because threads::shared conflicts with Storable. that's the limit, periodt.

πŸ‘‘ AUTHOR πŸ‘‘

shoutout to the author:

  • Tokuhiro Matsuno <tokuhirom slkjfd gmail.com>
  • yappo

🫢 THANKS TO 🫢

big thanks to these icons:

  • kazuhooku
  • konbuizm

πŸ”— SEE ALSO πŸ”—

go peek at these other modules, bestie:

  • Test::TCP
  • Test::Fork
  • Test::MultiFork

πŸ“œ LICENSE πŸ“œ

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself. free software slay πŸ’–


cute sign-off: this page is serving source/version energy from perl v5.42.0, dated 2015-12-26, and it's the Test::SharedFork(3) manual β€” mwah πŸ’‹βœ¨

πŸ“¦ where this page comes from