line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Outthentic::Story::Stat; |
2
|
1
|
|
|
1
|
|
8
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
297
|
|
3
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
my @stories; |
5
|
|
|
|
|
|
|
my $current; |
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
sub current { |
8
|
|
|
|
|
|
|
|
9
|
0
|
|
|
0
|
0
|
|
my $class = shift; |
10
|
0
|
0
|
|
|
|
|
$current || {}; # we return "fake" current for upstream stories |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
} |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
sub all { |
15
|
0
|
|
|
0
|
0
|
|
my $class = shift; |
16
|
|
|
|
|
|
|
@stories |
17
|
0
|
|
|
|
|
|
} |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
sub failures { |
20
|
0
|
|
|
0
|
0
|
|
my $class = shift; |
21
|
0
|
|
|
|
|
|
grep { $_->{status} == 0 } $class->all |
|
0
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
} |
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
sub new_story { |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
# gets called in Outthentic::Story::run_story |
27
|
|
|
|
|
|
|
# for downstream stories only |
28
|
0
|
|
|
0
|
0
|
|
my $class = shift; |
29
|
0
|
|
|
|
|
|
my $data = shift; |
30
|
0
|
|
|
|
|
|
push @stories, { vars => {} , %$data , status => 1 }; |
31
|
0
|
|
|
|
|
|
$current = $stories[-1]; |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
} |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
sub add_check_stat { |
36
|
|
|
|
|
|
|
|
37
|
0
|
|
|
0
|
0
|
|
my $class = shift; |
38
|
0
|
|
|
|
|
|
my $data = shift; |
39
|
|
|
|
|
|
|
|
40
|
0
|
|
|
|
|
|
push @{$class->current->{check_stat}}, $data; |
|
0
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
} |
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
sub set_stdout { |
45
|
|
|
|
|
|
|
|
46
|
0
|
|
|
0
|
0
|
|
my $class = shift; |
47
|
0
|
|
|
|
|
|
my $stdout = shift; |
48
|
|
|
|
|
|
|
|
49
|
0
|
|
|
|
|
|
$class->current->{stdout} = $stdout; |
50
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
} |
52
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
sub set_scenario_status { |
54
|
|
|
|
|
|
|
|
55
|
0
|
|
|
0
|
0
|
|
my $class = shift; |
56
|
0
|
|
|
|
|
|
my $status = shift; |
57
|
|
|
|
|
|
|
|
58
|
0
|
|
|
|
|
|
$class->current->{scenario_status} = $status; |
59
|
|
|
|
|
|
|
|
60
|
|
|
|
|
|
|
} |
61
|
|
|
|
|
|
|
|
62
|
|
|
|
|
|
|
sub set_status { |
63
|
|
|
|
|
|
|
|
64
|
0
|
|
|
0
|
0
|
|
my $class = shift; |
65
|
0
|
|
|
|
|
|
my $status = shift; |
66
|
|
|
|
|
|
|
|
67
|
0
|
|
|
|
|
|
$class->current->{status} = $status; |
68
|
|
|
|
|
|
|
|
69
|
|
|
|
|
|
|
} |
70
|
|
|
|
|
|
|
|
71
|
|
|
|
|
|
|
1; |
72
|
|
|
|
|
|
|
|
73
|
|
|
|
|
|
|
|