line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Test::Stream::Workflow::Runner; |
2
|
28
|
|
|
28
|
|
1241
|
use strict; |
|
28
|
|
|
|
|
52
|
|
|
28
|
|
|
|
|
776
|
|
3
|
28
|
|
|
28
|
|
143
|
use warnings; |
|
28
|
|
|
|
|
47
|
|
|
28
|
|
|
|
|
979
|
|
4
|
|
|
|
|
|
|
|
5
|
28
|
|
|
28
|
|
148
|
use Test::Stream::Util qw/try/; |
|
28
|
|
|
|
|
51
|
|
|
28
|
|
|
|
|
251
|
|
6
|
|
|
|
|
|
|
|
7
|
28
|
|
|
28
|
|
16802
|
use Test::Stream::Workflow::Task; |
|
28
|
|
|
|
|
199
|
|
|
28
|
|
|
|
|
768
|
|
8
|
28
|
|
|
28
|
|
173
|
use Test::Stream::Sync; |
|
28
|
|
|
|
|
56
|
|
|
28
|
|
|
|
|
12353
|
|
9
|
|
|
|
|
|
|
|
10
|
315
|
|
|
315
|
1
|
1811
|
sub subtests { 1 } |
11
|
|
|
|
|
|
|
|
12
|
1
|
|
|
1
|
1
|
5
|
sub instance { shift } |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
sub import { |
15
|
3
|
|
|
3
|
|
14
|
my $class = shift; |
16
|
3
|
|
|
|
|
7
|
my $caller = caller; |
17
|
|
|
|
|
|
|
|
18
|
3
|
|
|
|
|
18
|
require Test::Stream::Workflow::Meta; |
19
|
3
|
100
|
|
|
|
19
|
my $meta = Test::Stream::Workflow::Meta->get($caller) or return; |
20
|
1
|
|
|
|
|
7
|
$meta->set_runner($class->instance(@_)); |
21
|
|
|
|
|
|
|
} |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
my %SUPPORTED = map {$_ => 1} qw/todo skip/; |
24
|
|
|
|
|
|
|
sub verify_meta { |
25
|
318
|
|
|
318
|
1
|
555
|
my $class = shift; |
26
|
318
|
|
|
|
|
481
|
my ($unit) = @_; |
27
|
318
|
50
|
|
|
|
1099
|
my $meta = $unit->meta or return; |
28
|
318
|
|
|
|
|
2484
|
my $ctx = $unit->context; |
29
|
318
|
|
|
|
|
1601
|
for my $k (keys %$meta) { |
30
|
10
|
100
|
|
|
|
50
|
next if $SUPPORTED{$k}; |
31
|
1
|
|
|
|
|
10
|
$ctx->alert("'$k' is not a recognised meta-key"); |
32
|
|
|
|
|
|
|
} |
33
|
|
|
|
|
|
|
} |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
sub run { |
36
|
314
|
|
|
314
|
1
|
3134
|
my $class = shift; |
37
|
314
|
|
|
|
|
987
|
my %params = @_; |
38
|
314
|
|
|
|
|
538
|
my $unit = $params{unit}; |
39
|
314
|
|
|
|
|
499
|
my $args = $params{args}; |
40
|
314
|
|
|
|
|
526
|
my $no_final = $params{no_final}; |
41
|
|
|
|
|
|
|
|
42
|
314
|
|
|
|
|
909
|
$class->verify_meta($unit); |
43
|
|
|
|
|
|
|
|
44
|
314
|
|
|
|
|
1092
|
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
|
314
|
|
|
238
|
|
1878
|
my ($ok, $err) = try { $class->run_task($task) }; |
|
314
|
|
|
|
|
991
|
|
53
|
312
|
|
|
|
|
2545
|
Test::Stream::Sync->stack->top->cull(); |
54
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
# Report exceptions |
56
|
312
|
100
|
|
|
|
906
|
unless($ok) { |
57
|
2
|
|
|
|
|
10
|
my $ctx = $unit->context; |
58
|
2
|
|
|
|
|
9
|
$ctx->ok(0, $unit->name, ["Caught Exception: $err"]); |
59
|
|
|
|
|
|
|
} |
60
|
|
|
|
|
|
|
|
61
|
312
|
|
|
|
|
3040
|
return; |
62
|
|
|
|
|
|
|
} |
63
|
|
|
|
|
|
|
|
64
|
|
|
|
|
|
|
sub run_task { |
65
|
313
|
|
|
313
|
1
|
526
|
my $class = shift; |
66
|
313
|
|
|
|
|
487
|
my ($task) = @_; |
67
|
|
|
|
|
|
|
|
68
|
313
|
|
|
|
|
1187
|
return $task->run(); |
69
|
|
|
|
|
|
|
} |
70
|
|
|
|
|
|
|
|
71
|
|
|
|
|
|
|
1; |
72
|
|
|
|
|
|
|
|
73
|
|
|
|
|
|
|
__END__ |