Test-NoBreakpoints-0.17/0000755000175000017500000000000014015340272014400 5ustar blaineblaineTest-NoBreakpoints-0.17/LICENSE0000644000175000017500000004375714015232437015430 0ustar blaineblaineThis software is copyright (c) 2012 by James FitzGibbon and Chisel Wright. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. Terms of the Perl programming language system itself a) the GNU General Public License as published by the Free Software Foundation; either version 1, or (at your option) any later version, or b) the "Artistic License" --- The GNU General Public License, Version 1, February 1989 --- This software is Copyright (c) 2012 by James FitzGibbon and Chisel Wright. This is free software, licensed under: The GNU General Public License, Version 1, February 1989 GNU GENERAL PUBLIC LICENSE Version 1, February 1989 Copyright (C) 1989 Free Software Foundation, Inc. 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The license agreements of most software companies try to keep users at the mercy of those companies. By contrast, our General Public License is intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. The General Public License applies to the Free Software Foundation's software and to any other program whose authors commit to using it. You can use it for your programs, too. When we speak of free software, we are referring to freedom, not price. Specifically, the General Public License is designed to make sure that you have the freedom to give away or sell copies of free software, that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things. To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the software, or if you modify it. For example, if you distribute copies of a such a program, whether gratis or for a fee, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the source code. And you must tell them their rights. We protect your rights with two steps: (1) copyright the software, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the software. Also, for each author's protection and ours, we want to make certain that everyone understands that there is no warranty for this free software. If the software is modified by someone else and passed on, we want its recipients to know that what they have is not the original, so that any problems introduced by others will not reflect on the original authors' reputations. The precise terms and conditions for copying, distribution and modification follow. GNU GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License Agreement applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License. The "Program", below, refers to any such program or work, and a "work based on the Program" means either the Program or any work containing the Program or a portion of it, either verbatim or with modifications. Each licensee is addressed as "you". 1. You may copy and distribute verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this General Public License and to the absence of any warranty; and give any other recipients of the Program a copy of this General Public License along with the Program. You may charge a fee for the physical act of transferring a copy. 2. You may modify your copy or copies of the Program or any portion of it, and copy and distribute such modifications under the terms of Paragraph 1 above, provided that you also do the following: a) cause the modified files to carry prominent notices stating that you changed the files and the date of any change; and b) cause the whole of any work that you distribute or publish, that in whole or in part contains the Program or any part thereof, either with or without modifications, to be licensed at no charge to all third parties under the terms of this General Public License (except that you may choose to grant warranty protection to some or all third parties, at your option). c) If the modified program normally reads commands interactively when run, you must cause it, when started running for such interactive use in the simplest and most usual way, to print or display an announcement including an appropriate copyright notice and a notice that there is no warranty (or else, saying that you provide a warranty) and that users may redistribute the program under these conditions, and telling the user how to view a copy of this General Public License. d) You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. Mere aggregation of another independent work with the Program (or its derivative) on a volume of a storage or distribution medium does not bring the other work under the scope of these terms. 3. You may copy and distribute the Program (or a portion or derivative of it, under Paragraph 2) in object code or executable form under the terms of Paragraphs 1 and 2 above provided that you also do one of the following: a) accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Paragraphs 1 and 2 above; or, b) accompany it with a written offer, valid for at least three years, to give any third party free (except for a nominal charge for the cost of distribution) a complete machine-readable copy of the corresponding source code, to be distributed under the terms of Paragraphs 1 and 2 above; or, c) accompany it with the information you received as to where the corresponding source code may be obtained. (This alternative is allowed only for noncommercial distribution and only if you received the program in object code or executable form alone.) Source code for a work means the preferred form of the work for making modifications to it. For an executable file, complete source code means all the source code for all modules it contains; but, as a special exception, it need not include source code for modules which are standard libraries that accompany the operating system on which the executable file runs, or for standard header files or definitions files that accompany that operating system. 4. You may not copy, modify, sublicense, distribute or transfer the Program except as expressly provided under this General Public License. Any attempt otherwise to copy, modify, sublicense, distribute or transfer the Program is void, and will automatically terminate your rights to use the Program under this License. However, parties who have received copies, or rights to use copies, from you under this General Public License will not have their licenses terminated so long as such parties remain in full compliance. 5. By copying, distributing or modifying the Program (or any work based on the Program) you indicate your acceptance of this license to do so, and all its terms and conditions. 6. Each time you redistribute the Program (or any work based on the Program), the recipient automatically receives a license from the original licensor to copy, distribute or modify the Program subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. 7. The Free Software Foundation may publish revised and/or new versions of the General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Program specifies a version number of the license which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of the license, you may choose any version ever published by the Free Software Foundation. 8. If you wish to incorporate parts of the Program into other free programs whose distribution conditions are different, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 9. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 10. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS Appendix: How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest possible use to humanity, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) 19yy This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 1, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301 USA Also add information on how to contact you by electronic and paper mail. If the program is interactive, make it output a short notice like this when it starts in an interactive mode: Gnomovision version 69, Copyright (C) 19xx name of author Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, the commands you use may be called something other than `show w' and `show c'; they could even be mouse-clicks or menu items--whatever suits your program. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the program, if necessary. Here a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the program `Gnomovision' (a program to direct compilers to make passes at assemblers) written by James Hacker. , 1 April 1989 Ty Coon, President of Vice That's all there is to it! --- The Artistic License 1.0 --- This software is Copyright (c) 2012 by James FitzGibbon and Chisel Wright. This is free software, licensed under: The Artistic License 1.0 The Artistic License Preamble The intent of this document is to state the conditions under which a Package may be copied, such that the Copyright Holder maintains some semblance of artistic control over the development of the package, while giving the users of the package the right to use and distribute the Package in a more-or-less customary fashion, plus the right to make reasonable modifications. Definitions: - "Package" refers to the collection of files distributed by the Copyright Holder, and derivatives of that collection of files created through textual modification. - "Standard Version" refers to such a Package if it has not been modified, or has been modified in accordance with the wishes of the Copyright Holder. - "Copyright Holder" is whoever is named in the copyright or copyrights for the package. - "You" is you, if you're thinking about copying or distributing this Package. - "Reasonable copying fee" is whatever you can justify on the basis of media cost, duplication charges, time of people involved, and so on. (You will not be required to justify it to the Copyright Holder, but only to the computing community at large as a market that must bear the fee.) - "Freely Available" means that no fee is charged for the item itself, though there may be fees involved in handling the item. It also means that recipients of the item may redistribute it under the same conditions they received it. 1. You may make and give away verbatim copies of the source form of the Standard Version of this Package without restriction, provided that you duplicate all of the original copyright notices and associated disclaimers. 2. You may apply bug fixes, portability fixes and other modifications derived from the Public Domain or from the Copyright Holder. A Package modified in such a way shall still be considered the Standard Version. 3. You may otherwise modify your copy of this Package in any way, provided that you insert a prominent notice in each changed file stating how and when you changed that file, and provided that you do at least ONE of the following: a) place your modifications in the Public Domain or otherwise make them Freely Available, such as by posting said modifications to Usenet or an equivalent medium, or placing the modifications on a major archive site such as ftp.uu.net, or by allowing the Copyright Holder to include your modifications in the Standard Version of the Package. b) use the modified Package only within your corporation or organization. c) rename any non-standard executables so the names do not conflict with standard executables, which must also be provided, and provide a separate manual page for each non-standard executable that clearly documents how it differs from the Standard Version. d) make other distribution arrangements with the Copyright Holder. 4. You may distribute the programs of this Package in object code or executable form, provided that you do at least ONE of the following: a) distribute a Standard Version of the executables and library files, together with instructions (in the manual page or equivalent) on where to get the Standard Version. b) accompany the distribution with the machine-readable source of the Package with your modifications. c) accompany any non-standard executables with their corresponding Standard Version executables, giving the non-standard executables non-standard names, and clearly documenting the differences in manual pages (or equivalent), together with instructions on where to get the Standard Version. d) make other distribution arrangements with the Copyright Holder. 5. You may charge a reasonable copying fee for any distribution of this Package. You may charge any fee you choose for support of this Package. You may not charge a fee for this Package itself. However, you may distribute this Package in aggregate with other (possibly commercial) programs as part of a larger (possibly commercial) software distribution provided that you do not advertise this Package as a product of your own. 6. The scripts and library files supplied as input to or produced as output from the programs of this Package do not automatically fall under the copyright of this Package, but belong to whomever generated them, and may be sold commercially, and may be aggregated with this Package. 7. C or perl subroutines supplied by you and linked into this Package shall not be considered part of this Package. 8. The name of the Copyright Holder may not be used to endorse or promote products derived from this software without specific prior written permission. 9. THIS PACKAGE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. The End Test-NoBreakpoints-0.17/Changes0000644000175000017500000000332314015340202015665 0ustar blaineblaineRevision history for Test-NoBreakpoints 0.17 2021-02-23 - Remove Test::Exception and fix test plan increment - Fix Changes file layout 0.16 2021-02-23 - Convert build to ExtUtils::MakeMaker 0.15 2012-02-16 - fix RT#75059 - Fix tests to not exclude author only tests when it isn't appropriate to do so (e.g. file finds / counts) 0.14 2012-01-04 - apply patch from https://rt.cpan.org/Ticket/Display.html?id=53609 - Remove deprecated methods - Convert to Dist::Zilla - Make tests pass under 'dzil smoke' - Make tests pass under 'dzil test' and 'prove' 0.13 2005-01-13 - change 'brkpts' to 'breakpoints' on the advice of Andy Lester The old names still exist, but will emit warnings unless supressed using the warnings pragma. The old names will be removed after two releases or a reasonable period of time, whichever is longer. 0.12 2004-12-30 - require v0.09 of Test::Tester. Should fix the blow-up reported in cpantesters report #176356. 0.11 2004-12-27 - Fix $VERSION to be interpreted as a string. - make t/baz/foo.t a usable do-nothing test script - it seems that some versions of EU::MM recurse into the t directory, trying to find all.t files. Should fix the problem in cpantesters failure report #170736. - re-steal^H^H^H^H^Hborrow all_pod_files() from a newer version of Test::Pod in an attempt to make it more robust and fix the problem reported in cpantesters failure reports #170633 and #120973. - Switch from Test::Builder::Tester to Test::Tester, which has a less arcane syntax and isn't as bothered about newline differences. 0.10 2004-01-28 - Initial release to CPAN Test-NoBreakpoints-0.17/MANIFEST0000644000175000017500000000072114015340272015531 0ustar blaineblaineChanges LICENSE MANIFEST META.yml Makefile.PL lib/Test/NoBreakpoints.pm README t/00-load.t t/01_use.t t/02_pod.t t/04_all_perl_files.t t/05_no_breakpoints_ok.t t/06_all_files_no_breakpoints_ok.t t/bar1 t/bar2 t/bar3 t/bar4 t/bar5 t/bar6 t/baz/foo.t t/baz/gzonk/foo.pl t/baz/quux/Foo.pm t/foo t/release-kwalitee.t t/release-no-tabs.t t/release-pod-coverage.t t/release-pod-syntax.t META.json Module JSON meta-data (added by MakeMaker) Test-NoBreakpoints-0.17/t/0000755000175000017500000000000014015340272014643 5ustar blaineblaineTest-NoBreakpoints-0.17/t/02_pod.t0000644000175000017500000000020114014760103016102 0ustar blaineblaineuse Test::More; eval "use Test::Pod 1.00"; plan skip_all => "Test::Pod 1.00 required for testing POD" if $@; all_pod_files_ok(); Test-NoBreakpoints-0.17/t/bar50000644000175000017500000000002114014760103015406 0ustar blaineblaine$DB::single = 1; Test-NoBreakpoints-0.17/t/release-kwalitee.t0000644000175000017500000000052014015232437020253 0ustar blaineblaine BEGIN { use Test::More; unless ($ENV{RELEASE_TESTING}) { plan skip_all => 'Release test. Set $ENV{RELEASE_TESTING} to a true value to run.'; } } use strict; use warnings; eval "use Test::Kwalitee 'kwalitee_ok'"; plan skip_all => "Test::Kwalitee required for testing kwalitee" if $@; kwalitee_ok(); done_testing; Test-NoBreakpoints-0.17/t/06_all_files_no_breakpoints_ok.t0000644000175000017500000000434714014760103023063 0ustar blaineblaineBEGIN { use Test::Tester 0.09; use Test::More; our $tests = 46; eval "use Test::NoWarnings"; $tests++ unless( $@ ); plan tests => $tests; chdir 't' if -d 't'; use lib '../lib', '../blib/lib'; } use Test::NoBreakpoints ':all'; my $checklist = [ { ok => 1, depth => 2, name => 'no breakpoint test of ./00-load.t', }, { ok => 1, depth => 2, name => 'no breakpoint test of ./01_use.t', }, { ok => 1, depth => 2, name => 'no breakpoint test of ./02_pod.t', }, { ok => 1, depth => 2, name => 'no breakpoint test of ./04_all_perl_files.t', }, { ok => 0, depth => 2, name => 'no breakpoint test of ./05_no_breakpoints_ok.t', diag => 'breakpoint found in ./05_no_breakpoints_ok.t: $DB::signal =1' . "\n", }, { ok => 0, depth => 2, name => 'no breakpoint test of ./06_all_files_no_breakpoints_ok.t', diag => 'breakpoint found in ./06_all_files_no_breakpoints_ok.t: $DB::signal =1' . "\n", }, { ok => 0, depth => 2, name => 'no breakpoint test of ./baz/foo.t', diag => 'breakpoint found in ./baz/foo.t: $DB::signal = 1' . "\n", }, { ok => 0, depth => 2, name => 'no breakpoint test of ./baz/gzonk/foo.pl', diag => 'breakpoint found in ./baz/gzonk/foo.pl: $DB::single = 2' . "\n", }, { ok => 1, depth => 2, name => 'no breakpoint test of ./baz/quux/Foo.pm', }, { ok => 1, depth => 2, name => 'no breakpoint test of ./release-kwalitee.t', }, { ok => 1, depth => 2, name => 'no breakpoint test of ./release-no-tabs.t', }, { ok => 1, depth => 2, name => 'no breakpoint test of ./release-pod-coverage.t', }, { ok => 1, depth => 2, name => 'no breakpoint test of ./release-pod-syntax.t', }, ]; # test the tester for failure check_tests( sub { all_files_no_breakpoints_ok( sort(all_perl_files('.')) ) }, $checklist, 'all_files_no_breakpoints_ok finds correct breakpoints', ); Test-NoBreakpoints-0.17/t/release-pod-coverage.t0000644000175000017500000000074414015232437021031 0ustar blaineblaine BEGIN { use Test::More; unless ($ENV{RELEASE_TESTING}) { plan skip_all => 'Release test. Set $ENV{RELEASE_TESTING} to a true value to run.'; } } use strict; use warnings; eval "use Test::Pod::Coverage"; plan skip_all => "Test::Pod::Coverage required to criticise code" if $@; eval "use Pod::Coverage::TrustPod"; plan skip_all => "Pod::Coverage::TrustPod required to criticise code" if $@; all_pod_coverage_ok({ coverage_class => 'Pod::Coverage::TrustPod' }); Test-NoBreakpoints-0.17/t/release-no-tabs.t0000644000175000017500000000146614015232437020023 0ustar blaineblaine BEGIN { use Test::More; unless ($ENV{RELEASE_TESTING}) { plan skip_all => 'Release test. Set $ENV{RELEASE_TESTING} to a true value to run.'; } } use strict; use warnings; eval "use Test::NoTabs"; plan skip_all => "Test::NoTabs required for testing tabs" if $@; my @files = ( 'lib/Test/NoBreakpoints.pm', 't/00-load.t', 't/01_use.t', 't/02_pod.t', 't/04_all_perl_files.t', 't/05_no_breakpoints_ok.t', 't/06_all_files_no_breakpoints_ok.t', 't/bar1', 't/bar2', 't/bar3', 't/bar4', 't/bar5', 't/bar6', 't/baz/foo.t', 't/baz/gzonk/foo.pl', 't/baz/quux/Foo.pm', 't/foo', 't/release-kwalitee.t', 't/release-no-tabs.t', 't/release-pod-coverage.t', 't/release-pod-syntax.t', ); notabs_ok($_) foreach @files; done_testing; Test-NoBreakpoints-0.17/t/05_no_breakpoints_ok.t0000644000175000017500000000227014014760103021041 0ustar blaineblaineBEGIN { use Test::Tester 0.09; use Test::More; our $tests = 54; eval "use Test::NoWarnings"; $tests++ unless( $@ ); plan tests => $tests; chdir 't' if -d 't'; use lib '../lib', '../blib/lib'; } use Test::NoBreakpoints; # test the tester for success check_test( sub { no_breakpoints_ok('foo') }, { ok => 1, name => 'no breakpoint test of foo', }, 'no_breakpoints_ok works with implicit name', ); check_test( sub { no_breakpoints_ok('foo', 'yes, we have no breakpoints!') }, { ok => 1, name => 'yes, we have no breakpoints!', }, 'no_breakpoints_ok works with explicit name', ); # test the tester for failure my @expected = ( '$DB::signal =1', q{$DB'single=4}, '$DB::signal= 1', '$DB::single = 3', '$DB::single = 1', q|$DB::single = 1|, ); for my $file( qw|bar1 bar2 bar3 bar4 bar5 bar6| ) { check_test( sub { no_breakpoints_ok($file) }, { ok => 0, name => "no breakpoint test of $file", diag => "breakpoint found in $file: " . shift(@expected) . "\n", }, 'no_breakpoints_ok finds simple breakpoint', ); } Test-NoBreakpoints-0.17/t/bar30000644000175000017500000000001714014760103015411 0ustar blaineblaine$DB::signal= 1 Test-NoBreakpoints-0.17/t/bar60000644000175000017500000000002114014760103015407 0ustar blaineblaine$DB::single = 1; Test-NoBreakpoints-0.17/t/04_all_perl_files.t0000644000175000017500000000135514015335644020322 0ustar blaineblaineBEGIN { use Test::More; our $tests = 1; eval "use Test::NoWarnings"; $tests++ unless( $@ ); plan tests => $tests; chdir 't' if -d 't'; use lib '../lib', '../blib/lib'; } use Test::NoBreakpoints 'all_perl_files'; # test that all files in the test directory are found properly my @tests = qw| ./00-load.t ./01_use.t ./02_pod.t ./04_all_perl_files.t ./05_no_breakpoints_ok.t ./06_all_files_no_breakpoints_ok.t ./baz/foo.t ./baz/gzonk/foo.pl ./baz/quux/Foo.pm ./release-no-tabs.t ./release-kwalitee.t ./release-pod-coverage.t ./release-pod-syntax.t |; my @expected = sort @tests; my @gotback = sort( all_perl_files('.') ); is_deeply(\@gotback, \@expected, 'all perl files found'); Test-NoBreakpoints-0.17/t/release-pod-syntax.t0000644000175000017500000000054414015232437020562 0ustar blaineblaine BEGIN { use Test::More; unless ($ENV{RELEASE_TESTING}) { plan skip_all => 'Release test. Set $ENV{RELEASE_TESTING} to a true value to run.'; } } use strict; use warnings; use FindBin; eval "use Test::Pod"; plan skip_all => "Test::Pod required to criticise code" if $@; all_pod_files_ok( all_pod_files("$FindBin::RealBin/../lib") ); Test-NoBreakpoints-0.17/t/baz/0000755000175000017500000000000014015340272015417 5ustar blaineblaineTest-NoBreakpoints-0.17/t/baz/gzonk/0000755000175000017500000000000014015340272016547 5ustar blaineblaineTest-NoBreakpoints-0.17/t/baz/gzonk/foo.pl0000644000175000017500000000007514014760103017667 0ustar blaineblaineA pseudo-script with a breakpoint on line 2 $DB::single = 2; Test-NoBreakpoints-0.17/t/baz/foo.t0000644000175000017500000000016014014760103016362 0ustar blaineblaine# A sample file with a breakpoint on line 3 $DB::signal = 1; use Test::More skip_all => 'just a placeholder'; Test-NoBreakpoints-0.17/t/baz/quux/0000755000175000017500000000000014015340272016421 5ustar blaineblaineTest-NoBreakpoints-0.17/t/baz/quux/Foo.pm0000644000175000017500000000005514014760103017500 0ustar blaineblainea pseudo-package without a breakpoint in it. Test-NoBreakpoints-0.17/t/foo0000644000175000017500000000005314014760103015345 0ustar blaineblainea sample file that has no soft breakpoints Test-NoBreakpoints-0.17/t/bar20000644000175000017500000000001514014760103015406 0ustar blaineblaine$DB'single=4 Test-NoBreakpoints-0.17/t/00-load.t0000644000175000017500000000007714015232437016173 0ustar blaineblaineuse strict; use Test::UseAllModules; BEGIN { all_uses_ok(); } Test-NoBreakpoints-0.17/t/01_use.t0000644000175000017500000000052614015232437016132 0ustar blaineblaineuse strict; use warnings; BEGIN { use Test::More; our $tests = 1; eval "use Test::NoWarnings"; $tests++ unless ($@); plan tests => $tests; } use_ok('Test::NoBreakpoints'); local $Test::NoBreakpoints::VERSION = $Test::NoBreakpoints::VERSION || 'from repo'; note("List::Uniq $Test::NoBreakpoints::VERSION, Perl $], $^X"); Test-NoBreakpoints-0.17/t/bar40000644000175000017500000000002114014760103015405 0ustar blaineblaine$DB::single = 3; Test-NoBreakpoints-0.17/t/bar10000644000175000017500000000001714014760103015407 0ustar blaineblaine$DB::signal =1 Test-NoBreakpoints-0.17/lib/0000755000175000017500000000000014015340272015146 5ustar blaineblaineTest-NoBreakpoints-0.17/lib/Test/0000755000175000017500000000000014015340272016065 5ustar blaineblaineTest-NoBreakpoints-0.17/lib/Test/NoBreakpoints.pm0000644000175000017500000001737414015336264021223 0ustar blaineblaine=head1 NAME Test::NoBreakpoints - test that files do not contain soft breakpoints =head1 SYNOPSIS use Test::NoBreakpoints; plan tests => $num_tests; no_breakpoints_ok( $file, 'Contains no soft breakpoints' ); Module authors can include the following in a t/nobreakpoints.t file to add such checking to a module distribution: use Test::More; eval "use Test::NoBreakpoints 0.10"; plan skip_all => "Test::NoBreakpoints 0.10 required for testing" if $@; all_files_no_breakpoints_ok(); =head1 DESCRIPTION I love soft breakpoints (C<$DB::single = 1>) in the Perl debugger. Unfortunately, I have a habit of putting them in my code during development and forgetting to take them out before I upload it to CPAN, necessitating a hasty fix/package/bundle cycle followed by much cursing. Test::NoBreakpoints checks that files contain neither the string C<$DB::single = 1> nor C<$DB::signal = 1>. By adding such a test to all my modules, I swear less and presumably lighten the load on the CPAN in some small way. =cut package Test::NoBreakpoints; use strict; use File::Spec; use File::Find; use Test::Builder; require Exporter; use vars qw($VERSION @ISA @EXPORT @EXPORT_OK %EXPORT_TAGS); $VERSION = '0.17'; @ISA = 'Exporter'; @EXPORT = qw| all_files_no_breakpoints_ok all_files_no_brkpts_ok no_breakpoints_ok no_brkpts_ok |; @EXPORT_OK = qw|all_perl_files|; %EXPORT_TAGS = ( all => [ @EXPORT, @EXPORT_OK ], ); # get a Test singleton to use my $Test = Test::Builder->new; # a regular expression to find soft breakpoints my $brkpt_rx = qr/ ( # match it \$DB # The DB package (?:::|') # Perl 4 or 5 package seperator si(?:ngle|gnal) # signal or single \s*=\s* # an equal with optional whitespace [1-9] # a digit other than zero # (am I being stupid here? Is there ) # no easier way to say that?) /x; # check that there are no breakpoints in a file sub no_breakpoints_ok($;$) { my($file, $name) = @_; $name ||= "no breakpoint test of $file"; # slurp in the file my $fh; unless( open($fh, $file) ) { $Test->ok(0, $name); $Test->diag("could not open $file: $!"); return; } my $text = do { local( $/ ) ; <$fh> } ; close($fh); # check the file against our regex my($matched) = $text =~ m/$brkpt_rx/; if( ! $matched ) { $Test->ok(1, $name); } else { $Test->ok(0, $name); $Test->diag("breakpoint found in $file: $matched"); } return $matched ? 0 : 1; } # find all perl files in a given directory # graciously borrwed from Test::Pod::all_pod_files by # Andy Lester / brian d foy sub all_perl_files { my @queue = @_ ? @_ : _starting_points(); my @files = (); while ( @queue ) { my $file = shift @queue; if ( -d $file ) { local *DH; opendir DH, $file or next; my @newfiles = readdir DH; closedir DH; @newfiles = File::Spec->no_upwards( @newfiles ); @newfiles = grep { $_ ne "CVS" && $_ ne ".svn" } @newfiles; push @queue, map "$file/$_", @newfiles; } if ( -f $file ) { push @files, $file if _is_perl( $file ); } } # while return @files; } sub _starting_points { return 'blib' if -e 'blib'; return 'lib'; } sub _is_perl { my $file = shift; return 1 if $file =~ /\.PL$/; return 1 if $file =~ /\.p(l|m)$/; return 1 if $file =~ /\.t$/; local *FH; open FH, $file or return; my $first = ; close FH; return 1 if defined $first && ($first =~ /^#!.*perl/); return; } # run no_breakpoints_ok on all files in a given directory sub all_files_no_breakpoints_ok { my @files = @_ ? @_ : all_perl_files(); my $ok = 1; # presume all succeed for( @files ) { no_breakpoints_ok($_) or $ok = 0; } return $ok; } # keep require happy 1; __END__ =head1 FUNCTIONS Unless otherwise noted, all functions are tests built on top of Test::Builder, so the standard admonition about having made a plan before you run them apply. =head2 no_breakpoints_ok($file, [$description] ) Checks that $file contains no breakpoints. If the optional $description is not passed it defaults to "no breakpoint test of $file". If the test fails, the line number of the file where the breakpoint was found will be emitted. For compatibility with old versions of this module, the deprecated name C may also be used (but see L). =head2 all_perl_files( [@dirs] ) Returns a list of all F<*.pl>, F<*.pm> and F<*.t> files in the directories listed. If C<@dirs> is not passed, defaults to C and C. The order of the files returned is machine-dependent. If you want them sorted, you'll have to sort them yourself. =head2 all_files_no_breakpoints_ok( [@files] ) Checks all files that look like they contain Perl using no_breakpoints_ok(). If C<@files> is not provided, it defaults to the return of B. For compatibility with old versions of this module, the deprecated name C may also be used (but see L). =head1 EXPORTS By default B and B. For the time being, the deprecated forms the above (B and B) are also exported (but see L). On request, B. Everything with the tag B<:all>. =head1 DEPRECATED FUNCTIONS Prior to v0.13 of this module, no_breakpoints_ok was called no_brkpts_ok and all_files_no_breakpoints_ok was similarly abbreviated. In v0.13, these older names were deprecated. They are still exported by default, but will emit a warning unless you disable the B lexical warning category: { no warnings 'deprecated'; no_brkpts_ok(...); } In the next release, the deprecated functions will have to be pulled in via an import tag. In the release after that, they will cease to be. =head1 ACKNOWLEDGEMENTS Michael Schwern for Test::Builder. Andy Lester for Test::Pod, which is where I got the idea and borrowed the logic of B from. =head1 BUGS =over 4 =item * doesn't catch some breakpoints This is a valid breakpoint: package DB; $single = 1; package main; as is this: my $break = \$DB::single; $$break = 1; but neither are currently caught. =back =head1 TODO =over 4 =item * enhance regex to find esoteric setting of breakpoints If you have a legitimate breakpoint set that isn't caught, please send me an example and I'll try to augment the regex to match it. =item * only look at code rather than the entire file This is not as easy as simply stripping out POD, because there might be inline tests or examples that are code in there (using Test::Inline). Granted, those should be caught when the generated .t files are themselves tested, but I'd like to make it smarter. =item * not use regular expressions The ideal way to find a breakpoint would be to compile the code and then walk the opcode tree to find places where the breakpoint is set. B::FindAmpersand does something similar to this to find use of the C<$&> in regular expressions, so this is probably the direction I'm going to head in. =back =head1 SEE ALSO L L =head1 AUTHORS =over 4 =item * James FitzGibbon =item * Apocalypse =item * Chisel =back =head1 COPYRIGHT AND LICENSE This software is copyright (c) 2012 by James FitzGibbon and Chisel Wright. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. =cut Test-NoBreakpoints-0.17/Makefile.PL0000644000175000017500000000257514015232437016366 0ustar blaineblaineuse ExtUtils::MakeMaker; WriteMakefile( NAME => 'Test::NoBreakpoints', DISTNAME => 'Test-NoBreakpoints', ABSTRACT_FROM => 'lib/Test/NoBreakpoints.pm', VERSION_FROM => 'lib/Test/NoBreakpoints.pm', BUILD_REQUIRES => { 'ExtUtils::MakeMaker' => '6.52', }, CONFIGURE_REQUIRES => { 'ExtUtils::MakeMaker' => '6.52', }, PREREQ_PM => { 'Exporter' => 0, 'File::Find' => 0, 'File::Spec' => 0, 'Test::Builder' => 0, 'strict' => 0, 'vars' => 0, }, TEST_REQUIRES => { 'Test::More' => '0.92', 'Test::Tester' => '0.09', 'File::Find' => 0, 'Test::UseAllModules' => 0, 'lib' => 0, 'warnings' => 0, }, test => { 'TESTS' => 't/*.t t/baz/*.t', }, META_MERGE => { 'meta-spec' => { version => 2 }, resources => { bugtracker => { web => 'http://github.com/renderorange/Test-NoBreakpoints/issues', }, repository => { type => 'git', url => 'git://github.com/renderorange/Test-NoBreakpoints.git', web => 'https://github.com/renderorange/Test-NoBreakpoints', }, }, }, LICENSE => 'perl', AUTHOR => "James FitzGibbon , Apocalypse , Chisel ", ); Test-NoBreakpoints-0.17/README0000644000175000017500000001161314015232437015265 0ustar blaineblaineNAME Test::NoBreakpoints - test that files do not contain soft breakpoints SYNOPSIS use Test::NoBreakpoints; plan tests => $num_tests; no_breakpoints_ok( $file, 'Contains no soft breakpoints' ); Module authors can include the following in a t/nobreakpoints.t file to add such checking to a module distribution: use Test::More; eval "use Test::NoBreakpoints 0.10"; plan skip_all => "Test::NoBreakpoints 0.10 required for testing" if $@; all_files_no_breakpoints_ok(); DESCRIPTION I love soft breakpoints ("$DB::single = 1") in the Perl debugger. Unfortunately, I have a habit of putting them in my code during development and forgetting to take them out before I upload it to CPAN, necessitating a hasty fix/package/bundle cycle followed by much cursing. Test::NoBreakpoints checks that files contain neither the string "$DB::single = 1" nor "$DB::signal = 1". By adding such a test to all my modules, I swear less and presumably lighten the load on the CPAN in some small way. FUNCTIONS Unless otherwise noted, all functions are tests built on top of Test::Builder, so the standard admonition about having made a plan before you run them apply. no_breakpoints_ok($file, [$description] ) Checks that $file contains no breakpoints. If the optional $description is not passed it defaults to "no breakpoint test of $file". If the test fails, the line number of the file where the breakpoint was found will be emitted. For compatibility with old versions of this module, the deprecated name "no_brkpts_ok" may also be used (but see "DEPRECATED FUNCTIONS"). all_perl_files( [@dirs] ) Returns a list of all *.pl, *.pm and *.t files in the directories listed. If @dirs is not passed, defaults to "blib" and "t". The order of the files returned is machine-dependent. If you want them sorted, you'll have to sort them yourself. all_files_no_breakpoints_ok( [@files] ) Checks all files that look like they contain Perl using no_breakpoints_ok(). If @files is not provided, it defaults to the return of all_perl_files(). For compatibility with old versions of this module, the deprecated name "all_files_no_brkpts_ok" may also be used (but see "DEPRECATED FUNCTIONS"). EXPORTS By default all_files_no_breakpoints_ok and no_breakpoints_ok. For the time being, the deprecated forms the above (all_files_no_brkpts_ok and no_brkpts_ok) are also exported (but see "DEPRECATED FUNCTIONS"). On request, all_perl_files. Everything with the tag :all. DEPRECATED FUNCTIONS Prior to v0.13 of this module, no_breakpoints_ok was called no_brkpts_ok and all_files_no_breakpoints_ok was similarly abbreviated. In v0.13, these older names were deprecated. They are still exported by default, but will emit a warning unless you disable the deprecated lexical warning category: { no warnings 'deprecated'; no_brkpts_ok(...); } In the next release, the deprecated functions will have to be pulled in via an import tag. In the release after that, they will cease to be. ACKNOWLEDGEMENTS Michael Schwern for Test::Builder. Andy Lester for Test::Pod, which is where I got the idea and borrowed the logic of all_perl_files from. BUGS * doesn't catch some breakpoints This is a valid breakpoint: package DB; $single = 1; package main; as is this: my $break = \$DB::single; $$break = 1; but neither are currently caught. TODO * enhance regex to find esoteric setting of breakpoints If you have a legitimate breakpoint set that isn't caught, please send me an example and I'll try to augment the regex to match it. * only look at code rather than the entire file This is not as easy as simply stripping out POD, because there might be inline tests or examples that are code in there (using Test::Inline). Granted, those should be caught when the generated .t files are themselves tested, but I'd like to make it smarter. * not use regular expressions The ideal way to find a breakpoint would be to compile the code and then walk the opcode tree to find places where the breakpoint is set. B::FindAmpersand does something similar to this to find use of the $& in regular expressions, so this is probably the direction I'm going to head in. SEE ALSO Test::Builder Test::Pod AUTHORS * James FitzGibbon * Apocalypse * Chisel COPYRIGHT AND LICENSE This software is copyright (c) 2012 by James FitzGibbon and Chisel Wright. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. Test-NoBreakpoints-0.17/META.json0000644000175000017500000000335014015340272016022 0ustar blaineblaine{ "abstract" : "test that files do not contain soft breakpoints", "author" : [ "James FitzGibbon , Apocalypse , Chisel " ], "dynamic_config" : 1, "generated_by" : "ExtUtils::MakeMaker version 7.56, CPAN::Meta::Converter version 2.150010", "license" : [ "perl_5" ], "meta-spec" : { "url" : "http://search.cpan.org/perldoc?CPAN::Meta::Spec", "version" : 2 }, "name" : "Test-NoBreakpoints", "no_index" : { "directory" : [ "t", "inc" ] }, "prereqs" : { "build" : { "requires" : { "ExtUtils::MakeMaker" : "6.52" } }, "configure" : { "requires" : { "ExtUtils::MakeMaker" : "6.52" } }, "runtime" : { "requires" : { "Exporter" : "0", "File::Find" : "0", "File::Spec" : "0", "Test::Builder" : "0", "strict" : "0", "vars" : "0" } }, "test" : { "requires" : { "File::Find" : "0", "Test::More" : "0.92", "Test::Tester" : "0.09", "Test::UseAllModules" : "0", "lib" : "0", "warnings" : "0" } } }, "release_status" : "stable", "resources" : { "bugtracker" : { "web" : "http://github.com/renderorange/Test-NoBreakpoints/issues" }, "repository" : { "type" : "git", "url" : "git://github.com/renderorange/Test-NoBreakpoints.git", "web" : "https://github.com/renderorange/Test-NoBreakpoints" } }, "version" : "0.17", "x_serialization_backend" : "JSON::PP version 4.02" } Test-NoBreakpoints-0.17/META.yml0000644000175000017500000000174514015340272015660 0ustar blaineblaine--- abstract: 'test that files do not contain soft breakpoints' author: - 'James FitzGibbon , Apocalypse , Chisel ' build_requires: ExtUtils::MakeMaker: '6.52' File::Find: '0' Test::More: '0.92' Test::Tester: '0.09' Test::UseAllModules: '0' lib: '0' warnings: '0' configure_requires: ExtUtils::MakeMaker: '6.52' dynamic_config: 1 generated_by: 'ExtUtils::MakeMaker version 7.56, CPAN::Meta::Converter version 2.150010' license: perl meta-spec: url: http://module-build.sourceforge.net/META-spec-v1.4.html version: '1.4' name: Test-NoBreakpoints no_index: directory: - t - inc requires: Exporter: '0' File::Find: '0' File::Spec: '0' Test::Builder: '0' strict: '0' vars: '0' resources: bugtracker: http://github.com/renderorange/Test-NoBreakpoints/issues repository: git://github.com/renderorange/Test-NoBreakpoints.git version: '0.17' x_serialization_backend: 'CPAN::Meta::YAML version 0.018'