line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Test2::Tools::Subtest; |
2
|
158
|
|
|
158
|
|
1249
|
use strict; |
|
158
|
|
|
|
|
425
|
|
|
158
|
|
|
|
|
5161
|
|
3
|
158
|
|
|
158
|
|
814
|
use warnings; |
|
158
|
|
|
|
|
405
|
|
|
158
|
|
|
|
|
6691
|
|
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
our $VERSION = '0.000156'; |
6
|
|
|
|
|
|
|
|
7
|
158
|
|
|
158
|
|
1078
|
use Test2::API qw/context run_subtest/; |
|
158
|
|
|
|
|
728
|
|
|
158
|
|
|
|
|
8982
|
|
8
|
158
|
|
|
158
|
|
985
|
use Test2::Util qw/try/; |
|
158
|
|
|
|
|
347
|
|
|
158
|
|
|
|
|
11136
|
|
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
our @EXPORT = qw/subtest_streamed subtest_buffered/; |
11
|
158
|
|
|
158
|
|
1074
|
use base 'Exporter'; |
|
158
|
|
|
|
|
493
|
|
|
158
|
|
|
|
|
56044
|
|
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
sub subtest_streamed { |
14
|
10
|
|
|
10
|
1
|
2341
|
my $name = shift; |
15
|
10
|
50
|
|
|
|
38
|
my $params = ref($_[0]) eq 'HASH' ? shift(@_) : {}; |
16
|
10
|
|
|
|
|
17
|
my $code = shift; |
17
|
|
|
|
|
|
|
|
18
|
10
|
50
|
|
|
|
42
|
$params->{buffered} = 0 unless defined $params->{buffered}; |
19
|
|
|
|
|
|
|
|
20
|
10
|
|
|
|
|
30
|
my $ctx = context(); |
21
|
10
|
|
|
|
|
1014
|
my $pass = run_subtest("Subtest: $name", $code, $params, @_); |
22
|
9
|
|
|
|
|
7468
|
$ctx->release; |
23
|
9
|
|
|
|
|
226
|
return $pass; |
24
|
|
|
|
|
|
|
} |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
sub subtest_buffered { |
27
|
210
|
|
|
210
|
1
|
19796
|
my $name = shift; |
28
|
210
|
100
|
|
|
|
897
|
my $params = ref($_[0]) eq 'HASH' ? shift(@_) : {}; |
29
|
210
|
|
|
|
|
403
|
my $code = shift; |
30
|
|
|
|
|
|
|
|
31
|
210
|
50
|
|
|
|
897
|
$params->{buffered} = 1 unless defined $params->{buffered}; |
32
|
|
|
|
|
|
|
|
33
|
210
|
|
|
|
|
685
|
my $ctx = context(); |
34
|
210
|
|
|
|
|
22282
|
my $pass = run_subtest($name, $code, $params, @_); |
35
|
192
|
|
|
|
|
411230
|
$ctx->release; |
36
|
192
|
|
|
|
|
5190
|
return $pass; |
37
|
|
|
|
|
|
|
} |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
1; |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
__END__ |