@ISA
= (
qw(Module::Build)
);
sub
ACTION_runtest
{
my
(
$self
) =
@_
;
my
$p
=
$self
->{properties};
$self
->depends_on(
'code'
);
local
@INC
=
@INC
;
unshift
@INC
, (File::Spec->catdir(
$p
->{base_dir},
$self
->blib,
'lib'
),
File::Spec->catdir(
$p
->{base_dir},
$self
->blib,
'arch'
));
$self
->do_test_run_tests;
}
sub
ACTION_distruntest {
my
(
$self
) =
@_
;
$self
->depends_on(
'distdir'
);
my
$start_dir
=
$self
->cwd;
my
$dist_dir
=
$self
->dist_dir;
chdir
$dist_dir
or
die
"Cannot chdir to $dist_dir: $!"
;
$self
->run_perl_script(
'Build.PL'
)
or
die
"Error executing 'Build.PL' in dist directory: $!"
;
$self
->run_perl_script(
'Build'
)
or
die
"Error executing 'Build' in dist directory: $!"
;
$self
->run_perl_script(
'Build'
, [], [
'runtest'
])
or
die
"Error executing 'Build test' in dist directory"
;
chdir
$start_dir
;
}
sub
do_test_run_tests
{
my
$self
=
shift
;
my
$test_run
=
Test::Run::CmdLine::Iface->new(
{
'test_files'
=> [
glob
(
"t/*.t"
)],
}
);
return
$test_run
->run();
}
sub
ACTION_tags
{
return
system
(
qw(
ctags -f tags --recurse --totals
--exclude=blib/** --exclude=t/lib/**
--exclude=.svn --exclude='*~'
--languages=Perl --langmap=Perl:+.t
)
);
}
1;