line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Test2::Harness::Parser::EventStream; |
2
|
25
|
|
|
25
|
|
233481
|
use strict; |
|
25
|
|
|
|
|
26
|
|
|
25
|
|
|
|
|
739
|
|
3
|
25
|
|
|
25
|
|
118
|
use warnings; |
|
25
|
|
|
|
|
46
|
|
|
25
|
|
|
|
|
1245
|
|
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
our $VERSION = '0.000013'; |
6
|
|
|
|
|
|
|
|
7
|
25
|
|
|
25
|
|
99
|
use base 'Test2::Harness::Parser'; |
|
25
|
|
|
|
|
27
|
|
|
25
|
|
|
|
|
2974
|
|
8
|
25
|
|
|
25
|
|
98
|
use Test2::Util::HashBase; |
|
25
|
|
|
|
|
47
|
|
|
25
|
|
|
|
|
233
|
|
9
|
|
|
|
|
|
|
|
10
|
25
|
|
|
25
|
|
1987
|
use Test2::Event 1.302068; |
|
25
|
|
|
|
|
727
|
|
|
25
|
|
|
|
|
579
|
|
11
|
25
|
|
|
25
|
|
8939
|
use Test2::Event::Bail; |
|
25
|
|
|
|
|
6326
|
|
|
25
|
|
|
|
|
449
|
|
12
|
25
|
|
|
25
|
|
97
|
use Test2::Event::Diag; |
|
25
|
|
|
|
|
47
|
|
|
25
|
|
|
|
|
423
|
|
13
|
25
|
|
|
25
|
|
9301
|
use Test2::Event::Encoding; |
|
25
|
|
|
|
|
5380
|
|
|
25
|
|
|
|
|
433
|
|
14
|
25
|
|
|
25
|
|
7405
|
use Test2::Event::Exception; |
|
25
|
|
|
|
|
5717
|
|
|
25
|
|
|
|
|
522
|
|
15
|
25
|
|
|
25
|
|
7530
|
use Test2::Event::Note; |
|
25
|
|
|
|
|
4561
|
|
|
25
|
|
|
|
|
482
|
|
16
|
25
|
|
|
25
|
|
95
|
use Test2::Event::Ok; |
|
25
|
|
|
|
|
25
|
|
|
25
|
|
|
|
|
506
|
|
17
|
25
|
|
|
25
|
|
771
|
use Test2::Event::ParseError; |
|
25
|
|
|
|
|
25
|
|
|
25
|
|
|
|
|
381
|
|
18
|
25
|
|
|
25
|
|
8182
|
use Test2::Event::Plan; |
|
25
|
|
|
|
|
12730
|
|
|
25
|
|
|
|
|
457
|
|
19
|
25
|
|
|
25
|
|
8329
|
use Test2::Event::Skip; |
|
25
|
|
|
|
|
5779
|
|
|
25
|
|
|
|
|
511
|
|
20
|
25
|
|
|
25
|
|
103
|
use Test2::Event::Subtest; |
|
25
|
|
|
|
|
25
|
|
|
25
|
|
|
|
|
483
|
|
21
|
25
|
|
|
25
|
|
7961
|
use Test2::Event::UnknownStderr; |
|
25
|
|
|
|
|
48
|
|
|
25
|
|
|
|
|
448
|
|
22
|
25
|
|
|
25
|
|
10521
|
use Test2::Event::UnknownStdout; |
|
25
|
|
|
|
|
52
|
|
|
25
|
|
|
|
|
408
|
|
23
|
25
|
|
|
25
|
|
8812
|
use Test2::Event::Waiting; |
|
25
|
|
|
|
|
2189
|
|
|
25
|
|
|
|
|
444
|
|
24
|
25
|
|
|
25
|
|
9394
|
use Test2::Harness::JSON; |
|
25
|
|
|
|
|
48
|
|
|
25
|
|
|
|
|
6729
|
|
25
|
|
|
|
|
|
|
|
26
|
|
|
|
352
|
1
|
|
sub morph { } |
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
sub step { |
29
|
13435
|
|
|
13435
|
1
|
9832
|
my $self = shift; |
30
|
|
|
|
|
|
|
|
31
|
13435
|
|
|
|
|
16180
|
return ($self->parse_stderr, $self->parse_stdout); |
32
|
|
|
|
|
|
|
} |
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
sub parse_stderr { |
35
|
13445
|
|
|
13445
|
0
|
9435
|
my $self = shift; |
36
|
|
|
|
|
|
|
|
37
|
13445
|
100
|
|
|
|
20525
|
my $line = $self->proc->get_err_line or return; |
38
|
10
|
|
|
|
|
78
|
chomp $line; |
39
|
|
|
|
|
|
|
|
40
|
10
|
|
|
|
|
35
|
return Test2::Event::UnknownStderr->new(output => $line); |
41
|
|
|
|
|
|
|
} |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
sub parse_stdout { |
44
|
13441
|
|
|
13441
|
0
|
9946
|
my $self = shift; |
45
|
|
|
|
|
|
|
|
46
|
13441
|
100
|
|
|
|
20194
|
my $line = $self->proc->get_out_line or return; |
47
|
12542
|
|
|
|
|
129160
|
$line =~ s/\s+\z//s; |
48
|
|
|
|
|
|
|
|
49
|
12542
|
100
|
|
|
|
25501
|
if ($line =~ m/^T2_ENCODING: (.+)$/) { |
50
|
325
|
|
|
|
|
1197
|
my $enc = $1; |
51
|
|
|
|
|
|
|
|
52
|
325
|
|
|
|
|
1107
|
$self->proc->encoding($enc); |
53
|
|
|
|
|
|
|
|
54
|
325
|
|
|
|
|
1280
|
return Test2::Event::Encoding->new( |
55
|
|
|
|
|
|
|
encoding => $enc, |
56
|
|
|
|
|
|
|
); |
57
|
|
|
|
|
|
|
} |
58
|
|
|
|
|
|
|
|
59
|
12217
|
100
|
|
|
|
16898
|
if ( my $event = $self->_event_from_stdout($line) ) { |
60
|
12215
|
|
|
|
|
1060942
|
return $event; |
61
|
|
|
|
|
|
|
} |
62
|
|
|
|
|
|
|
|
63
|
2
|
|
|
|
|
14
|
return Test2::Event::UnknownStdout->new(output => $line); |
64
|
|
|
|
|
|
|
} |
65
|
|
|
|
|
|
|
|
66
|
|
|
|
|
|
|
sub _event_from_stdout { |
67
|
12217
|
|
|
12217
|
|
9664
|
my $self = shift; |
68
|
12217
|
|
|
|
|
9902
|
my $out = shift; |
69
|
|
|
|
|
|
|
|
70
|
12217
|
100
|
|
|
|
67566
|
return unless $out =~ s/^T2_EVENT:\s//; |
71
|
|
|
|
|
|
|
|
72
|
12215
|
|
|
|
|
12409
|
local $@ = undef; |
73
|
12215
|
|
|
|
|
11067
|
my $data = eval { JSON->new->decode($out) }; |
|
12215
|
|
|
|
|
24086
|
|
74
|
12215
|
|
|
|
|
180512
|
my $err = $@; |
75
|
|
|
|
|
|
|
|
76
|
12215
|
50
|
|
|
|
17394
|
if ($data) { |
77
|
12215
|
|
|
|
|
40462
|
return Test2::Event->from_json(%$data); |
78
|
|
|
|
|
|
|
} |
79
|
|
|
|
|
|
|
|
80
|
0
|
|
|
|
|
|
chomp($err); |
81
|
0
|
|
|
|
|
|
return Test2::Event::ParseError->new(parse_error => $err); |
82
|
|
|
|
|
|
|
} |
83
|
|
|
|
|
|
|
|
84
|
|
|
|
|
|
|
1; |
85
|
|
|
|
|
|
|
|
86
|
|
|
|
|
|
|
__END__ |