2b2046
# Run optional test
2b2046
%if ! (0%{?rhel})
2b2046
%bcond_without perl_Test_Warnings_enables_optional_test
2b2046
%else
2b2046
%bcond_with perl_Test_Warnings_enables_optional_test
2b2046
%endif
2b2046
2b2046
Name:		perl-Test-Warnings
2b2046
Version:	0.026
2b2046
Release:	7%{?dist}
2b2046
Summary:	Test for warnings and the lack of them
2b2046
License:	GPL+ or Artistic
2b2046
Group:		Development/Libraries
2b2046
URL:		http://search.cpan.org/dist/Test-Warnings
2b2046
Source0:	http://search.cpan.org/CPAN/authors/id/E/ET/ETHER/Test-Warnings-%{version}.tar.gz
2b2046
BuildArch:	noarch
2b2046
# Build
2b2046
BuildRequires:	coreutils
2b2046
BuildRequires:	findutils
2b2046
BuildRequires:	make
2b2046
BuildRequires:	perl-interpreter
2b2046
BuildRequires:	perl-generators
2b2046
BuildRequires:	perl(ExtUtils::MakeMaker)
2b2046
# Module
2b2046
BuildRequires:	perl(Carp)
2b2046
BuildRequires:	perl(Exporter)
2b2046
BuildRequires:	perl(Test::Builder)
2b2046
BuildRequires:	perl(parent)
2b2046
BuildRequires:	perl(strict)
2b2046
BuildRequires:	perl(warnings)
2b2046
# Test Suite
2b2046
BuildRequires:	perl(ExtUtils::MakeMaker)
2b2046
BuildRequires:	perl(File::Spec)
2b2046
BuildRequires:	perl(if)
2b2046
BuildRequires:	perl(lib)
2b2046
BuildRequires:	perl(Test::More) >= 0.94
2b2046
BuildRequires:	perl(Test::Tester) >= 0.108
2b2046
%if %{with perl_Test_Warnings_enables_optional_test}
2b2046
# Optional Tests
2b2046
BuildRequires:	perl(CPAN::Meta) >= 2.120900
2b2046
%if 0%{?fedora} || 0%{?rhel} > 7
2b2046
BuildRequires:	perl(CPAN::Meta::Check) >= 0.011
2b2046
%endif
2b2046
BuildRequires:	perl(CPAN::Meta::Prereqs)
2b2046
BuildRequires:	perl(CPAN::Meta::Requirements)
2b2046
BuildRequires:	perl(PadWalker)
2b2046
%endif
2b2046
# Runtime
2b2046
Requires:	perl(:MODULE_COMPAT_%(eval "`perl -V:version`"; echo $version))
2b2046
Requires:	perl(Carp)
2b2046
2b2046
%description
2b2046
If you've ever tried to use Test::NoWarnings to confirm there are no warnings
2b2046
generated by your tests, combined with the convenience of done_testing to not
2b2046
have to declare a test count, you'll have discovered that these two features do
2b2046
not play well together, as the test count will be calculated before the
2b2046
warnings test is run, resulting in a TAP error (see examples/test_nowarnings.pl
2b2046
in this distribution for a demonstration).
2b2046
2b2046
This module is intended to be used as a drop-in replacement for
2b2046
Test::NoWarnings: it also adds an extra test, but runs this test before
2b2046
done_testing calculates the test count, rather than after. It does this by
2b2046
hooking into done_testing as well as via an END block. You can declare a plan,
2b2046
or not, and things will still Just Work.
2b2046
2b2046
It is actually equivalent to:
2b2046
2b2046
    use Test::NoWarnings 1.04 ':early';
