1Test::Fixme(3) User Contributed Perl Documentation Test::Fixme(3)
2
3
4
6 Test::Fixme - Check code for FIXMEs.
7
9 version 0.16
10
12 # In a test script like 't/test-fixme.t'
13 use Test::Fixme;
14 run_tests();
15
16 # You can also tailor the behaviour.
17 use Test::Fixme;
18 run_tests( where => 'lib', # where to find files to check
19 match => 'TODO', # what to check for
20 skip_all => $ENV{SKIP} # should all tests be skipped
21 );
22
24 When coding it is common to come up against problems that need to be
25 addressed but that are not a big deal at the moment. What generally
26 happens is that the coder adds comments like:
27
28 # FIXME - what about windows that are bigger than the screen?
29
30 # FIXME - add checking of user privileges here.
31
32 Test::Fixme allows you to add a test file that ensures that none of
33 these get forgotten in the module.
34
36 run_tests
37 By default run_tests will search for 'FIXME' in all the files it can
38 find in the project. You can change these defaults by using 'where' or
39 'match' as follows:
40
41 run_tests( where => 'lib', # just check the modules.
42 match => 'TODO' # look for things that are not done yet.
43 );
44
45 where
46 Specifies where to search for files. This can be a scalar
47 containing a single directory name, or it can be a list reference
48 containing multiple directory names.
49
50 match
51 Expression to search for within the files. This may be a simple
52 string, or a qr//-quoted regular expression. For example:
53
54 match => qr/[T]ODO|[F]IXME|[B]UG/,
55
56 filename_match
57 Expression to filter file names. This should be a qr//-quoted
58 regular expression. For example:
59
60 match => qr/\.(:pm|pl)$/,
61
62 would only match .pm and .pl files under your specified directory.
63
64 manifest
65 Specifies the name of your MANIFEST file which will be used as the
66 list of files to test instead of where or filename_match.
67
68 manifest => 'MANIFEST',
69
70 warn
71 Do not fail when a FIXME or other pattern is matched. Tests that
72 would have been failures will still issue a diagnostic that will be
73 viewed when you run "prove" without "-v", "make test" or "./Build
74 test".
75
76 format
77 Specifies format to be used for display of pattern matches.
78
79 original
80 The original and currently default format looks something like
81 this:
82
83 # File: './lib/Test/Fixme.pm'
84 # 16 # ABSTRACT: Check code for FIXMEs.
85 # 25 $args{match} = 'FIXME' unless defined $args{match} && length $args{match};
86 # 28 $args{format} ||= $ENV{TEST_FIXME_FORMAT};
87 # 228 # FIXME - what about windows that are bigger than the screen?
88 # 230 # FIXME - add checking of user privileges here.
89 # 239 By default run_tests will search for 'FIXME' in all the files it can
90 # 280 Do not fail when a FIXME or other pattern is matched. Tests that would
91 # 288 If you want to match something other than 'FIXME' then you may find
92 # 296 run_tests( skip_all => $ENV{SKIP_TEST_FIXME} );
93 # 303 L<Devel::FIXME>
94
95 With the line numbers on the left and the offending text on the
96 right.
97
98 perl
99 The "perl" format is that used by Perl itself to report
100 warnings and errors.
101
102 # Pattern found at ./lib/Test/Fixme.pm line 16:
103 # # ABSTRACT: Check code for FIXMEs.
104 # Pattern found at ./lib/Test/Fixme.pm line 25:
105 # $args{match} = 'FIXME' unless defined $args{match} && length $args{match};
106 # Pattern found at ./lib/Test/Fixme.pm line 28:
107 # $args{format} ||= $ENV{TEST_FIXME_FORMAT};
108 # Pattern found at ./lib/Test/Fixme.pm line 228:
109 # # FIXME - what about windows that are bigger than the screen?
110 # Pattern found at ./lib/Test/Fixme.pm line 230:
111 # # FIXME - add checking of user privileges here.
112 # Pattern found at ./lib/Test/Fixme.pm line 239:
113 # By default run_tests will search for 'FIXME' in all the files it can
114 # Pattern found at ./lib/Test/Fixme.pm line 280:
115 # Do not fail when a FIXME or other pattern is matched. Tests that would
116 # Pattern found at ./lib/Test/Fixme.pm line 288:
117 # If you want to match something other than 'FIXME' then you may find
118 # Pattern found at ./lib/Test/Fixme.pm line 296:
119 # run_tests( skip_all => $ENV{SKIP_TEST_FIXME} );
120 # Pattern found at ./lib/Test/Fixme.pm line 303:
121 # L<Devel::FIXME>
122
123 For files that contain many offending patterns it may be a bit
124 harder to read for humans, but easier to parse for IDEs.
125
126 You may also use the "TEST_FIXME_FORMAT" environment variable to
127 override either the default or the value specified in the test
128 file.
129
131 If you want to match something other than 'FIXME' then you may find
132 that the test file itself is being caught. Try doing this:
133
134 run_tests( match => 'TO'.'DO' );
135
136 You may also wish to suppress the tests - try this:
137
138 use Test::Fixme;
139 run_tests( skip_all => $ENV{SKIP_TEST_FIXME} );
140
141 You can only run run_tests once per file. Please use several test files
142 if you want to run several different tests.
143
145 This module is fully supported back to Perl 5.8.1. It may work on
146 5.8.0. It should work on Perl 5.6.x and I may even test on 5.6.2. I
147 will accept patches to maintain compatibility for such older Perls, but
148 you may need to fix it on 5.6.x / 5.8.0 and send me a patch.
149
151 Devel::FIXME
152
154 Dave O'Neill added support for 'filename_match' and also being able to
155 pass a list of several directories in the 'where' argument. Many
156 thanks.
157
159 Original author: Edmund von der Burg
160
161 Current maintainer: Graham Ollis <plicease@cpan.org>
162
163 Contributors:
164
165 Dave O'Neill
166
167 gregor herrmann <gregoa@debian.org>
168
170 This software is copyright (c) 2016 by Edmund von der Burg
171 <evdb@ecclestoad.co.uk>, Graham Ollis <plicease@cpan.org>.
172
173 This is free software; you can redistribute it and/or modify it under
174 the same terms as the Perl 5 programming language system itself.
175
176
177
178perl v5.36.0 2023-01-20 Test::Fixme(3)