forked from rjbs/Dist-Zilla
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Runner.pm
44 lines (33 loc) · 863 Bytes
/
Runner.pm
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
package Dist::Zilla::Plugin::MakeMaker::Runner;
# ABSTRACT: Test and build dists with a Makefile.PL
use Moose;
with(
'Dist::Zilla::Role::BuildRunner',
'Dist::Zilla::Role::TestRunner',
'Dist::Zilla::Role::TestingBase',
);
use namespace::autoclean;
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, @{$self->testing_command},
( $self->zilla->logger->get_debug ? 'TEST_VERBOSE=1' : () ),
) and die "error running $make test\n";
return;
}
__PACKAGE__->meta->make_immutable;
1;