perl-Test-Warnings/perl-Test-Warnings.spec
2020-01-14 10:44:10 +08:00

68 lines
2.6 KiB
RPMSpec

Name: perl-Test-Warnings
Version: 0.026
Release: 11
Summary: Test for warnings and the lack of them
License: GPL+ or Artistic
URL: https://metacpan.org/release/Test-Warnings
Source0: https://cpan.metacpan.org/authors/id/E/ET/ETHER/Test-Warnings-%{version}.tar.gz
BuildRequires: coreutils findutils make perl-interpreter perl-generators perl(ExtUtils::MakeMaker) perl(Carp)
BuildRequires: perl(Exporter) perl(Test::Builder) perl(parent) perl(strict) perl(warnings) perl(ExtUtils::MakeMaker)
BuildRequires: perl(File::Spec) perl(if) perl(lib) perl(Test::More) >= 0.94 perl(Test::Tester) >= 0.108
Requires: perl(:MODULE_COMPAT_%(eval "`perl -V:version`"; echo $version)) perl(Carp)
BuildArch: noarch
%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.
It can also be used as a replacement for Test::Warn, if you wish to test the content of expected warnings; read
on to find out how.
%package help
Summary: Help package for %{name}
%description help
This package contains some man help files for %{name}.
%prep
%autosetup -n Test-Warnings-%{version} -p1
%build
perl Makefile.PL INSTALLDIRS=vendor
%make_build
%install
make pure_install DESTDIR=%{buildroot}
%{_fixperms} %{buildroot}
%check
make test
%files
%doc Changes CONTRIBUTING LICENCE README examples/
%{perl_vendorlib}/Test/
%exclude %{perl_vendorarch}/auto/Test/Warnings/.packlist
%files help
%{_mandir}/man3/Test::Warnings.3*
%changelog
* Tue Jan 14 2020 hy-euler <eulerstoragemt@huawei.com> 0.026-11
- Delete the unnecessary build dependencies
* Thu Nov 28 2019 lingsheng <lingsheng@huawei.com> 0.026-10
- Package init