in reply to Re: Getting Test::More to ignore forked children
in thread Getting Test::More to ignore forked children

You're missing the point. In the following code sample the child immediately exits without running any tests. In my real tests the child is an artifact of the module code and isn't meant to be tested directly (there's some IPC going on). I should be able to kill off Test::More in the child so it can get on with taking care of its parent without being expected to run tests as well.

use Test::More 'no_plan'; exit unless fork; ok( 1 ); __DATA__ ok 1 # No tests run! 1..1

Replies are listed 'Best First'.
Re^3: Getting Test::More to ignore forked children
by adrianh (Chancellor) on Nov 13, 2003 at 23:44 UTC

    What version of Test::Builder are you running? This sounds like an issue that was fixed in the Test::Simple 0.47 release. From the Changes file:

    - Peter Scott made the ending logic not fire on child processes when forking.

    I don't see the behaviour you're getting in my version. If you can't update Test::Builder, then calling Test::More->builder->no_ending in the child process should stop the error.

      Oh I see. I was using 0.45 which is what comes in the core with perl 5.8.0. 5.8.1 updated to 0.47 and it behaves nicely on the simple fragment I posted here. I'll try see if the higher version handles the real code too. Thanks for the note on that.