Andy Armstrong wrote:
> I've just committed a patch against ExtUtils::MakeMaker 6.31 that makes
> test_harness use TAPx::Harness instead of Test::Harness if the env
> variable PERL_EUMM_USE_TAPX is set to a true value and TAPx::Harness is
> installed.
>
> EUMM Patch:
> http://svn.hexten.net/tapx/patches/ExtUtils-MakeMaker-6.31.patch
I couldn't accept this patch to MM. This would lead to MM's environment being
littered with PERL_EUMM_USE_FLAVOR_OF_THE_WEEK. And if TAPx::Harness is going
to be the guts for Test::Harness anyway there isn't much point.
Need something a bit more generic. Perhaps make it easier to override the
behavior of test_harness()?
Also fall through logic makes my eyes bleed. Rather than this...
if ($ENV{PERL_EUMM_USE_TAPX}) {
eval "require TAPx::Harness";
unless ($@) {
...TAPx code...
return;
}
}
# Fallback: use Test::Harness
Do this.
if( $ENV{PERL_EUMM_USE_TAPX} && eval "require TAPx::Harness" ) {
...TAPx code...
}
else {
...Test::Harness code...
}
Or if the condition for checking to use TAPx::Harness were more complex you can
figure it out beforehand and roll the decision up into $use_tapx.