line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Test2::Tools::Subtest; |
2
|
157
|
|
|
157
|
|
1140
|
use strict; |
|
157
|
|
|
|
|
324
|
|
|
157
|
|
|
|
|
5115
|
|
3
|
157
|
|
|
157
|
|
807
|
use warnings; |
|
157
|
|
|
|
|
346
|
|
|
157
|
|
|
|
|
6499
|
|
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
our $VERSION = '0.000153'; |
6
|
|
|
|
|
|
|
|
7
|
157
|
|
|
157
|
|
888
|
use Test2::API qw/context run_subtest/; |
|
157
|
|
|
|
|
368
|
|
|
157
|
|
|
|
|
8629
|
|
8
|
157
|
|
|
157
|
|
989
|
use Test2::Util qw/try/; |
|
157
|
|
|
|
|
331
|
|
|
157
|
|
|
|
|
9597
|
|
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
our @EXPORT = qw/subtest_streamed subtest_buffered/; |
11
|
157
|
|
|
157
|
|
1180
|
use base 'Exporter'; |
|
157
|
|
|
|
|
448
|
|
|
157
|
|
|
|
|
50380
|
|
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
sub subtest_streamed { |
14
|
10
|
|
|
10
|
1
|
1741
|
my $name = shift; |
15
|
10
|
50
|
|
|
|
29
|
my $params = ref($_[0]) eq 'HASH' ? shift(@_) : {}; |
16
|
10
|
|
|
|
|
18
|
my $code = shift; |
17
|
|
|
|
|
|
|
|
18
|
10
|
50
|
|
|
|
39
|
$params->{buffered} = 0 unless defined $params->{buffered}; |
19
|
|
|
|
|
|
|
|
20
|
10
|
|
|
|
|
25
|
my $ctx = context(); |
21
|
10
|
|
|
|
|
817
|
my $pass = run_subtest("Subtest: $name", $code, $params, @_); |
22
|
9
|
|
|
|
|
6667
|
$ctx->release; |
23
|
9
|
|
|
|
|
172
|
return $pass; |
24
|
|
|
|
|
|
|
} |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
sub subtest_buffered { |
27
|
210
|
|
|
210
|
1
|
15572
|
my $name = shift; |
28
|
210
|
100
|
|
|
|
833
|
my $params = ref($_[0]) eq 'HASH' ? shift(@_) : {}; |
29
|
210
|
|
|
|
|
411
|
my $code = shift; |
30
|
|
|
|
|
|
|
|
31
|
210
|
50
|
|
|
|
808
|
$params->{buffered} = 1 unless defined $params->{buffered}; |
32
|
|
|
|
|
|
|
|
33
|
210
|
|
|
|
|
656
|
my $ctx = context(); |
34
|
210
|
|
|
|
|
19846
|
my $pass = run_subtest($name, $code, $params, @_); |
35
|
192
|
|
|
|
|
510274
|
$ctx->release; |
36
|
192
|
|
|
|
|
4907
|
return $pass; |
37
|
|
|
|
|
|
|
} |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
1; |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
__END__ |