line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Test::Auto::Plugin; |
2
|
|
|
|
|
|
|
|
3
|
5
|
|
|
5
|
|
7231
|
use strict; |
|
5
|
|
|
|
|
12
|
|
|
5
|
|
|
|
|
167
|
|
4
|
5
|
|
|
5
|
|
27
|
use warnings; |
|
5
|
|
|
|
|
11
|
|
|
5
|
|
|
|
|
193
|
|
5
|
|
|
|
|
|
|
|
6
|
5
|
|
|
5
|
|
30
|
use Moo; |
|
5
|
|
|
|
|
14
|
|
|
5
|
|
|
|
|
37
|
|
7
|
5
|
|
|
5
|
|
1732
|
use Test::Auto::Types (); |
|
5
|
|
|
|
|
18
|
|
|
5
|
|
|
|
|
646
|
|
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
our $VERSION = '0.12'; # VERSION |
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
# ATTRIBUTES |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
has subtests => ( |
14
|
|
|
|
|
|
|
is => 'ro', |
15
|
|
|
|
|
|
|
isa => Test::Auto::Types::Subtests(), |
16
|
|
|
|
|
|
|
required => 1 |
17
|
|
|
|
|
|
|
); |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
# METHODS |
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
sub tests { |
22
|
0
|
|
|
0
|
1
|
|
my ($self, %args) = @_; |
23
|
|
|
|
|
|
|
|
24
|
0
|
|
|
|
|
|
return $self; |
25
|
|
|
|
|
|
|
} |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
1; |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
=encoding utf8 |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
=head1 NAME |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
Test::Auto::Plugin |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
=cut |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
=head1 ABSTRACT |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
Test-Auto Plugin Class |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
=cut |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
=head1 SYNOPSIS |
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
package Test::Auto::Plugin::Example; |
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
use Test::More; |
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
use parent 'Test::Auto::Plugin'; |
50
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
sub tests { |
52
|
|
|
|
|
|
|
my ($self, @args) = @_; |
53
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
subtest "testing example plugin", sub { |
55
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
ok 1; |
57
|
|
|
|
|
|
|
}; |
58
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
return $self; |
60
|
|
|
|
|
|
|
} |
61
|
|
|
|
|
|
|
|
62
|
|
|
|
|
|
|
1; |
63
|
|
|
|
|
|
|
|
64
|
|
|
|
|
|
|
=cut |
65
|
|
|
|
|
|
|
|
66
|
|
|
|
|
|
|
=head1 DESCRIPTION |
67
|
|
|
|
|
|
|
|
68
|
|
|
|
|
|
|
This package provides an abstract base class for creating L<Test::Auto> |
69
|
|
|
|
|
|
|
plugins. |
70
|
|
|
|
|
|
|
|
71
|
|
|
|
|
|
|
=cut |
72
|
|
|
|
|
|
|
|
73
|
|
|
|
|
|
|
=head1 LIBRARIES |
74
|
|
|
|
|
|
|
|
75
|
|
|
|
|
|
|
This package uses type constraints from: |
76
|
|
|
|
|
|
|
|
77
|
|
|
|
|
|
|
L<Test::Auto::Types> |
78
|
|
|
|
|
|
|
|
79
|
|
|
|
|
|
|
=cut |
80
|
|
|
|
|
|
|
|
81
|
|
|
|
|
|
|
=head1 ATTRIBUTES |
82
|
|
|
|
|
|
|
|
83
|
|
|
|
|
|
|
This package has the following attributes: |
84
|
|
|
|
|
|
|
|
85
|
|
|
|
|
|
|
=cut |
86
|
|
|
|
|
|
|
|
87
|
|
|
|
|
|
|
=head2 subtests |
88
|
|
|
|
|
|
|
|
89
|
|
|
|
|
|
|
subtests(Subtests) |
90
|
|
|
|
|
|
|
|
91
|
|
|
|
|
|
|
This attribute is read-only, accepts C<(Subtests)> values, and is required. |
92
|
|
|
|
|
|
|
|
93
|
|
|
|
|
|
|
=cut |
94
|
|
|
|
|
|
|
|
95
|
|
|
|
|
|
|
=head1 METHODS |
96
|
|
|
|
|
|
|
|
97
|
|
|
|
|
|
|
This package implements the following methods: |
98
|
|
|
|
|
|
|
|
99
|
|
|
|
|
|
|
=cut |
100
|
|
|
|
|
|
|
|
101
|
|
|
|
|
|
|
=head2 tests |
102
|
|
|
|
|
|
|
|
103
|
|
|
|
|
|
|
tests(Any @args) : Object |
104
|
|
|
|
|
|
|
|
105
|
|
|
|
|
|
|
This method is meant to be overridden by the superclass, and should perform |
106
|
|
|
|
|
|
|
specialized subtests. While not required, ideally this method should return its |
107
|
|
|
|
|
|
|
invocant. |
108
|
|
|
|
|
|
|
|
109
|
|
|
|
|
|
|
=over 4 |
110
|
|
|
|
|
|
|
|
111
|
|
|
|
|
|
|
=item tests example #1 |
112
|
|
|
|
|
|
|
|
113
|
|
|
|
|
|
|
package main; |
114
|
|
|
|
|
|
|
|
115
|
|
|
|
|
|
|
use Test::Auto; |
116
|
|
|
|
|
|
|
use Test::Auto::Parser; |
117
|
|
|
|
|
|
|
use Test::Auto::Subtests; |
118
|
|
|
|
|
|
|
|
119
|
|
|
|
|
|
|
my $test = Test::Auto->new( |
120
|
|
|
|
|
|
|
't/Test_Auto_Plugin.t' |
121
|
|
|
|
|
|
|
); |
122
|
|
|
|
|
|
|
|
123
|
|
|
|
|
|
|
my $parser = Test::Auto::Parser->new( |
124
|
|
|
|
|
|
|
source => $test |
125
|
|
|
|
|
|
|
); |
126
|
|
|
|
|
|
|
|
127
|
|
|
|
|
|
|
my $subtests = Test::Auto::Subtests->new( |
128
|
|
|
|
|
|
|
parser => $parser |
129
|
|
|
|
|
|
|
); |
130
|
|
|
|
|
|
|
|
131
|
|
|
|
|
|
|
# Test::Auto::Plugin::ShortDescription |
132
|
|
|
|
|
|
|
my $example = $subtests->plugin('ShortDescription'); |
133
|
|
|
|
|
|
|
|
134
|
|
|
|
|
|
|
$example->tests(length => 200); |
135
|
|
|
|
|
|
|
|
136
|
|
|
|
|
|
|
=back |
137
|
|
|
|
|
|
|
|
138
|
|
|
|
|
|
|
=cut |
139
|
|
|
|
|
|
|
|
140
|
|
|
|
|
|
|
=head1 AUTHOR |
141
|
|
|
|
|
|
|
|
142
|
|
|
|
|
|
|
Al Newkirk, C<awncorp@cpan.org> |
143
|
|
|
|
|
|
|
|
144
|
|
|
|
|
|
|
=head1 LICENSE |
145
|
|
|
|
|
|
|
|
146
|
|
|
|
|
|
|
Copyright (C) 2011-2019, Al Newkirk, et al. |
147
|
|
|
|
|
|
|
|
148
|
|
|
|
|
|
|
This is free software; you can redistribute it and/or modify it under the terms |
149
|
|
|
|
|
|
|
of the The Apache License, Version 2.0, as elucidated in the |
150
|
|
|
|
|
|
|
L<"license file"|https://github.com/iamalnewkirk/test-auto/blob/master/LICENSE>. |
151
|
|
|
|
|
|
|
|
152
|
|
|
|
|
|
|
=head1 PROJECT |
153
|
|
|
|
|
|
|
|
154
|
|
|
|
|
|
|
L<Wiki|https://github.com/iamalnewkirk/test-auto/wiki> |
155
|
|
|
|
|
|
|
|
156
|
|
|
|
|
|
|
L<Project|https://github.com/iamalnewkirk/test-auto> |
157
|
|
|
|
|
|
|
|
158
|
|
|
|
|
|
|
L<Initiatives|https://github.com/iamalnewkirk/test-auto/projects> |
159
|
|
|
|
|
|
|
|
160
|
|
|
|
|
|
|
L<Milestones|https://github.com/iamalnewkirk/test-auto/milestones> |
161
|
|
|
|
|
|
|
|
162
|
|
|
|
|
|
|
L<Issues|https://github.com/iamalnewkirk/test-auto/issues> |
163
|
|
|
|
|
|
|
|
164
|
|
|
|
|
|
|
=cut |