line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Test2::Tools::Subtest; |
2
|
158
|
|
|
158
|
|
1294
|
use strict; |
|
158
|
|
|
|
|
366
|
|
|
158
|
|
|
|
|
4811
|
|
3
|
158
|
|
|
158
|
|
826
|
use warnings; |
|
158
|
|
|
|
|
353
|
|
|
158
|
|
|
|
|
6804
|
|
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
our $VERSION = '0.000155'; |
6
|
|
|
|
|
|
|
|
7
|
158
|
|
|
158
|
|
920
|
use Test2::API qw/context run_subtest/; |
|
158
|
|
|
|
|
339
|
|
|
158
|
|
|
|
|
8788
|
|
8
|
158
|
|
|
158
|
|
1394
|
use Test2::Util qw/try/; |
|
158
|
|
|
|
|
417
|
|
|
158
|
|
|
|
|
10256
|
|
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
our @EXPORT = qw/subtest_streamed subtest_buffered/; |
11
|
158
|
|
|
158
|
|
1399
|
use base 'Exporter'; |
|
158
|
|
|
|
|
415
|
|
|
158
|
|
|
|
|
54624
|
|
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
sub subtest_streamed { |
14
|
10
|
|
|
10
|
1
|
2386
|
my $name = shift; |
15
|
10
|
50
|
|
|
|
35
|
my $params = ref($_[0]) eq 'HASH' ? shift(@_) : {}; |
16
|
10
|
|
|
|
|
17
|
my $code = shift; |
17
|
|
|
|
|
|
|
|
18
|
10
|
50
|
|
|
|
35
|
$params->{buffered} = 0 unless defined $params->{buffered}; |
19
|
|
|
|
|
|
|
|
20
|
10
|
|
|
|
|
30
|
my $ctx = context(); |
21
|
10
|
|
|
|
|
924
|
my $pass = run_subtest("Subtest: $name", $code, $params, @_); |
22
|
9
|
|
|
|
|
7606
|
$ctx->release; |
23
|
9
|
|
|
|
|
218
|
return $pass; |
24
|
|
|
|
|
|
|
} |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
sub subtest_buffered { |
27
|
210
|
|
|
210
|
1
|
18825
|
my $name = shift; |
28
|
210
|
100
|
|
|
|
881
|
my $params = ref($_[0]) eq 'HASH' ? shift(@_) : {}; |
29
|
210
|
|
|
|
|
440
|
my $code = shift; |
30
|
|
|
|
|
|
|
|
31
|
210
|
50
|
|
|
|
844
|
$params->{buffered} = 1 unless defined $params->{buffered}; |
32
|
|
|
|
|
|
|
|
33
|
210
|
|
|
|
|
648
|
my $ctx = context(); |
34
|
210
|
|
|
|
|
22387
|
my $pass = run_subtest($name, $code, $params, @_); |
35
|
192
|
|
|
|
|
544633
|
$ctx->release; |
36
|
192
|
|
|
|
|
5232
|
return $pass; |
37
|
|
|
|
|
|
|
} |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
1; |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
__END__ |