line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Test::Stream::Workflow::Runner; |
2
|
28
|
|
|
28
|
|
763
|
use strict; |
|
28
|
|
|
|
|
31
|
|
|
28
|
|
|
|
|
734
|
|
3
|
28
|
|
|
28
|
|
89
|
use warnings; |
|
28
|
|
|
|
|
29
|
|
|
28
|
|
|
|
|
847
|
|
4
|
|
|
|
|
|
|
|
5
|
28
|
|
|
28
|
|
90
|
use Test::Stream::Util qw/try/; |
|
28
|
|
|
|
|
31
|
|
|
28
|
|
|
|
|
172
|
|
6
|
|
|
|
|
|
|
|
7
|
28
|
|
|
28
|
|
10199
|
use Test::Stream::Workflow::Task(); |
|
28
|
|
|
|
|
51
|
|
|
28
|
|
|
|
|
695
|
|
8
|
28
|
|
|
28
|
|
131
|
use Test::Stream::Sync(); |
|
28
|
|
|
|
|
31
|
|
|
28
|
|
|
|
|
8124
|
|
9
|
|
|
|
|
|
|
|
10
|
316
|
|
|
316
|
1
|
1168
|
sub subtests { 1 } |
11
|
|
|
|
|
|
|
|
12
|
1
|
|
|
1
|
1
|
4
|
sub instance { shift } |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
sub import { |
15
|
3
|
|
|
3
|
|
12
|
my $class = shift; |
16
|
3
|
|
|
|
|
3
|
my $caller = caller; |
17
|
|
|
|
|
|
|
|
18
|
3
|
|
|
|
|
16
|
require Test::Stream::Workflow::Meta; |
19
|
3
|
100
|
|
|
|
13
|
my $meta = Test::Stream::Workflow::Meta->get($caller) or return; |
20
|
1
|
|
|
|
|
3
|
$meta->set_runner($class->instance(@_)); |
21
|
|
|
|
|
|
|
} |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
my %SUPPORTED = map {$_ => 1} qw/todo skip/; |
24
|
|
|
|
|
|
|
sub verify_meta { |
25
|
319
|
|
|
319
|
1
|
303
|
my $class = shift; |
26
|
319
|
|
|
|
|
287
|
my ($unit) = @_; |
27
|
319
|
50
|
|
|
|
717
|
my $meta = $unit->meta or return; |
28
|
319
|
|
|
|
|
1535
|
my $ctx = $unit->context; |
29
|
319
|
|
|
|
|
1286
|
for my $k (keys %$meta) { |
30
|
10
|
100
|
|
|
|
30
|
next if $SUPPORTED{$k}; |
31
|
1
|
|
|
|
|
5
|
$ctx->alert("'$k' is not a recognised meta-key"); |
32
|
|
|
|
|
|
|
} |
33
|
|
|
|
|
|
|
} |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
sub run { |
36
|
315
|
|
|
315
|
1
|
2363
|
my $class = shift; |
37
|
315
|
|
|
|
|
676
|
my %params = @_; |
38
|
315
|
|
|
|
|
301
|
my $unit = $params{unit}; |
39
|
315
|
|
|
|
|
277
|
my $args = $params{args}; |
40
|
315
|
|
|
|
|
273
|
my $no_final = $params{no_final}; |
41
|
|
|
|
|
|
|
|
42
|
315
|
|
|
|
|
526
|
$class->verify_meta($unit); |
43
|
|
|
|
|
|
|
|
44
|
315
|
|
|
|
|
699
|
my $task = Test::Stream::Workflow::Task->new( |
45
|
|
|
|
|
|
|
unit => $unit, |
46
|
|
|
|
|
|
|
args => $args, |
47
|
|
|
|
|
|
|
runner => $class, |
48
|
|
|
|
|
|
|
no_final => $no_final, |
49
|
|
|
|
|
|
|
no_subtest => !$class->subtests($unit), |
50
|
|
|
|
|
|
|
); |
51
|
|
|
|
|
|
|
|
52
|
315
|
|
|
239
|
|
1520
|
my ($ok, $err) = try { $class->run_task($task) }; |
|
315
|
|
|
|
|
665
|
|
53
|
313
|
|
|
|
|
1798
|
Test::Stream::Sync->stack->top->cull(); |
54
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
# Report exceptions |
56
|
313
|
100
|
|
|
|
617
|
unless($ok) { |
57
|
2
|
|
|
|
|
11
|
my $ctx = $unit->context; |
58
|
2
|
|
|
|
|
6
|
$ctx->ok(0, $unit->name, ["Caught Exception: $err"]); |
59
|
|
|
|
|
|
|
} |
60
|
|
|
|
|
|
|
|
61
|
313
|
|
|
|
|
2395
|
return; |
62
|
|
|
|
|
|
|
} |
63
|
|
|
|
|
|
|
|
64
|
|
|
|
|
|
|
sub run_task { |
65
|
314
|
|
|
314
|
1
|
299
|
my $class = shift; |
66
|
314
|
|
|
|
|
309
|
my ($task) = @_; |
67
|
|
|
|
|
|
|
|
68
|
314
|
|
|
|
|
729
|
return $task->run(); |
69
|
|
|
|
|
|
|
} |
70
|
|
|
|
|
|
|
|
71
|
|
|
|
|
|
|
1; |
72
|
|
|
|
|
|
|
|
73
|
|
|
|
|
|
|
__END__ |