On Sat, Feb 7, 2009 at 9:26 PM, Michael G Schwern <schw...@pobox.com> wrote:
> Gabor Szabo wrote:
>> With prove I can say
>>
>> prove --exec "$ENV{PARROT_DIR}/parrot
>> $ENV{PARROT_DIR}/languages/rakudo/perl6.pbc" t/01.t
>>
>> and it will run
>>
>> $ENV{PARROT_DIR}/parrot $ENV{PARROT_DIR}/languages/rakudo/perl6.pbc t/01.t
>>
>> how can I achieve the same thing with "make test" or "Build test" ?
>
> You'll get the most control, and the least headaches, if you just override the
> test target.  Even if you can hack Test::Harness into running Rakudo it has so
> many built in Perl5-isms that it'll keep biting you all down the line.
>
> In Module::Build it's simple, override ACTION_test().
>
> sub ACTION_test {
>    my $self = shift;
>    $self->depends_on('code');
>
>    my $tests = $self->find_test_files;
>
>    # XXX Throw in a check that PARROT_DIR is set
>
>    my $parrot = "$ENV{PARROT_DIR}/parrot";
>    my $rakudo = "$ENV{PARROT_DIR}/languages/rakudo/perl6.pbc";
>
>    # XXX Throw in some checks that the above actually exists.
>
>    system("prove", "--exec", "$parrot $rakudo", @$tests);
>
>    return $? == 0 ? 1 : 0;
> }
>
> I believe you can avoid the override and set the "use_tap_harness" property
> and then just feed TAP::Harness arguments (which are very much like prove's)
> in with "tap_harness_args".
>
> In MakeMaker you override test_via_harness().
>
> package MY;
> sub test_via_harness {
>    my($self, $perl, $tests) = @_;
>
>    # XXX Throw in a check that PARROT_DIR is set
>
>    my $parrot = "$ENV{PARROT_DIR}/parrot";
>    my $rakudo = "$ENV{PARROT_DIR}/languages/rakudo/perl6.pbc";
>
>    # XXX Throw in some checks that the above actually exists.
>
>    my $command = $self->quote_literal("$parrot $rakudo");
>    return qq[\tprove --exec $command @$tests];
> }
>

By the time I saw this I already used a shimming method Alias suggested
renaming the test files to something.6t and adding something.t to be a simple
script that will run the something.6t script.
See http://search.cpan.org/dist/Perl6-Conf on how it is working now.

For the next release or so I'll check out your suggestion too.

regards
   Gabor

Reply via email to