| line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
|
1
|
|
|
|
|
|
|
package TAP::Runner::Option; |
|
2
|
|
|
|
|
|
|
{ |
|
3
|
|
|
|
|
|
|
$TAP::Runner::Option::VERSION = '0.005'; |
|
4
|
|
|
|
|
|
|
} |
|
5
|
|
|
|
|
|
|
# ABSTRACT: Option object |
|
6
|
1
|
|
|
1
|
|
1209
|
use Moose; |
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
use Moose::Util::TypeConstraints; |
|
8
|
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
subtype 'ArrayRef::' . __PACKAGE__, |
|
10
|
|
|
|
|
|
|
as 'ArrayRef[' . __PACKAGE__ . ']'; |
|
11
|
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
coerce 'ArrayRef::' . __PACKAGE__, |
|
13
|
|
|
|
|
|
|
from 'ArrayRef[HashRef]', |
|
14
|
|
|
|
|
|
|
via { [ map { __PACKAGE__->new($_) } @{$_} ] }; |
|
15
|
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
has name => ( |
|
17
|
|
|
|
|
|
|
is => 'ro', |
|
18
|
|
|
|
|
|
|
isa => 'Str', |
|
19
|
|
|
|
|
|
|
required => 1, |
|
20
|
|
|
|
|
|
|
); |
|
21
|
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
has values => ( |
|
23
|
|
|
|
|
|
|
is => 'ro', |
|
24
|
|
|
|
|
|
|
isa => 'ArrayRef[Str]', |
|
25
|
|
|
|
|
|
|
required => 1, |
|
26
|
|
|
|
|
|
|
); |
|
27
|
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
has multiple => ( |
|
29
|
|
|
|
|
|
|
is => 'ro', |
|
30
|
|
|
|
|
|
|
isa => 'Bool', |
|
31
|
|
|
|
|
|
|
default => 0, |
|
32
|
|
|
|
|
|
|
); |
|
33
|
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
has parallel => ( |
|
35
|
|
|
|
|
|
|
is => 'ro', |
|
36
|
|
|
|
|
|
|
isa => 'Bool', |
|
37
|
|
|
|
|
|
|
default => 0, |
|
38
|
|
|
|
|
|
|
); |
|
39
|
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
sub get_values_array { |
|
41
|
|
|
|
|
|
|
my $self = shift; |
|
42
|
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
[ map { [ $self->name, $_ ] } @{ $self->values } ]; |
|
44
|
|
|
|
|
|
|
} |
|
45
|
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
no Moose; |
|
47
|
|
|
|
|
|
|
__PACKAGE__->meta->make_immutable; |
|
48
|
|
|
|
|
|
|
1; |
|
49
|
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
=pod |
|
53
|
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
=head1 NAME |
|
55
|
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
TAP::Runner::Option - Option object |
|
57
|
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
=head1 VERSION |
|
59
|
|
|
|
|
|
|
|
|
60
|
|
|
|
|
|
|
version 0.005 |
|
61
|
|
|
|
|
|
|
|
|
62
|
|
|
|
|
|
|
=head1 DESCRIPTION |
|
63
|
|
|
|
|
|
|
|
|
64
|
|
|
|
|
|
|
Object used for L<TAP::Runner::Test> options |
|
65
|
|
|
|
|
|
|
|
|
66
|
|
|
|
|
|
|
=head1 MOOSE SUBTYPES |
|
67
|
|
|
|
|
|
|
|
|
68
|
|
|
|
|
|
|
=head2 ArrayRef::TAP::Runner::Option |
|
69
|
|
|
|
|
|
|
|
|
70
|
|
|
|
|
|
|
Coerce ArrayRef[HashRef] to ArrayRef[TAP::Runner::Test] Used b L<TAP::Runner::Test> |
|
71
|
|
|
|
|
|
|
|
|
72
|
|
|
|
|
|
|
=head1 ATTRIBUTES |
|
73
|
|
|
|
|
|
|
|
|
74
|
|
|
|
|
|
|
=head2 name Str |
|
75
|
|
|
|
|
|
|
|
|
76
|
|
|
|
|
|
|
Option name |
|
77
|
|
|
|
|
|
|
|
|
78
|
|
|
|
|
|
|
=head2 values ArrayRef[Str] |
|
79
|
|
|
|
|
|
|
|
|
80
|
|
|
|
|
|
|
Array of option values |
|
81
|
|
|
|
|
|
|
|
|
82
|
|
|
|
|
|
|
=head2 multiple Bool |
|
83
|
|
|
|
|
|
|
|
|
84
|
|
|
|
|
|
|
If option multiple ( default not ) so for each option value will be new test |
|
85
|
|
|
|
|
|
|
with this value |
|
86
|
|
|
|
|
|
|
|
|
87
|
|
|
|
|
|
|
Example: |
|
88
|
|
|
|
|
|
|
For option { name => '--opt_exampl', values => [ 1, 2 ], multiple => 1 } |
|
89
|
|
|
|
|
|
|
will run to tests, with diferrent optoins: |
|
90
|
|
|
|
|
|
|
t/test.t --opt_exampl 1 |
|
91
|
|
|
|
|
|
|
t/test.t --opt_exampl 2 |
|
92
|
|
|
|
|
|
|
|
|
93
|
|
|
|
|
|
|
=head2 parallel Bool |
|
94
|
|
|
|
|
|
|
|
|
95
|
|
|
|
|
|
|
If option should run in parallel. Run in parallel can be just multiple option. |
|
96
|
|
|
|
|
|
|
|
|
97
|
|
|
|
|
|
|
=head1 METHODS |
|
98
|
|
|
|
|
|
|
|
|
99
|
|
|
|
|
|
|
=head2 get_values_array |
|
100
|
|
|
|
|
|
|
|
|
101
|
|
|
|
|
|
|
Build array used for cartesian multiplication |
|
102
|
|
|
|
|
|
|
|
|
103
|
|
|
|
|
|
|
Example: [ [ opt_name, opt_val1 ], [ opt_name1, opt_val2 ] ] |
|
104
|
|
|
|
|
|
|
|
|
105
|
|
|
|
|
|
|
=head1 AUTHOR |
|
106
|
|
|
|
|
|
|
|
|
107
|
|
|
|
|
|
|
Pavel R3VoLuT1OneR Zhytomirsky <r3volut1oner@gmail.com> |
|
108
|
|
|
|
|
|
|
|
|
109
|
|
|
|
|
|
|
=head1 COPYRIGHT AND LICENSE |
|
110
|
|
|
|
|
|
|
|
|
111
|
|
|
|
|
|
|
This software is copyright (c) 2012 by Pavel R3VoLuT1OneR Zhytomirsky. |
|
112
|
|
|
|
|
|
|
|
|
113
|
|
|
|
|
|
|
This is free software; you can redistribute it and/or modify it under |
|
114
|
|
|
|
|
|
|
the same terms as the Perl 5 programming language system itself. |
|
115
|
|
|
|
|
|
|
|
|
116
|
|
|
|
|
|
|
=cut |
|
117
|
|
|
|
|
|
|
|
|
118
|
|
|
|
|
|
|
|
|
119
|
|
|
|
|
|
|
__END__ |