App-Prove-Plugin-Distributed

 view release on metacpan or  search on metacpan

lib/App/Prove/Plugin/Distributed.pm  view on Meta::CPAN

It will setup all of the tests to be distributed through the 
L<TAP::Parser::SourceHandler::Worker> source handler class.

=cut

sub load {
    my ( $class, $p ) = @_;
    my @args = @{ $p->{args} };
    my $app  = $p->{app_prove};
    {
        local @ARGV = @args;

        push @ARGV, grep { /^--/ } @{ $app->{argv} };
        $app->{argv} = [ grep { !/^--/ } @{ $app->{argv} } ];
        Getopt::Long::Configure(qw(no_ignore_case bundling pass_through));

        # Don't add coderefs to GetOptions
        GetOptions(
            'manager=s'          => \$app->{manager},
            'distributed-type=s' => \$app->{distributed_type},
            'start-up=s'         => \$app->{start_up},

lib/App/Prove/Plugin/Distributed.pm  view on Meta::CPAN

    my $args     = shift;
    my $cwd      = File::Spec->rel2abs('.');

    #LSF: The code from here to exit is from  L<FCGI::Daemon> module.
    local *CORE::GLOBAL::exit = sub { die 'notr3a11yeXit' };
    local $0 = $job_info;    #fixes FindBin (in English $0 means $PROGRAM_NAME)
    no strict;               # default for Perl5
    {

        package main;
        local @ARGV = $args ? @$args : ();
        do $0;               # do $0; could be enough for strict scripts
        chdir($cwd);

        if ($EVAL_ERROR) {
            $EVAL_ERROR =~ s{\n+\z}{};
            unless ( $EVAL_ERROR =~ m{^notr3a11yeXit} ) {
                $error = $EVAL_ERROR;
                return;
            }
        }

lib/TAP/Parser/SourceHandler/Worker.pm  view on Meta::CPAN

  my @active_workers = $class->load_options($app_prove_object, \@ARGV);

Returns boolean.

=cut

sub load_options {
    my $class = shift;
    my ( $app, $args ) = @_;
    {
        local @ARGV = @$args;
        Getopt::Long::Configure(qw(no_ignore_case bundling pass_through));

        # Don't add coderefs to GetOptions
        GetOptions(
            'use-local-public-ip' => \$use_local_public_ip,
            'sync-test-env=s'     => \$sync_type,
            'destination-dir=s'   => \$destination_dir
        ) or croak('Unable to continue');
        if ($sync_type) {
            if ( $sync_type eq 'rsync' ) {

lib/TAP/Parser/SourceHandler/Worker/PBS.pm  view on Meta::CPAN


Returns boolean.

=cut

sub load_options {
    my $class = shift;
    my ( $app, $args ) = @_;
    croak 'parent failed to load options.' unless($class->SUPER::load_options(@_));
    {
        local @ARGV = @$args;
        Getopt::Long::Configure(qw(no_ignore_case bundling pass_through));
        my %options;
        for my $arg (
            qw(server
            wd name script tracer host nodes ppn account
            partition queue begint ofile efile tfile pri mem pmem vmem pvmem cput
            pcput wallt nice pbsid cmd prev next depend stagein stageout vars
            shell maillist mailopt)
          )
        {

lib/TAP/Parser/SourceHandler/Worker/SSH.pm  view on Meta::CPAN


Returns boolean.

=cut

sub load_options {
    my $class = shift;
    my ( $app, $args ) = @_;
    croak 'parent failed to load options.' unless($class->SUPER::load_options(@_));
    {
        local @ARGV = @$args;
        Getopt::Long::Configure(qw(no_ignore_case bundling pass_through));

        # Don't add coderefs to GetOptions
        GetOptions( 'hosts=s' => \$app->{hosts}, )
          or croak('Unable to continue');
        @hosts = split /,/, $app->{hosts} if ( $app->{hosts} );
        unless (@hosts) {
            croak(
'No host found. At least one host need to be specified with --hosts option.'
            );



( run in 0.600 second using v1.01-cache-2.11-cpan-49f99fa48dc )