File Coverage

blib/lib/App/autotest/Test/Runner.pm
Criterion Covered Total %
statement 23 23 100.0
branch n/a
condition n/a
subroutine 8 8 100.0
pod 0 2 0.0
total 31 33 93.9


line stmt bran cond sub pod time code
1 4     4   65212 use strict;
  4         4  
  4         142  
2 4     4   15 use warnings;
  4         4  
  4         155  
3              
4             package App::autotest::Test::Runner;
5             $App::autotest::Test::Runner::VERSION = '0.006';
6             # ABSTRACT: runs tests
7              
8 4     4   421 use Moose;
  4         289531  
  4         22  
9 4     4   31906 use TAP::Harness;
  4         18618  
  4         138  
10 4     4   1494 use App::autotest::Test::Runner::Result;
  4         16  
  4         614  
11              
12             has harness => (
13             is => 'rw',
14             isa => 'TAP::Harness',
15             default => sub { _default_harness() }
16             );
17              
18             has result => (
19             is => 'rw',
20             isa => 'App::autotest::Test::Runner::Result'
21             );
22              
23             sub run {
24 12     12 0 8729 my ( $self, @tests ) = @_;
25              
26 12         334 my $harness_result = $self->harness->runtests(@tests);
27 12         370036 my $result =
28             App::autotest::Test::Runner::Result->new( harness_result => $harness_result );
29 12         9113 $self->result($result);
30             }
31              
32             sub had_failures {
33 1     1 0 745 my ($self)=@_;
34              
35 1         22 return $self->result->has_failures;
36             }
37              
38              
39             sub _default_harness {
40 18     18   88 my $args = {
41             verbosity => -3,
42             lib => [ 'lib', 'blib/lib', 'blib/arch' ],
43             };
44 18         152 return TAP::Harness->new($args);
45             }
46              
47             1;
48              
49             __END__
50              
51             =pod
52              
53             =encoding UTF-8
54              
55             =head1 NAME
56              
57             App::autotest::Test::Runner - runs tests
58              
59             =head1 VERSION
60              
61             version 0.006
62              
63             =head1 INTERNAL METHODS
64              
65             =head1 AUTHOR
66              
67             Gregor Goldbach <glauschwuffel@nomaden.org>
68              
69             =head1 COPYRIGHT AND LICENSE
70              
71             This software is copyright (c) 2015 by Gregor Goldbach.
72              
73             This is free software; you can redistribute it and/or modify it under
74             the same terms as the Perl 5 programming language system itself.
75              
76             =cut