3 |
|
|
4 |
extends 'Frey'; |
extends 'Frey'; |
5 |
with 'Frey::Web'; |
with 'Frey::Web'; |
6 |
|
with 'Frey::Storage'; |
7 |
|
|
8 |
use TAP::Harness; |
use TAP::Harness; |
9 |
use TAP::Formatter::HTML; |
use TAP::Formatter::HTML; |
10 |
use Data::Dump qw/dump/; |
use Data::Dump qw/dump/; |
11 |
|
|
12 |
|
use Frey::SVK; |
13 |
|
use Frey::PPI; |
14 |
|
|
15 |
has tests => ( |
has tests => ( |
16 |
is => 'rw', |
is => 'rw', |
17 |
isa => 'ArrayRef[Str]', |
isa => 'ArrayRef[Str]', |
18 |
required => 1, |
required => 1, |
19 |
lazy => 1, # FIXME ask users which tests to run |
lazy => 1, # FIXME ask users which tests to run |
20 |
default => sub { [ glob('t/*.t') ] }, |
default => sub { |
21 |
|
# [ glob('t/*.t') ] # all tests |
22 |
|
[ Frey::SVK->modified ] |
23 |
|
}, |
24 |
); |
); |
25 |
|
|
26 |
sub as_markup { |
sub as_markup { |
37 |
formatter => $f, |
formatter => $f, |
38 |
}); |
}); |
39 |
|
|
40 |
my @tests = grep { ! m{$0} } @{ $self->tests }; # FIXME privitive way to break recursion |
my @tests = |
41 |
|
grep { ! m{$0} } # FIXME privitive way to break recursion |
42 |
|
grep { m{\.t$} } # take just tests |
43 |
|
map { |
44 |
|
if ( m{(.+)\.pm$} ) { |
45 |
|
my $class = $1; |
46 |
|
$class =~ s{^lib/}{}; |
47 |
|
$class =~ s{/}{::}g; |
48 |
|
warn "extract $_ tests $class"; |
49 |
|
Frey::PPI->new( class => $class )->has_tests; |
50 |
|
} else { |
51 |
|
$_ |
52 |
|
} |
53 |
|
} |
54 |
|
@{ $self->tests }; |
55 |
|
|
56 |
|
die "no tests for files ", dump( $self->tests ) unless @tests; |
57 |
|
|
58 |
warn "testing ",dump( @tests ); |
warn "testing ",dump( @tests ); |
59 |
$h->runtests( @tests ); |
$h->runtests( @tests ); |
60 |
|
|
61 |
|
$self->store( 'var/test.yaml', $h ); |
62 |
|
|
63 |
my $html = ${ $f->html }; |
my $html = ${ $f->html }; |
64 |
# warn $html; |
# warn $html; |
65 |
warn "got ",length($html), " bytes"; |
warn "got ",length($html), " bytes"; |