Dist::Zilla::Plugin::MakeMaker::Runner - Test and build dists with a Makefile.PL


Dist-Zilla documentation Contained in the Dist-Zilla distribution.

Index


Code Index:

NAME

Top

Dist::Zilla::Plugin::MakeMaker::Runner - Test and build dists with a Makefile.PL

VERSION

Top

version 4.200008

AUTHOR

Top

Ricardo SIGNES <rjbs@cpan.org>

COPYRIGHT AND LICENSE

Top


Dist-Zilla documentation Contained in the Dist-Zilla distribution.

package Dist::Zilla::Plugin::MakeMaker::Runner;
BEGIN {
  $Dist::Zilla::Plugin::MakeMaker::Runner::VERSION = '4.200008';
}
# ABSTRACT: Test and build dists with a Makefile.PL

use Moose;
with qw/Dist::Zilla::Role::BuildRunner Dist::Zilla::Role::TestRunner/;

use Config;

has 'make_path' => (
  isa => 'Str',
  is  => 'ro',
  default => $Config{make} || 'make',
);

sub build {
  my $self = shift;

  my $make = $self->make_path;
  system($^X => 'Makefile.PL') and die "error with Makefile.PL\n";
  system($make)                and die "error running $make\n";

  return;
}

sub test {
  my ( $self, $target ) = @_;

  my $make = $self->make_path;
  $self->build;
  system($make, 'test',
    ( $self->zilla->logger->get_debug ? 'TEST_VERBOSE=1' : () ),
  ) and die "error running $make test\n";

  return;
}

1;

__END__