2b2046
2b2046
as warnings are still printed normally as they occur. You are safe, and
2b2046
enthusiastically encouraged, to perform a global search-replace of the above
2b2046
with use Test::Warnings; whether or not your tests have a plan.
2b2046
2b2046
%prep
2b2046
%setup -q -n Test-Warnings-%{version}
2b2046
2b2046
%build
2b2046
perl Makefile.PL INSTALLDIRS=vendor
2b2046
make %{?_smp_mflags}
2b2046
2b2046
%install
2b2046
make pure_install DESTDIR=%{buildroot}
2b2046
find %{buildroot} -type f -name .packlist -exec rm -f {} ';'
2b2046
%{_fixperms} %{buildroot}
2b2046
2b2046
%check
2b2046
make test
2b2046
2b2046
%files
2b2046
%license LICENCE
2b2046
%doc Changes CONTRIBUTING README examples/
2b2046
%{perl_vendorlib}/Test/
2b2046
%{_mandir}/man3/Test::Warnings.3*
2b2046
2b2046
%changelog
2b2046
* Fri Feb 09 2018 Fedora Release Engineering <releng@fedoraproject.org> - 0.026-7
2b2046
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild
2b2046
2b2046
* Thu Jul 27 2017 Fedora Release Engineering <releng@fedoraproject.org> - 0.026-6
2b2046
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild
2b2046
2b2046
* Mon Jun 05 2017 Jitka Plesnikova <jplesnik@redhat.com> - 0.026-5
2b2046
- Perl 5.26 rebuild
2b2046
2b2046
* Sat Feb 11 2017 Fedora Release Engineering <releng@fedoraproject.org> - 0.026-4
2b2046
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild
2b2046
2b2046
* Sun May 15 2016 Jitka Plesnikova <jplesnik@redhat.com> - 0.026-3
2b2046
- Perl 5.24 rebuild
2b2046
2b2046
* Thu Feb 04 2016 Fedora Release Engineering <releng@fedoraproject.org> - 0.026-2
2b2046
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild
2b2046
2b2046
* Wed Jan 27 2016 Paul Howarth <paul@city-fan.org> - 0.026-1
2b2046
- Update to 0.026
2b2046
  - Fixed use of modules loaded by t/zzz-check-breaks.t
2b2046
  - Fix stderr suppression on perl 5.6
2b2046
2b2046
* Mon Jan 25 2016 Paul Howarth <paul@city-fan.org> - 0.025-1
2b2046
- Update to 0.025
2b2046
  - Prereqs lowered from required to suggested:
2b2046
    - CPAN::Meta::Check
2b2046
    - CPAN::Meta::Requirements
2b2046
  - Tests are now quieter to avoid causing confusion, by suppressing the
2b2046
    printing of stderr in tests
2b2046
2b2046
* Sun Dec 27 2015 Paul Howarth <paul@city-fan.org> - 0.024-1
2b2046
- Update to 0.024
2b2046
  - Remove diagnostics accidentally left in new test
2b2046
2b2046
* Tue Dec 22 2015 Paul Howarth <paul@city-fan.org> - 0.023-1
2b2046
- Update to 0.023
2b2046
  - Properly handle propagating warnings to previously declared handlers that
2b2046
    are not coderefs (i.e. a sub name, or the magic DEFAULT and IGNORE)
2b2046
2b2046
* Mon Dec 21 2015 Paul Howarth <paul@city-fan.org> - 0.022-1
2b2046
- Update to 0.022
2b2046
  - Propagate all warnings to any previously-declared __WARN__ handlers
2b2046
    (unlike with __DIE__, merely calling warn() is not sufficient)
2b2046
2b2046
* Thu Jun 18 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.021-3
2b2046
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild
2b2046
2b2046
* Sat Jun 06 2015 Jitka Plesnikova <jplesnik@redhat.com> - 0.021-2
2b2046
- Perl 5.22 rebuild
2b2046
2b2046
* Mon Mar 23 2015 Paul Howarth <paul@city-fan.org> - 0.021-1
2b2046
- Update to 0.021
2b2046
  - Add a x_breaks entry for conflicting versions of File::pushd that
2b2046
    inadvertently call our exported warnings() rather than invoking
2b2046
    warnings.pm, and documented this undesired interaction
