develooper Front page | perl.qa | Postings from January 2007

Re: TAPx::Harness support for EUMM

Thread Previous | Thread Next
From:
Michael G Schwern
Date:
January 29, 2007 18:25
Subject:
Re: TAPx::Harness support for EUMM
Message ID:
45BEAC76.7090905@gmail.com
Andy Armstrong wrote:
> Sure - I'm open to suggestions. Do you mean something like this?:
> 
> $ export PERL_EUMM_HARNESS_CLASS=TAPx::Harness::Compatible
> $ make test

That's one way, though I'd rather it be a Makefile.PL argument. [1]

The way I was thinking was to make it easier for users to write MY::test_harness() so they can plug in any testing system, not just Test::Harness compatible ones.  This would mostly involve separating the scaffolding code (expanding and sorting the arguments, fixing up @INC) from the Test::Harness specific stuff.  Something like:

sub test_harness {
    require Test::Harness;
    require File::Spec;

    my $verbose = shift;

    # Because Windows doesn't do this for us and listing all the *.t files
    # out on the command line can blow over its exec limit.
    require ExtUtils::Command;
    my @files = sort { lc $a cmp lc $b } ExtUtils::Command::expand_wildcards(@ARGV);

    local @INC = @INC;
    unshift @INC, map { File::Spec->rel2abs($_) } @_;
    run_tests(files => \@files, verbose => $verbose);
}

sub run_tests {
    my %args = @_;

    $Test::Harness::verbose = $args{verbose};
    return Test::Harness::runtests(@{$args{files}});
}

Then all you have to override is run_tests().


[1]  Or, for the really adventurous... implement a makemakerrc.

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About