commit 140dd48c37095d3e02c21bc548cc9862f37adb26 Author: Paul Howarth <paul@xxxxxxxxxxxx> Date: Thu Jul 11 13:37:29 2013 +0100 Initial import (perl-Test-Warnings-0.007-1) If you've ever tried to use Test::NoWarnings to confirm there are no warnings generated by your tests, combined with the convenience of done_testing to not have to declare a test count, you'll have discovered that these two features do not play well together, as the test count will be calculated before the warnings test is run, resulting in a TAP error (see examples/test_nowarnings.pl in this distribution for a demonstration). This module is intended to be used as a drop-in replacement for Test::NoWarnings: it also adds an extra test, but runs this test before done_testing calculates the test count, rather than after. It does this by hooking into done_testing as well as via an END block. You can declare a plan, or not, and things will still Just Work. It is actually equivalent to: use Test::NoWarnings 1.04 ':early'; as warnings are still printed normally as they occur. You are safe, and enthusiastically encouraged, to perform a global search-replace of the above with use Test::Warnings; whether or not your tests have a plan. .gitignore | 1 + perl-Test-Warnings.spec | 83 +++++++++++++++++++++++++++++++++++++++++++++++ sources | 1 + 3 files changed, 85 insertions(+), 0 deletions(-) --- diff --git a/.gitignore b/.gitignore index e69de29..20573b7 100644 --- a/.gitignore +++ b/.gitignore @@ -0,0 +1 @@ +/Test-Warnings-[0-9.]*.tar.gz diff --git a/perl-Test-Warnings.spec b/perl-Test-Warnings.spec new file mode 100644 index 0000000..10d0628 --- /dev/null +++ b/perl-Test-Warnings.spec @@ -0,0 +1,83 @@ +Name: perl-Test-Warnings +Version: 0.007 +Release: 1%{?dist} +Summary: Test for warnings and the lack of them +License: GPL+ or Artistic +Group: Development/Libraries +URL: http://search.cpan.org/dist/Test-Warnings +Source0: http://search.cpan.org/CPAN/authors/id/E/ET/ETHER/Test-Warnings-%{version}.tar.gz +BuildArch: noarch +# Build +BuildRequires: perl(Module::Build::Tiny) >= 0.024 +# Module +BuildRequires: perl(Exporter) +BuildRequires: perl(Test::Builder) +BuildRequires: perl(parent) +BuildRequires: perl(strict) +BuildRequires: perl(warnings) +# Test Suite +BuildRequires: perl(Capture::Tiny) +BuildRequires: perl(File::Find) +BuildRequires: perl(File::Temp) +BuildRequires: perl(if) +BuildRequires: perl(Test::CheckDeps) >= 0.006 +BuildRequires: perl(Test::Deep) +BuildRequires: perl(Test::More) >= 0.94 +BuildRequires: perl(Test::Tester) >= 0.108 +# Runtime +Requires: perl(:MODULE_COMPAT_%(eval "`perl -V:version`"; echo $version)) + +%description +If you've ever tried to use Test::NoWarnings to confirm there are no warnings +generated by your tests, combined with the convenience of done_testing to not +have to declare a test count, you'll have discovered that these two features do +not play well together, as the test count will be calculated before the +warnings test is run, resulting in a TAP error (see examples/test_nowarnings.pl +in this distribution for a demonstration). + +This module is intended to be used as a drop-in replacement for +Test::NoWarnings: it also adds an extra test, but runs this test before +done_testing calculates the test count, rather than after. It does this by +hooking into done_testing as well as via an END block. You can declare a plan, +or not, and things will still Just Work. + +It is actually equivalent to: + + use Test::NoWarnings 1.04 ':early'; + +as warnings are still printed normally as they occur. You are safe, and +enthusiastically encouraged, to perform a global search-replace of the above +with use Test::Warnings; whether or not your tests have a plan. + +%prep +%setup -q -n Test-Warnings-%{version} + +%build +perl Build.PL --installdirs=vendor +./Build + +%install +./Build install --destdir=%{buildroot} --create_packlist=0 + +%check +./Build test + +%files +%doc Changes LICENSE README +%{perl_vendorlib}/Test/ +%{_mandir}/man3/Test::Warnings.3pm* + +%changelog +* Wed Jul 10 2013 Paul Howarth <paul@xxxxxxxxxxxx> - 0.007-1 +- Update to 0.007 + - Fix subtest tests to work on Test::More before 0.95_01 (CPAN RT#86802) +- BR: perl(Capture::Tiny) +- Bump perl(Module::Build::Tiny) version requirement to 0.024 +- Bump perl(Test::CheckDeps) version requirement to 0.006 +- Drop perl(Test::More) version requirement to 0.94 + +* Tue Jul 9 2013 Paul Howarth <paul@xxxxxxxxxxxx> - 0.006-2 +- Sanitize for Fedora submission + +* Tue Jul 9 2013 Paul Howarth <paul@xxxxxxxxxxxx> - 0.006-1 +- Initial RPM version diff --git a/sources b/sources index e69de29..ca201f7 100644 --- a/sources +++ b/sources @@ -0,0 +1 @@ +66779108a5c974114f3a6a709270b0a0 Test-Warnings-0.007.tar.gz -- Fedora Extras Perl SIG http://www.fedoraproject.org/wiki/Extras/SIGs/Perl perl-devel mailing list perl-devel@xxxxxxxxxxxxxxxxxxxxxxx https://admin.fedoraproject.org/mailman/listinfo/perl-devel