LFS-RPM/SPECS/perl-Test-Warnings.spec
2023-04-22 10:29:13 -07:00

83 lines
2.5 KiB
RPMSpec

%global cpanname Test-Warnings
Name: perl-%{cpanname}
Version: 0.031
Release: %{?repo}0.rc1%{?dist}
Summary: Test for warnings and the lack of them
BuildArch: noarch
Group: Development/Libraries
License: GPL-1.0-or-later and Artistic-1.0-Perl
URL: https://metacpan.org/pod/Test::Warnings
Source0: https://cpan.metacpan.org/authors/id/E/ET/ETHER/%{cpanname}-%{version}.tar.gz
BuildRequires: perl(ExtUtils::MakeMaker)
# for test
BuildRequires: perl(CPAN::Meta)
BuildRequires: perl(Test::More) >= 0.94
BuildRequires: perl(CPAN::Meta)
BuildRequires: perl(if)
BuildRequires: perl(Carp)
BuildRequires: perl(Exporter)
BuildRequires: perl(Test::Builder)
BuildRequires: perl(parent)
BuildRequires: perl(strict)
BuildRequires: perl(warnings)
# suggests
#BuildRequires: perl(CPAN::Meta::Check) >= 0.011
BuildRequires: perl(CPAN::Meta::Requirements)
#BuildRequires: perl(PadWalker)
BuildRequires: perl(Test::Tester) >= 0.108
# runtime
Requires: perl(Carp)
Requires: perl(Exporter)
Requires: perl(Test::Builder)
Requires: perl(parent)
Requires: perl(strict)
Requires: perl(warnings)
%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.
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.
%prep
%setup -n %{cpanname}-%{version}
%build
perl Makefile.PL INSTALLDIRS=vendor NO_PACKLIST=1 NO_PERLLOCAL=1 OPTIMIZE="$RPM_OPT_FLAGS"
make %{?_smp_mflags}
%check
make test > %{name}-make.test.log 2>&1
%install
make install DESTDIR=%{buildroot}
%{_fixperms} %{buildroot}%{perl5_vendorlib}
%files
%defattr(-,root,root,-)
%dir %{perl5_vendorlib}/Test
%attr(0444,root,root) %{perl5_vendorlib}/Test/Warnings.pm
%attr(0644,root,root) %{_mandir}/man3/Test::Warnings.3*
%license LICENCE
%doc CONTRIBUTING Changes LICENCE README
%doc %{name}-make.test.log
%changelog
* Sat Apr 22 2023 Michael A. Peters <anymouseprophet@gmail.com> - 0.031-0.rc1
- Initial spec file for YJL (RPM bootstrapping LFS/BLFS 11.3)