3 %bcond_without tests # do not perform "make test"
6 %define pnam FailWarnings
7 Summary: Test::FailWarnings - Add test failures if warnings are caught
8 Name: perl-Test-FailWarnings
12 Group: Development/Languages/Perl
13 Source0: http://www.cpan.org/modules/by-module/Test/%{pdir}-%{pnam}-%{version}.tar.gz
14 # Source0-md5: c03d51f550dbfd9945722ff7f4c32717
15 URL: https://metacpan.org/release/Test-FailWarnings
16 BuildRequires: perl-devel >= 1:5.8.0
17 BuildRequires: rpm-perlprov >= 4.1-13
18 BuildRequires: rpmbuild(macros) >= 1.745
20 BuildRequires: perl-Capture-Tiny >= 0.12
23 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
26 This module hooks $SIG{__WARN__} and converts warnings to Test::More
27 fail() calls. It is designed to be used with done_testing, when you
28 don't need to know the test count in advance.
30 Just as with Test::NoWarnings, this does not catch warnings if other
31 things localize $SIG{__WARN__}, as this is designed to catch unhandled
35 %setup -q -n %{pdir}-%{pnam}-%{version}
38 %{__perl} Makefile.PL \
42 %{?with_tests:%{__make} test}
45 rm -rf $RPM_BUILD_ROOT
47 %{__make} pure_install \
48 DESTDIR=$RPM_BUILD_ROOT
51 rm -rf $RPM_BUILD_ROOT
54 %defattr(644,root,root,755)
56 %{perl_vendorlib}/Test/FailWarnings.pm
57 %{_mandir}/man3/Test::FailWarnings.3*