Tracks

書いてみたい方はココを参照下さい。

Test::SharedFork - testing with fork(2) B!



Test::SharedFork is utility module for Test::Builder. This module makes forking test! This module merges test count with parent process & child process.

The following code is works well!

    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 $!;
    }

My Test::TCP stands on this module.