2b2046
2b2046
* Wed Jan  7 2015 Paul Howarth <paul@city-fan.org> - 0.020-1
2b2046
- Update to 0.020
2b2046
  - Re-release to fix problematic $VERSION declaration (CPAN RT#101239)
2b2046
2b2046
* Fri Dec 19 2014 Paul Howarth <paul@city-fan.org> - 0.019-1
2b2046
- Update to 0.019
2b2046
  - Fix test to allow for special characters (e.g. MSWin32 file separators) in
2b2046
    filenames (PR#7)
2b2046
2b2046
* Thu Dec 18 2014 Paul Howarth <paul@city-fan.org> - 0.018-1
2b2046
- Update to 0.018
2b2046
  - Fix test to not depend on message formatting changes in newer Carp
2b2046
2b2046
* Wed Dec 17 2014 Paul Howarth <paul@city-fan.org> - 0.017-1
2b2046
- Update to 0.017
2b2046
  - Handle other warning handlers passing us partial warning messages by
2b2046
    re-adding the source file and line number
2b2046
- Use %%license
2b2046
2b2046
* Wed Aug 27 2014 Jitka Plesnikova <jplesnik@redhat.com> - 0.016-2
2b2046
- Perl 5.20 rebuild
2b2046
2b2046
* Sun Jun 22 2014 Paul Howarth <paul@city-fan.org> - 0.016-1
2b2046
- Update to 0.16
2b2046
  - Fix prereq problem with last release - now no longer testing the example
2b2046
    scripts for user installs
2b2046
2b2046
* Fri Jun 20 2014 Paul Howarth <paul@city-fan.org> - 0.015-1
2b2046
- Update to 0.15
2b2046
  - Adjusted packaging and tests to become perl-5.6 friendly, including only
2b2046
    using core or dual-lifed prerequisites
2b2046
- Switch to ExtUtils::MakeMaker flow
2b2046
2b2046
* Sat Jun 07 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.014-2
2b2046
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild
2b2046
2b2046
* Mon Mar  3 2014 Paul Howarth <paul@city-fan.org> - 0.014-1
2b2046
- Update to 0.014
2b2046
  - Fix test that fails when FOO or BAR environment variables are set
2b2046
    (CPAN RT#93447)
2b2046
2b2046
* Mon Dec 16 2013 Paul Howarth <paul@city-fan.org> - 0.013-1
2b2046
- Update to 0.013
2b2046
  - Update configure_requires checking in Makefile.PL
2b2046
2b2046
* Mon Oct 14 2013 Paul Howarth <paul@city-fan.org> - 0.012-1
2b2046
- Update to 0.012
2b2046
  - Re-release to fix t/00-report-prereqs.t use of CPAN::Meta::Requirements
2b2046
2b2046
* Sun Oct 13 2013 Paul Howarth <paul@city-fan.org> - 0.011-1
2b2046
- Update to 0.011
2b2046
  - Unnecessary tests removed
2b2046
  - CONTRIBUTING file added
2b2046
- Drop buildreqs only needed for removed tests
2b2046
- BR: optional test requirement perl(CPAN::Meta::Requirements)
2b2046
2b2046
* Wed Sep 25 2013 Paul Howarth <paul@city-fan.org> - 0.010-1
2b2046
- Update to 0.010
2b2046
  - Re-release with fixed compile test
2b2046
- Update dependencies
2b2046
- Package examples
2b2046
2b2046
* Wed Sep 11 2013 Paul Howarth <paul@city-fan.org> - 0.009-1
2b2046
- Update to 0.009
2b2046
  - Fixed error in synopsis (we do not export anything by default)
2b2046
  - A caveat added to the documentation regarding embedding warning checks
2b2046
    inside another sub
2b2046
  - ':no_end_test' now also covers side effects of done_testing, as well as
2b2046
    END blocks, making it possible to use the warning(s) subs without having an
2b2046
    end warning test while using done_testing (necessary when combining with
2b2046
    the 'if' pragma)
2b2046
  - END tests will not be added by a subequent use of Test::Warnings if a
2b2046
    previous one passed ':no_end_test'
2b2046
- Update dependencies
2b2046
2b2046
* Sun Aug 04 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.008-3
2b2046
- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild
2b2046
2b2046
* Wed Jul 24 2013 Petr Pisar <ppisar@redhat.com> - 0.008-2
2b2046
- Perl 5.18 rebuild
2b2046
2b2046
* Mon Jul 15 2013 Paul Howarth <paul@city-fan.org> - 0.008-1
2b2046
- Update to 0.008
2b2046
  - Compile test updated, to hopefully fix mswin32 parsing issues
2b2046
2b2046
* Wed Jul 10 2013 Paul Howarth <paul@city-fan.org> - 0.007-1
2b2046
- Update to 0.007
2b2046
  - Fix subtest tests to work on Test::More before 0.95_01 (CPAN RT#86802)
2b2046
- BR: perl(Capture::Tiny)
2b2046
- Bump perl(Module::Build::Tiny) version requirement to 0.024
2b2046
- Bump perl(Test::CheckDeps) version requirement to 0.006
2b2046
- Drop perl(Test::More) version requirement to 0.94
2b2046
2b2046
* Tue Jul  9 2013 Paul Howarth <paul@city-fan.org> - 0.006-2
2b2046
- Sanitize for Fedora submission
2b2046
2b2046
* Tue Jul  9 2013 Paul Howarth <paul@city-fan.org> - 0.006-1
2b2046
- Initial RPM version