/[Frey]/trunk/lib/Frey/Test/Runner.pm
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Contents of /trunk/lib/Frey/Test/Runner.pm

Parent Directory Parent Directory | Revision Log Revision Log


Revision 484 - (show annotations)
Mon Nov 24 14:28:43 2008 UTC (15 years, 4 months ago) by dpavlin
File size: 833 byte(s)
added Frey::Test::Runner which is thin wrapper around
TAP::Formatter::HTML to present test results as html data
1 package Frey::Test::Runner;
2 use Moose;
3
4 extends 'Frey';
5 with 'Frey::Web';
6
7 use TAP::Harness;
8 use TAP::Formatter::HTML;
9 use Data::Dump qw/dump/;
10
11 has tests => (
12 is => 'rw',
13 isa => 'ArrayRef[Str]',
14 required => 1,
15 lazy => 1, # FIXME ask users which tests to run
16 default => sub { [ glob('t/*.t') ] },
17 );
18
19 sub as_markup {
20 my ($self) = @_;
21
22 my $f = TAP::Formatter::HTML->new({
23 silent => 1,
24
25 inline_css => 1,
26 inline_js => 1,
27 });
28 my $h = TAP::Harness->new({
29 merge => 1,
30 formatter => $f,
31 });
32
33 my @tests = grep { ! m{$0} } @{ $self->tests }; # FIXME privitive way to break recursion
34 warn "testing ",dump( @tests );
35 $h->runtests( @tests );
36
37 my $html = ${ $f->html };
38 # warn $html;
39 warn "got ",length($html), " bytes";
40 # $html =~ s{^.*<body>}{}s;
41 # $html =~ s{</body>.*$}{}s;
42 return $self->editor_links( $html );
43 }
44
45 1;

  ViewVC Help
Powered by ViewVC 1.1.26