perl-Test-Run / modules / Test-Run-Plugin-AlternateInterpreters / lib / Test / Run / Plugin / AlternateInterpreters / Straps /

package Test::Run::Plugin::AlternateInterpreters::Straps::AltIntrPlugin;

use strict;
use warnings;

=head1 NAME

Test::Run::Plugin::AlternateInterpreters::Straps::AltIntrPlugin - a plugin
for Test::Run::Straps to handle the alternative interpreters.


This is a plugin for Test::Run::Straps to handle the alternative


use Moose;

use MRO::Compat;


has 'alternate_interpreters' => (is => "rw", isa => "ArrayRef");

sub _get_command_and_switches
    my $self = shift;

    my $test_file = $self->file();

    if (defined(my $interpreters_ref = $self->alternate_interpreters()))
        foreach my $i_ref (@$interpreters_ref)
            if ($self->_does_interpreter_match($i_ref, $test_file))
                return [split(/\s+/, $i_ref->{'cmd'})];
    return $self->next::method();

sub _does_interpreter_match
    my ($self, $i_ref, $test_file) = @_;

    my $pattern = $i_ref->{pattern};
    return ($test_file =~ m{$pattern});

=head1 AUTHOR

Shlomi Fish, C<< <shlomif at> >>

=head1 BUGS

Please report any bugs or feature requests to
C<bug-test-run-plugin-alternateinterpreters at>, or through the web interface at
I will be notified, and then you'll automatically be notified of progress on
your bug as I make changes.

=head1 SUPPORT

You can find documentation for this module with the perldoc command.

    perldoc Test::Run::Plugin::AlternateInterpreters

You can also look for information at:

=over 4

=item * AnnoCPAN: Annotated CPAN documentation


=item * CPAN Ratings


=item * RT: CPAN's request tracker


=item * Search CPAN




Curtis "Ovid" Poe ( L<> ) who gave the idea
of testing several tests from several interpreters in one go here:


=head1 SEE ALSO

L<Test::Run>, L<Test::Run::CmdLine>, L<TAP::Parser>


Copyright 2007 Shlomi Fish, all rights reserved.

This program is released under the following license: MIT X11.


Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.