Adam Kennedy wrote:

This works:


---test.pl---
use Test::More tests => 1;

my $Test = Test::More->builder;
my $counter = $Test->current_test;

print qx!perl t/response.pl!;

$Test->current_test($counter + 1);

But why 1? Why not 5? or 10?

It has to be set to the number of tests run in the other process. I don't know if there is a way to do something like no_plan for the sub process... I don't think so... Every time pass(), ok(), etc is called it updates the counter. In the sub process there is no way to pass back the internal counter, so you have to update the counter manually.

__END__


---response.pl---
use Test::More no_plan => 1;

Test::More->builder->no_header(1);
Test::More->builder->no_ending(1);

BTW, not sure if the no_ending() is needed. It works with and without in this case.

pass ('this was a passing test');

___END___

The problem was the test.pl file counter was never incremented so it never saw the planned test.



Reply via email to