Subject: | TEST_METHOD mistakenly blocks startup/shutdown methods |
My tests pass via
./Build test
but fail under
env TEST_METHOD=search ./Build test
because my startup method is not being invoked, so my test data is not
being populated.
The fault seems to be line 149:
return grep { /\A$ENV{TEST_METHOD}\z/ } sort keys %methods;
One possible (messy) fix is:
my @methods = sort keys %methods;
if (@types == 1 && $types [0] eq TESTS) {
@methods = grep { /\A$ENV{TEST_METHOD}\z/ } @methods;
}
return @methods;
Another approach might be to
local $ENV{TEST_METHOD} = undef;
before collecting the startup/shutdown methods, or something like that.