File: example.pl

package info (click to toggle)
libtest-tap-htmlmatrix-perl 0.09-1
  • links: PTS, VCS
  • area: main
  • in suites: lenny
  • size: 168 kB
  • ctags: 50
  • sloc: perl: 539; makefile: 40
file content (31 lines) | stat: -rw-r--r-- 862 bytes parent folder | download
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
#!/usr/bin/perl

use strict;
use warnings;

use Test::TAP::HTMLMatrix;
use Test::TAP::Model::Visual;
use Test::TAP::Model::Consolidated;

# make a successful test run
my $model_ok = Test::TAP::Model::Visual->new_with_tests(glob("t/*.t"));
$model_ok->desc_string("real run");

# make a dummy run with some failures
my $model_failing = do { local $ENV{TEST_FAIL_RANDOMLY} = 1; Test::TAP::Model::Visual->new_with_tests(glob("t/*.t")) };
$model_failing->desc_string("dummy failures");

my $v = Test::TAP::HTMLMatrix->new(Test::TAP::Model::Consolidated->new($model_ok, $model_failing));

# control the HTML output
$v->has_inline_css(1);
#$v->no_javascript(1);

# this is the most popular view:
print $v->detail_html;

# you can also get a more compact summary:
#print $v->summary_html;

# or a directory with both files and some css
# $v->output_dir("example_html");