diff -Nru libtest-class-perl-0.50/Changes libtest-class-perl-0.52/Changes --- libtest-class-perl-0.50/Changes 2015-06-07 00:07:24.000000000 +0000 +++ libtest-class-perl-0.52/Changes 2021-02-17 15:38:41.000000000 +0000 @@ -1,5 +1,22 @@ Changes for Perl extension Test-Class +0.52 [2021-02-17] + - Change bugtracker link to point GitHub issues instead of RT. + - Remove some old and broken links. + - Work by (Kaycie Goodman). + - Test fix (Pali, PR#32). + - Fix reporting caller information (file+line) when number of tests does + not match (Pali). + - Use better class names in t/runtests_return.t (Pali). + - Fix documentation to be more accurate regarding support and author + activity (Karen Etheridge). + - Ensure metadata is processed as v2 (Karen Etheridge). + - Remove unnecessary shebangs (Karen Etheridge). + - chmod ugo-x (Karen Etheridge). + +0.51 [2019-04-29] + - Create fail_if_returned_late (Jason Terry, Oaxlin, PR#23) + 0.50 [2015-06-07] - add links to Ovid's tutorial series on Test::Class (Tim Vroom, PR#19) - add links to Test::Class::Most, Test::Class::Moose (Tim Vroom, PR#20) diff -Nru libtest-class-perl-0.50/debian/changelog libtest-class-perl-0.52/debian/changelog --- libtest-class-perl-0.50/debian/changelog 2020-12-29 00:54:44.000000000 +0000 +++ libtest-class-perl-0.52/debian/changelog 2021-02-20 17:46:28.000000000 +0000 @@ -1,3 +1,37 @@ +libtest-class-perl (0.52-1) unstable; urgency=medium + + [ gregor herrmann ] + * debian/copyright: change Copyright-Format 1.0 URL to HTTPS. + * debian/upstream/metadata: change GitHub/CPAN URL(s) to HTTPS. + * Remove Jay Bonci from Uploaders. Thanks for your work! + * Remove Jonathan Yu from Uploaders. Thanks for your work! + + [ Salvatore Bonaccorso ] + * Update Vcs-* headers for switch to salsa.debian.org + + [ Debian Janitor ] + * Trim trailing whitespace. + * Bump debhelper from old 9 to 12. + * Set debhelper-compat version in Build-Depends. + * Set upstream metadata fields: Bug-Database, Repository, Repository- + Browse. + * Remove obsolete fields Contact, Name from debian/upstream/metadata + (already present in machine-readable debian/copyright). + + [ gregor herrmann ] + * debian/watch: use uscan version 4. + * Import upstream version 0.52. + * Update debian/upstream/metadata. + * Refresh test_non_verbose.patch. + * Update years of packaging copyright. + * Update Upstream-Contact in debian/copyright. + * Declare compliance with Debian Policy 4.5.1. + * Set Rules-Requires-Root: no. + * Annotate test-only build dependencies with . + * Bump debhelper-compat to 13. + + -- gregor herrmann Sat, 20 Feb 2021 18:46:28 +0100 + libtest-class-perl (0.50-1.1) unstable; urgency=medium * Non maintainer upload by the Reproducible Builds team. @@ -169,8 +203,8 @@ * Change my email address. [ Salvatore Bonaccorso ] - * New upstream release - * debian/copyright: Update upstream Copyright years + * New upstream release + * debian/copyright: Update upstream Copyright years * Drop 536650-fix-ftbfs.patch patch (fixed upstream). Drop README.source since no patch system is used anymore. Adjust the Build-Depends on debhelper accordingly and drop quild Build-Depends. Adjust debian/rules to @@ -178,8 +212,8 @@ * Try to run all tests. Use override target in debian/rules and bump Build-Depends on debhelper to required version (>= 7.0.50). Add Build-Depends-Indep for requiered modules. - * Bump Standards-Version to 3.8.3 (no changes) - * Drop versioned Build-Depends on perl as allowed by Debian Policy 3.8.3. + * Bump Standards-Version to 3.8.3 (no changes) + * Drop versioned Build-Depends on perl as allowed by Debian Policy 3.8.3. -- Salvatore Bonaccorso Mon, 21 Sep 2009 19:56:58 +0000 @@ -195,7 +229,7 @@ [ Salvatore Bonaccorso ] * debian/control: - - Add Build-Depends on quilt (>= 0.46-7) and adjust versioned + - Add Build-Depends on quilt (>= 0.46-7) and adjust versioned dependency on debhelper. - Bump Standards-Version to 3.8.2 (no changes) - Add myself to Uploaders. @@ -205,7 +239,7 @@ * debian/rules: Use a tiny rules file. * Add debian/README.source to document quilt usage, as required by Debian Policy since 3.8.0. - * Update debian/copyright for debian/* packaging. + * Update debian/copyright for debian/* packaging. [ gregor herrmann ] * debian/control: @@ -310,9 +344,9 @@ * New upstream release * Ack'd NMU, patch now included upstream. Thanks Marc. (Closes: #358745) * Bumped policy version to 3.7.2.2. No other changes - * Changed rules to conditionally ignore make clean errors for lintian + * Changed rules to conditionally ignore make clean errors for lintian * Added a single whitespace line to fix bad manpage whatis lintian warning - + -- Jay Bonci Wed, 04 Jul 2007 19:47:51 -0400 libtest-class-perl (0.11-1.1) unstable; urgency=low diff -Nru libtest-class-perl-0.50/debian/compat libtest-class-perl-0.52/debian/compat --- libtest-class-perl-0.50/debian/compat 2016-05-01 19:06:59.000000000 +0000 +++ libtest-class-perl-0.52/debian/compat 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -9 diff -Nru libtest-class-perl-0.50/debian/control libtest-class-perl-0.52/debian/control --- libtest-class-perl-0.50/debian/control 2016-05-01 19:57:15.000000000 +0000 +++ libtest-class-perl-0.52/debian/control 2021-02-20 17:46:28.000000000 +0000 @@ -1,34 +1,33 @@ Source: libtest-class-perl Maintainer: Debian Perl Group -Uploaders: Jay Bonci , - Damyan Ivanov , - Jonathan Yu , +Uploaders: Damyan Ivanov , gregor herrmann , Ansgar Burchardt , Salvatore Bonaccorso Section: perl Testsuite: autopkgtest-pkg-perl Priority: optional -Build-Depends: debhelper (>= 9) -Build-Depends-Indep: libcontextual-return-perl, - libdevel-symdump-perl, - libmro-compat-perl, - libmodule-runtime-perl, - libtest-exception-perl, - libtry-tiny-perl, +Build-Depends: debhelper-compat (= 13) +Build-Depends-Indep: libcontextual-return-perl , + libdevel-symdump-perl , + libmodule-runtime-perl , + libmro-compat-perl , + libtest-exception-perl , + libtry-tiny-perl , perl -Standards-Version: 3.9.8 -Vcs-Browser: https://anonscm.debian.org/cgit/pkg-perl/packages/libtest-class-perl.git -Vcs-Git: https://anonscm.debian.org/git/pkg-perl/packages/libtest-class-perl.git +Standards-Version: 4.5.1 +Vcs-Browser: https://salsa.debian.org/perl-team/modules/packages/libtest-class-perl +Vcs-Git: https://salsa.debian.org/perl-team/modules/packages/libtest-class-perl.git Homepage: https://metacpan.org/release/Test-Class +Rules-Requires-Root: no Package: libtest-class-perl Architecture: all Depends: ${misc:Depends}, ${perl:Depends}, libcontextual-return-perl, - libmro-compat-perl, libmodule-runtime-perl, + libmro-compat-perl, libtest-exception-perl, libtry-tiny-perl Description: module for creating test classes in an xUnit style diff -Nru libtest-class-perl-0.50/debian/copyright libtest-class-perl-0.52/debian/copyright --- libtest-class-perl-0.50/debian/copyright 2016-05-01 19:06:59.000000000 +0000 +++ libtest-class-perl-0.52/debian/copyright 2021-02-20 17:46:28.000000000 +0000 @@ -1,6 +1,6 @@ -Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ +Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ Upstream-Name: Test-Class -Upstream-Contact: Karen Etheridge +Upstream-Contact: Gábor Szabó Source: https://metacpan.org/release/Test-Class Files: * @@ -17,7 +17,7 @@ 2007, 2008, Gunnar Wolf 2008, Ansgar Burchardt 2008, Damyan Ivanov - 2008-2015, gregor herrmann + 2008-2021, gregor herrmann 2009-2014, Salvatore Bonaccorso 2010, Jonathan Yu License: Artistic or GPL-1+ diff -Nru libtest-class-perl-0.50/debian/patches/test_non_verbose.patch libtest-class-perl-0.52/debian/patches/test_non_verbose.patch --- libtest-class-perl-0.50/debian/patches/test_non_verbose.patch 2016-05-01 19:54:39.000000000 +0000 +++ libtest-class-perl-0.52/debian/patches/test_non_verbose.patch 2021-02-20 17:46:28.000000000 +0000 @@ -15,8 +15,7 @@ # will be seen later. --- a/t/teardown-when-test-dies.t +++ b/t/teardown-when-test-dies.t -@@ -2,6 +2,7 @@ - +@@ -1,5 +1,6 @@ use strict; use warnings; +$ENV{TEST_VERBOSE}=0; diff -Nru libtest-class-perl-0.50/debian/upstream/metadata libtest-class-perl-0.52/debian/upstream/metadata --- libtest-class-perl-0.50/debian/upstream/metadata 2016-05-01 19:06:59.000000000 +0000 +++ libtest-class-perl-0.52/debian/upstream/metadata 2021-02-20 17:46:28.000000000 +0000 @@ -1,6 +1,6 @@ --- Archive: CPAN -Contact: Adrian Howard , Curtis "Ovid" Poe, , - Mark Morgan . -Name: Test-Class -Repository: http://github.com/adrianh/test-class/ +Bug-Database: https://github.com/szabgab/test-class/issues +Bug-Submit: https://github.com/szabgab/test-class/issues/new +Repository: https://github.com/szabgab/test-class.git +Repository-Browse: https://github.com/szabgab/test-class diff -Nru libtest-class-perl-0.50/debian/watch libtest-class-perl-0.52/debian/watch --- libtest-class-perl-0.50/debian/watch 2014-03-04 10:57:24.000000000 +0000 +++ libtest-class-perl-0.52/debian/watch 2021-02-20 17:46:28.000000000 +0000 @@ -1,2 +1,2 @@ -version=3 -https://metacpan.org/release/Test-Class .*/Test-Class-v?(\d[\d.]+)\.(?:tar(?:\.gz|\.bz2)?|tgz|zip) +version=4 +https://metacpan.org/release/Test-Class .*/Test-Class-v?@ANY_VERSION@@ARCHIVE_EXT@$ diff -Nru libtest-class-perl-0.50/lib/Test/Class/Load.pm libtest-class-perl-0.52/lib/Test/Class/Load.pm --- libtest-class-perl-0.50/lib/Test/Class/Load.pm 2015-06-06 23:04:18.000000000 +0000 +++ libtest-class-perl-0.52/lib/Test/Class/Load.pm 2021-02-17 15:25:13.000000000 +0000 @@ -8,7 +8,7 @@ use File::Spec; use Module::Runtime 'require_module'; -our $VERSION = '0.50'; +our $VERSION = '0.52'; # Override to get your own filter sub is_test_class { @@ -69,7 +69,7 @@ =head1 VERSION -version 0.50 +version 0.51 =head1 SYNOPSIS @@ -213,13 +213,13 @@ my ($package) = $_package =~ /^([[:word:]]+(?:::[[:word:]]+)*)$/; -=head1 AUTHOR +=head1 SUPPORT -Curtis "Ovid" Poe, C<< >> +See L -=head1 BUGS +=head1 AUTHOR -Please report any bugs or feature requests to C, or through the web interface at L. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes. +Curtis "Ovid" Poe, C<< >> =head1 ACKNOWLEDGMENTS diff -Nru libtest-class-perl-0.50/lib/Test/Class/MethodInfo.pm libtest-class-perl-0.52/lib/Test/Class/MethodInfo.pm --- libtest-class-perl-0.50/lib/Test/Class/MethodInfo.pm 2015-06-06 23:04:18.000000000 +0000 +++ libtest-class-perl-0.52/lib/Test/Class/MethodInfo.pm 2021-02-17 15:26:07.000000000 +0000 @@ -4,7 +4,7 @@ package Test::Class::MethodInfo; use Carp; -our $VERSION = '0.50'; +our $VERSION = '0.52'; sub new { my ( $class, %param ) = @_; @@ -57,7 +57,7 @@ =head1 VERSION -version 0.50 +version 0.51 =head1 SYNOPSIS @@ -88,18 +88,6 @@ =back -=head1 BUGS - -None known at the time of writing. Apart from the fact this seems a bit gnarly so I'm likely to tidy it up at some point. - -If you find any please let me know by e-mail, or report the problem with L. - -=head1 TO DO - -If you think this module should do something that it doesn't (or does something that it shouldn't) please let me know. - -You can see my current to do list at L, with an RSS feed of changes at L. - =head1 AUTHOR Adrian Howard diff -Nru libtest-class-perl-0.50/lib/Test/Class.pm libtest-class-perl-0.52/lib/Test/Class.pm --- libtest-class-perl-0.50/lib/Test/Class.pm 2015-06-06 23:04:18.000000000 +0000 +++ libtest-class-perl-0.52/lib/Test/Class.pm 2021-02-17 15:25:03.000000000 +0000 @@ -12,7 +12,7 @@ use Test::Class::MethodInfo; use Try::Tiny; -our $VERSION = '0.50'; +our $VERSION = '0.52'; my $Check_block_has_run; { @@ -300,8 +300,13 @@ _exception_failure($self, $method, $exception, $tests) if $exception; } elsif ($num_done > $num_expected) { + local $Test::Builder::Level = $Test::Builder::Level+1; my $class = ref $self; - $Builder->diag("expected $num_expected test(s) in $class\::$method, $num_done completed\n"); + if ($self->fail_if_returned_late) { + $Builder->ok(0, "expected $num_expected test(s) in $class\::$method, $num_done completed"); + } else { + $Builder->diag("expected $num_expected test(s) in $class\::$method, $num_done completed\n"); + } } else { until (($Builder->current_test - $num_start) >= $num_expected) { if ($exception) { @@ -309,6 +314,7 @@ $skip_reason = "$method died"; $exception = ''; } else { + local $Test::Builder::Level = $Test::Builder::Level+1; if ($self->fail_if_returned_early) { my $class = ref $self; $Builder->ok(0, "($class\::$method returned before plan complete)"); @@ -322,6 +328,7 @@ } sub fail_if_returned_early { 0 } +sub fail_if_returned_late { 0 } sub _show_header { my ($self, @tests) = @_; @@ -486,7 +493,7 @@ =head1 VERSION -version 0.50 +version 0.51 =head1 SYNOPSIS @@ -946,6 +953,22 @@ } +=head1 RETURNING LATE + +If a test method runs too many tests, by default the test plan succeeds. + +However, if the class's C method returns true, then the extra tests will trigger a failure. For example, + + package MyClass; + use base 'Test::Class'; + sub fail_if_returned_late { 1 } + + sub oops : Tests(1) { + ok 1, "just a simple test"; + ok 1, "just a simple test"; #oops I copied and pasted too many tests + } + + =head1 SKIPPED TESTS You can skip the rest of the tests in a method by returning from the method before all the test have finished running (but see L<"Returning Early"> for how to change this). The value returned is used as the reason for the tests being skipped. @@ -1576,6 +1599,10 @@ Controls what happens if a method returns before it has run all of its tests. It is called with no arguments in boolean context; if it returns true, then the missing tests fail, otherwise, they skip. See L<"Returning Early"> and L<"Skipped Tests">. +=item B + +Controls what happens if a method returns after running too many tests. It is called with no arguments in boolean context; if it returns true, then the extra tests trigger a failure test. See L<"Returning Late"> and L<"Skipped Tests">. + =back @@ -1668,34 +1695,18 @@ =back +=head1 SUPPORT -=head1 BUGS - -None known at the time of writing. - -If you find any bugs please let me know by e-mail at , or report the problem with L. - - -=head1 COMMUNITY - -=head2 perl-qa - -If you are interested in testing using Perl I recommend you visit L and join the excellent perl-qa mailing list. See L for details on how to subscribe. - -=head2 perlmonks - -You can find users of Test::Class, including the module author, on L. Feel free to ask questions on Test::Class there. - -=head2 CPAN::Forum - -The CPAN Forum is a web forum for discussing Perl's CPAN modules. The Test::Class forum can be found at L. +Bugs may be submitted through L +There is also an irc channel available for users of this distribution, at +L on C|irc://irc.perl.org/#perl-qa>. =head1 TO DO If you think this module should do something that it doesn't (or does something that it shouldn't) please let me know. -You can see my current to do list at L, with an RSS feed of changes at L. +You can see an old to do list at L, with an RSS feed of changes at L. =head1 ACKNOWLEDGMENTS @@ -1770,8 +1781,6 @@ Adrian Howard , Curtis "Ovid" Poe, , Mark Morgan . -If you use this module, and can spare the time please let us know or rate it at L. - =head1 SEE ALSO =over 4 @@ -1788,10 +1797,6 @@ Testing framework allows you to write your tests in Moose and test Moose and non-Moose code. It offers reporting, extensibility, test inheritance, parallel testing and more. -=item L - -Delicious links on Test::Class. - =item Perl Testing: A Developer's Notebook by Ian Langworth and chromatic Chapter 8 covers using Test::Class. @@ -1808,15 +1813,15 @@ =over 4 -=item * L +=item * L -=item * L +=item * L -=item * L +=item * L -=item * L +=item * L -=item * L +=item * L =back @@ -1828,14 +1833,10 @@ Basic utilities for writing tests. -=item L +=item L Overview of some of the many testing modules available on CPAN. -=item L - -Delicious links on perl testing. - =item L Another approach to object oriented testing. diff -Nru libtest-class-perl-0.50/Makefile.PL libtest-class-perl-0.52/Makefile.PL --- libtest-class-perl-0.50/Makefile.PL 2015-06-06 23:58:40.000000000 +0000 +++ libtest-class-perl-0.52/Makefile.PL 2021-02-17 15:37:28.000000000 +0000 @@ -18,13 +18,12 @@ dynamic_config => 1, resources => { repository => { - url => 'https://github.com/adrianh/test-class.git', - web => 'https://github.com/adrianh/test-class', + url => 'https://github.com/szabgab/test-class.git', + web => 'https://github.com/szabgab/test-class', type => 'git', }, bugtracker => { - mailto => 'bug-Test-Class@rt.cpan.org', - web => 'https://rt.cpan.org/Public/Dist/Display.html?Name=Test-Class', + web => 'https://github.com/szabgab/test-class/issues', }, }, x_contributors => [ # manually added, from git shortlog -e -s -n @@ -49,6 +48,7 @@ }, META_ADD => { + 'meta-spec' => { version => 2 }, prereqs => { configure => { requires => { diff -Nru libtest-class-perl-0.50/MANIFEST libtest-class-perl-0.52/MANIFEST --- libtest-class-perl-0.50/MANIFEST 2015-06-07 00:07:59.000000000 +0000 +++ libtest-class-perl-0.52/MANIFEST 2021-02-17 15:39:26.000000000 +0000 @@ -3,9 +3,7 @@ lib/Test/Class/Load.pm lib/Test/Class/MethodInfo.pm Makefile.PL -MANIFEST -META.json -META.yml +MANIFEST This list of files README t/00-load.t t/20-load-classes.t @@ -81,3 +79,5 @@ xt/pmv.t xt/pod.t xt/spelling.t +META.yml Module YAML meta-data (added by MakeMaker) +META.json Module JSON meta-data (added by MakeMaker) diff -Nru libtest-class-perl-0.50/META.json libtest-class-perl-0.52/META.json --- libtest-class-perl-0.50/META.json 2015-06-07 00:08:03.000000000 +0000 +++ libtest-class-perl-0.52/META.json 2021-02-17 15:39:26.000000000 +0000 @@ -4,13 +4,13 @@ "Adrian Howard , Curtis \"Ovid\" Poe, , Mark Morgan " ], "dynamic_config" : 1, - "generated_by" : "ExtUtils::MakeMaker version 7.052, CPAN::Meta::Converter version 2.150004", + "generated_by" : "ExtUtils::MakeMaker version 7.34, CPAN::Meta::Converter version 2.150010", "license" : [ "perl_5" ], "meta-spec" : { "url" : "http://search.cpan.org/perldoc?CPAN::Meta::Spec", - "version" : "2" + "version" : 2 }, "name" : "Test-Class", "no_index" : { @@ -20,9 +20,6 @@ ] }, "prereqs" : { - "build" : { - "requires" : {} - }, "configure" : { "requires" : { "ExtUtils::MakeMaker" : "0" @@ -62,16 +59,15 @@ "release_status" : "stable", "resources" : { "bugtracker" : { - "mailto" : "bug-Test-Class@rt.cpan.org", - "web" : "https://rt.cpan.org/Public/Dist/Display.html?Name=Test-Class" + "web" : "https://github.com/szabgab/test-class/issues" }, "repository" : { "type" : "git", - "url" : "https://github.com/adrianh/test-class.git", - "web" : "https://github.com/adrianh/test-class" + "url" : "https://github.com/szabgab/test-class.git", + "web" : "https://github.com/szabgab/test-class" } }, - "version" : "0.50", + "version" : "0.52", "x_IRC" : "irc://irc.perl.org/#perl-qa", "x_MailingList" : "http://lists.perl.org/list/perl-qa.html", "x_contributors" : [ @@ -91,6 +87,5 @@ "Zefram ", "Kent Fredric " ], - "x_serialization_backend" : "JSON::PP version 2.27300" + "x_serialization_backend" : "JSON::PP version 4.02" } - diff -Nru libtest-class-perl-0.50/META.yml libtest-class-perl-0.52/META.yml --- libtest-class-perl-0.50/META.yml 2015-06-07 00:08:03.000000000 +0000 +++ libtest-class-perl-0.52/META.yml 2021-02-17 15:39:26.000000000 +0000 @@ -13,7 +13,7 @@ configure_requires: ExtUtils::MakeMaker: '0' dynamic_config: 1 -generated_by: 'ExtUtils::MakeMaker version 7.052, CPAN::Meta::Converter version 2.150004' +generated_by: 'ExtUtils::MakeMaker version 7.34, CPAN::Meta::Converter version 2.150010' license: perl meta-spec: url: http://module-build.sourceforge.net/META-spec-v1.4.html @@ -40,9 +40,9 @@ strict: '0' warnings: '0' resources: - bugtracker: https://rt.cpan.org/Public/Dist/Display.html?Name=Test-Class - repository: https://github.com/adrianh/test-class.git -version: '0.50' + bugtracker: https://github.com/szabgab/test-class/issues + repository: https://github.com/szabgab/test-class.git +version: '0.52' x_IRC: irc://irc.perl.org/#perl-qa x_MailingList: http://lists.perl.org/list/perl-qa.html x_contributors: @@ -61,5 +61,4 @@ - 'Klaus S. Madsen ' - 'Zefram ' - 'Kent Fredric ' -x_serialization_backend: 'CPAN::Meta::YAML version 0.016' - +x_serialization_backend: 'CPAN::Meta::YAML version 0.018' diff -Nru libtest-class-perl-0.50/README libtest-class-perl-0.52/README --- libtest-class-perl-0.50/README 2015-06-06 23:47:11.000000000 +0000 +++ libtest-class-perl-0.52/README 2021-02-17 15:35:31.000000000 +0000 @@ -2,7 +2,7 @@ Test::Class - Easily create test classes in an xUnit/JUnit style VERSION - version 0.50 + version 0.51 SYNOPSIS package Example::Test; @@ -479,6 +479,21 @@ } } +RETURNING LATE + If a test method runs too many tests, by default the test plan succeeds. + + However, if the class's "fail_if_returned_late" method returns true, + then the extra tests will trigger a failure. For example, + + package MyClass; + use base 'Test::Class'; + sub fail_if_returned_late { 1 } + + sub oops : Tests(1) { + ok 1, "just a simple test"; + ok 1, "just a simple test"; #oops I copied and pasted too many tests + } + SKIPPED TESTS You can skip the rest of the tests in a method by returning from the method before all the test have finished running (but see "Returning @@ -1172,6 +1187,12 @@ returns true, then the missing tests fail, otherwise, they skip. See "Returning Early" and "Skipped Tests". + fail_if_returned_late + Controls what happens if a method returns after running too many + tests. It is called with no arguments in boolean context; if it + returns true, then the extra tests trigger a failure test. See + "Returning Late" and "Skipped Tests". + HELP FOR CONFUSED JUNIT USERS This section is for people who have used JUnit (or similar) and are confused because they don't see the TestCase/Suite/Runner class @@ -1287,35 +1308,18 @@ output test results in the format that Test::Harness expects, but things like todo tests and skipping tests are not supported. -BUGS - None known at the time of writing. +SUPPORT + Bugs may be submitted through GitHub issues + - If you find any bugs please let me know by e-mail at - , or report the problem with - . - -COMMUNITY - perl-qa - If you are interested in testing using Perl I recommend you visit - and join the excellent perl-qa mailing list. See - for details on how to - subscribe. - - perlmonks - You can find users of Test::Class, including the module author, on - . Feel free to ask questions on Test::Class - there. - - CPAN::Forum - The CPAN Forum is a web forum for discussing Perl's CPAN modules. The - Test::Class forum can be found at - . + There is also an irc channel available for users of this distribution, + at "#perl-qa" on "irc.perl.org" . TO DO If you think this module should do something that it doesn't (or does something that it shouldn't) please let me know. - You can see my current to do list at + You can see an old to do list at , with an RSS feed of changes at . @@ -1346,9 +1350,6 @@ Adrian Howard , Curtis "Ovid" Poe, , Mark Morgan . - If you use this module, and can spare the time please let us know or - rate it at . - SEE ALSO Test::Class::Load Simple way to load "Test::Class" classes automatically. @@ -1362,9 +1363,6 @@ Moose and non-Moose code. It offers reporting, extensibility, test inheritance, parallel testing and more. - - Delicious links on Test::Class. - Perl Testing: A Developer's Notebook by Ian Langworth and chromatic Chapter 8 covers using Test::Class. @@ -1377,19 +1375,24 @@ Test::Class Tutorial series written by Curtis "Ovid" Poe - * - * - * - * - * Test::Builder @@ -1398,12 +1401,9 @@ Test::Simple & Test::More Basic utilities for writing tests. - + Overview of some of the many testing modules available on CPAN. - - Delicious links on perl testing. - Test::Object Another approach to object oriented testing. diff -Nru libtest-class-perl-0.50/t/20-load-classes.t libtest-class-perl-0.52/t/20-load-classes.t --- libtest-class-perl-0.50/t/20-load-classes.t 2014-11-18 15:29:57.000000000 +0000 +++ libtest-class-perl-0.52/t/20-load-classes.t 2021-02-17 14:28:10.000000000 +0000 @@ -1,5 +1,3 @@ -#!/usr/bin/perl - use strict; use warnings; use Test::More tests => 14; @@ -40,4 +38,4 @@ '... and their methods should also work correctly'; eval "use Test::Class::Load qw( t/test-libs/fail )"; -ok $@, "Trying to load a bad module fails"; \ No newline at end of file +ok $@, "Trying to load a bad module fails"; diff -Nru libtest-class-perl-0.50/t/21-load-subclassed.t libtest-class-perl-0.52/t/21-load-subclassed.t --- libtest-class-perl-0.50/t/21-load-subclassed.t 2014-11-18 15:29:57.000000000 +0000 +++ libtest-class-perl-0.52/t/21-load-subclassed.t 2021-02-17 14:28:10.000000000 +0000 @@ -1,5 +1,3 @@ -#!/usr/bin/perl - use strict; use warnings; use Test::More tests => 7; diff -Nru libtest-class-perl-0.50/t/bad-autoloads.t libtest-class-perl-0.52/t/bad-autoloads.t --- libtest-class-perl-0.50/t/bad-autoloads.t 2014-11-18 15:29:57.000000000 +0000 +++ libtest-class-perl-0.52/t/bad-autoloads.t 2021-02-17 14:28:10.000000000 +0000 @@ -1,5 +1,3 @@ -#! /usr/bin/perl - use strict; use warnings FATAL => 'all'; use Test::More; diff -Nru libtest-class-perl-0.50/t/die-in-setup.t libtest-class-perl-0.52/t/die-in-setup.t --- libtest-class-perl-0.50/t/die-in-setup.t 2014-11-18 15:29:57.000000000 +0000 +++ libtest-class-perl-0.52/t/die-in-setup.t 2021-02-17 14:28:10.000000000 +0000 @@ -1,5 +1,3 @@ -#! /usr/bin/perl - use strict; use warnings; @@ -21,7 +19,7 @@ $ENV{TEST_VERBOSE}=0; test_out( "not ok 1 - setup_method (for test method 'test') died (oops - we died)" ); test_err( "# Failed test 'setup_method (for test method 'test') died (oops - we died)'" ); -test_err( "# at $0 line 27." ); +test_err( "# at $0 line 25." ); test_err( "# (in Foo->setup_method)" ); test_out("ok 2 # skip setup_method died"); Test::Class->runtests; diff -Nru libtest-class-perl-0.50/t/filter_bad_filter.t libtest-class-perl-0.52/t/filter_bad_filter.t --- libtest-class-perl-0.50/t/filter_bad_filter.t 2014-11-18 15:29:57.000000000 +0000 +++ libtest-class-perl-0.52/t/filter_bad_filter.t 2021-02-17 14:28:10.000000000 +0000 @@ -1,5 +1,3 @@ -#! /usr/bin/perl - use strict; use warnings; diff -Nru libtest-class-perl-0.50/t/filter_fixtures_only.t libtest-class-perl-0.52/t/filter_fixtures_only.t --- libtest-class-perl-0.50/t/filter_fixtures_only.t 2015-06-06 21:56:34.000000000 +0000 +++ libtest-class-perl-0.52/t/filter_fixtures_only.t 2021-02-17 14:28:10.000000000 +0000 @@ -1,5 +1,3 @@ -#! /usr/bin/perl - use strict; use warnings; use Test::More tests => 1; diff -Nru libtest-class-perl-0.50/t/filter_fixtures.t libtest-class-perl-0.52/t/filter_fixtures.t --- libtest-class-perl-0.50/t/filter_fixtures.t 2014-11-18 15:29:57.000000000 +0000 +++ libtest-class-perl-0.52/t/filter_fixtures.t 2021-02-17 14:28:10.000000000 +0000 @@ -1,5 +1,3 @@ -#! /usr/bin/perl - use strict; use warnings; diff -Nru libtest-class-perl-0.50/t/filter_multiple.t libtest-class-perl-0.52/t/filter_multiple.t --- libtest-class-perl-0.50/t/filter_multiple.t 2014-11-18 15:29:57.000000000 +0000 +++ libtest-class-perl-0.52/t/filter_multiple.t 2021-02-17 14:28:10.000000000 +0000 @@ -1,5 +1,3 @@ -#! /usr/bin/perl - use strict; use warnings; diff -Nru libtest-class-perl-0.50/t/filter.t libtest-class-perl-0.52/t/filter.t --- libtest-class-perl-0.50/t/filter.t 2014-11-18 15:29:57.000000000 +0000 +++ libtest-class-perl-0.52/t/filter.t 2021-02-17 14:28:10.000000000 +0000 @@ -1,5 +1,3 @@ -#! /usr/bin/perl - use strict; use warnings; diff -Nru libtest-class-perl-0.50/t/methodinfo.t libtest-class-perl-0.52/t/methodinfo.t --- libtest-class-perl-0.50/t/methodinfo.t 2014-11-18 15:29:57.000000000 +0000 +++ libtest-class-perl-0.52/t/methodinfo.t 2021-02-17 14:28:10.000000000 +0000 @@ -1,5 +1,3 @@ -#! /usr/bin/perl - use strict; use warnings; use Test::More 'no_plan'; diff -Nru libtest-class-perl-0.50/t/override.t libtest-class-perl-0.52/t/override.t --- libtest-class-perl-0.50/t/override.t 2015-06-06 22:36:43.000000000 +0000 +++ libtest-class-perl-0.52/t/override.t 2021-02-17 14:28:10.000000000 +0000 @@ -1,5 +1,3 @@ -#! /usr/bin/perl - use strict; use warnings; use Test::More tests => 1; diff -Nru libtest-class-perl-0.50/t/rt15870.t libtest-class-perl-0.52/t/rt15870.t --- libtest-class-perl-0.50/t/rt15870.t 2014-11-18 15:29:57.000000000 +0000 +++ libtest-class-perl-0.52/t/rt15870.t 2021-02-17 14:28:10.000000000 +0000 @@ -1,5 +1,3 @@ -#! /usr/bin/perl - use strict; use warnings; use Test::Exception tests => 1; diff -Nru libtest-class-perl-0.50/t/rt17264.t libtest-class-perl-0.52/t/rt17264.t --- libtest-class-perl-0.50/t/rt17264.t 2015-06-06 22:36:43.000000000 +0000 +++ libtest-class-perl-0.52/t/rt17264.t 2021-02-17 14:28:10.000000000 +0000 @@ -1,5 +1,3 @@ -#! /usr/bin/perl - use strict; use warnings; use Test::Exception tests => 1; @@ -8,4 +6,4 @@ require 'Test/Class.pm'; throws_ok { Test::Class->runtests } qr/Test::Class was loaded too late/, - 'we figured out that we loaded Test::Class too late'; \ No newline at end of file + 'we figured out that we loaded Test::Class too late'; diff -Nru libtest-class-perl-0.50/t/runtests_return.t libtest-class-perl-0.52/t/runtests_return.t --- libtest-class-perl-0.50/t/runtests_return.t 2014-11-18 15:29:57.000000000 +0000 +++ libtest-class-perl-0.52/t/runtests_return.t 2021-02-17 14:28:10.000000000 +0000 @@ -4,7 +4,7 @@ use warnings; $ENV{TEST_VERBOSE}=0; -package Foo; +package SkipMissingTests; use Test::More; use base qw(Test::Class); @@ -14,7 +14,7 @@ ok(-r "/Library", "/Library readable"); } -package Bar; +package FailMissingTests; use Test::More; use base qw(Test::Class); @@ -26,18 +26,116 @@ ok(-w "/Library", "/Library writable"); } +package AllowMoreTests; +use Test::More; +use base qw(Test::Class); + +sub more_tests : Tests(1) { + pass; + pass; +} + +sub other_tests : Tests { + pass; +} + +package DisallowMoreTests; +use Test::More; +use base qw(Test::Class); + +sub fail_if_returned_late { 1 } + +sub more_tests : Tests(1) { + pass; + pass; +} + +sub other_tests : Tests { + pass; +} + +package AllowMoreAndLessTests; +use Test::More; +use base qw(Test::Class); + +sub more_tests : Tests(1) { + pass; + pass; +} + +sub less_tests : Tests(2) { + pass; +} + +sub other_tests : Tests { + pass; +} + +package DisallowMoreAndLessTests; +use Test::More; +use base qw(Test::Class); + +sub fail_if_returned_early { 1 } +sub fail_if_returned_late { 1 } + +sub more_tests : Tests(1) { + pass; + pass; +} + +sub less_tests : Tests(2) { + pass; +} + +sub other_tests : Tests { + pass; +} + package main; -use Test::Builder::Tester tests => 2; +use Test::Builder::Tester tests => 6; test_out("ok 1 # skip darwin only test"); test_out("ok 2 # skip darwin only test"); -Foo->runtests; +SkipMissingTests->runtests; test_test("early return handled (skip)"); -test_out("not ok 1 - (Bar::darwin_only returned before plan complete)"); -test_out("not ok 2 - (Bar::darwin_only returned before plan complete)"); -test_err(qr/.*in Bar->darwin_only.*/s); -Bar->runtests; +test_out("not ok 1 - (FailMissingTests::darwin_only returned before plan complete)"); +test_out("not ok 2 - (FailMissingTests::darwin_only returned before plan complete)"); +test_err(qr/.* at \Q$0\E line .*in FailMissingTests->darwin_only.*/s); +FailMissingTests->runtests; test_test("early return handled (fail)"); +test_out("ok 1 - more tests"); +test_out("ok 2 - more tests"); +test_err("# expected 1 test(s) in AllowMoreTests::more_tests, 2 completed"); +test_out("ok 3 - other tests"); +AllowMoreTests->runtests; +test_test("late return handled (skip)"); + +test_out("ok 1 - more tests"); +test_out("ok 2 - more tests"); +test_out("not ok 3 - expected 1 test(s) in DisallowMoreTests::more_tests, 2 completed"); +test_err(qr/.* at \Q$0\E line .*in DisallowMoreTests->more_tests.*/s); +test_out("ok 4 - other tests"); +DisallowMoreTests->runtests; +test_test("late return handled (fail)"); + +test_out("ok 1 - less tests"); +test_out("ok 2 # skip 1"); +test_out("ok 3 - more tests"); +test_out("ok 4 - more tests"); +test_err("# expected 1 test(s) in AllowMoreAndLessTests::more_tests, 2 completed"); +test_out("ok 5 - other tests"); +AllowMoreAndLessTests->runtests; +test_test("early and late return handled (skip)"); + +test_out("ok 1 - less tests"); +test_out("not ok 2 - (DisallowMoreAndLessTests::less_tests returned before plan complete)"); +test_out("ok 3 - more tests"); +test_out("ok 4 - more tests"); +test_out("not ok 5 - expected 1 test(s) in DisallowMoreAndLessTests::more_tests, 2 completed"); +test_out("ok 6 - other tests"); +test_err(qr/.* at \Q$0\E line .*in DisallowMoreAndLessTests->less_tests.* at \Q$0\E line .*in DisallowMoreAndLessTests->more_tests.*/s); +DisallowMoreAndLessTests->runtests; +test_test("early and late return handled (fail)"); diff -Nru libtest-class-perl-0.50/t/skip1.t libtest-class-perl-0.52/t/skip1.t --- libtest-class-perl-0.50/t/skip1.t 2014-11-18 15:29:57.000000000 +0000 +++ libtest-class-perl-0.52/t/skip1.t 2021-02-17 14:28:10.000000000 +0000 @@ -1,5 +1,3 @@ -#!/usr/bin/perl - use strict; use warnings; use base qw(Test::Class); diff -Nru libtest-class-perl-0.50/t/startup_that_dies.t libtest-class-perl-0.52/t/startup_that_dies.t --- libtest-class-perl-0.50/t/startup_that_dies.t 2014-11-18 15:29:57.000000000 +0000 +++ libtest-class-perl-0.52/t/startup_that_dies.t 2021-02-17 14:28:10.000000000 +0000 @@ -1,5 +1,3 @@ -#! /usr/bin/perl - use strict; use warnings; diff -Nru libtest-class-perl-0.50/t/teardown-when-test-dies.t libtest-class-perl-0.52/t/teardown-when-test-dies.t --- libtest-class-perl-0.50/t/teardown-when-test-dies.t 2014-11-18 15:29:57.000000000 +0000 +++ libtest-class-perl-0.52/t/teardown-when-test-dies.t 2021-02-17 14:28:10.000000000 +0000 @@ -1,5 +1,3 @@ -#! /usr/bin/perl - use strict; use warnings; diff -Nru libtest-class-perl-0.50/t/test_deep.t libtest-class-perl-0.52/t/test_deep.t --- libtest-class-perl-0.50/t/test_deep.t 2014-11-18 15:29:57.000000000 +0000 +++ libtest-class-perl-0.52/t/test_deep.t 2021-02-17 14:28:10.000000000 +0000 @@ -1,5 +1,3 @@ -#! /usr/bin/perl - use strict; use warnings; use Test::More tests => 1; diff -Nru libtest-class-perl-0.50/t/test-libs/fail/MyFail.pm libtest-class-perl-0.52/t/test-libs/fail/MyFail.pm --- libtest-class-perl-0.50/t/test-libs/fail/MyFail.pm 2014-11-18 15:29:57.000000000 +0000 +++ libtest-class-perl-0.52/t/test-libs/fail/MyFail.pm 2021-02-17 14:28:10.000000000 +0000 @@ -1,3 +1 @@ -#! /usr/bin/perl - -0; # we deliberately fail \ No newline at end of file +0; # we deliberately fail diff -Nru libtest-class-perl-0.50/t/test_method.t libtest-class-perl-0.52/t/test_method.t --- libtest-class-perl-0.50/t/test_method.t 2014-11-18 15:29:57.000000000 +0000 +++ libtest-class-perl-0.52/t/test_method.t 2021-02-17 14:28:10.000000000 +0000 @@ -1,5 +1,3 @@ -#! /usr/bin/perl - use strict; use warnings; use Test::More tests => 4; diff -Nru libtest-class-perl-0.50/t/Tests.t libtest-class-perl-0.52/t/Tests.t --- libtest-class-perl-0.50/t/Tests.t 2014-11-18 15:29:57.000000000 +0000 +++ libtest-class-perl-0.52/t/Tests.t 2021-02-17 14:28:10.000000000 +0000 @@ -1,5 +1,3 @@ -#! /usr/bin/perl - use strict; use warnings; use Test::More tests => 2;