]>
Commit | Line | Data |
---|---|---|
de52701a JR |
1 | # |
2 | # Conditional build: | |
3 | %bcond_without tests # do not perform "make test" | |
4 | # | |
5 | %define pdir Test | |
6 | %define pnam Warnings | |
de52701a | 7 | Summary: Test::Warnings - Test for warnings and the lack of them |
c9d0fed0 | 8 | Summary(pl.UTF-8): Test::Warnings - testowanie pod kątem ostrzeżeń i ich braku |
de52701a | 9 | Name: perl-Test-Warnings |
21ed0d91 | 10 | Version: 0.031 |
de52701a | 11 | Release: 1 |
c9d0fed0 | 12 | # same as perl 5 |
de52701a JR |
13 | License: GPL v1+ or Artistic |
14 | Group: Development/Languages/Perl | |
15 | Source0: http://www.cpan.org/modules/by-module/Test/%{pdir}-%{pnam}-%{version}.tar.gz | |
21ed0d91 | 16 | # Source0-md5: f608f7011b0bb8f27d3a27e646a52f60 |
fc75028b | 17 | URL: https://metacpan.org/release/Test-Warnings |
de52701a JR |
18 | BuildRequires: perl-devel >= 1:5.8.0 |
19 | BuildRequires: rpm-perlprov >= 4.1-13 | |
fc75028b | 20 | BuildRequires: rpmbuild(macros) >= 1.745 |
de52701a | 21 | %if %{with tests} |
c9d0fed0 | 22 | BuildRequires: perl-Test-Simple >= 0.94 |
de52701a JR |
23 | %endif |
24 | BuildArch: noarch | |
25 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
26 | ||
27 | %description | |
c9d0fed0 JB |
28 | If you've ever tried to use Test::NoWarnings to confirm there are no |
29 | warnings generated by your tests, combined with the convenience of | |
30 | done_testing to not have to declare a test count, you'll have | |
31 | discovered that these two features do not play well together, as the | |
32 | test count will be calculated before the warnings test is run, | |
33 | resulting in a TAP error. | |
de52701a JR |
34 | |
35 | This module is intended to be used as a drop-in replacement for | |
c9d0fed0 JB |
36 | Test::NoWarnings: it also adds an extra test, but runs this test |
37 | before done_testing calculates the test count, rather than after. It | |
38 | does this by hooking into done_testing as well as via an END block. | |
39 | You can declare a plan, or not, and things will still Just Work. | |
40 | ||
41 | %description -l pl.UTF-8 | |
42 | Przy próbie użycia Test::NoWarnings w celu upewnienia się, że testy | |
43 | nie generują ostrzeżeń w połączeniu z wygodą done_testing, aby nie | |
44 | trzeba było deklarować liczby testów, okazuje się, że udogodnienia te | |
45 | nie współpracują dobrze ze sobą - liczba testów jest obliczana przed | |
46 | uruchomieniem testu ostrzeżeń, czego wynikiem jest błąd TAP. | |
47 | ||
48 | Ten moduł jest pomyślany jako zamiennik Test::Nowarnings - także | |
49 | dodaje dodatkowy test, ale uruchamia go zanim done_testing obliczy | |
50 | liczbę testów, a nie po tym. Robi to przez wstawienie w done_testing, | |
51 | a także poprzez blok END. Można zadeklarować plan lub nie, a wszystko | |
52 | będzie po prostu działać. | |
de52701a JR |
53 | |
54 | %prep | |
55 | %setup -q -n %{pdir}-%{pnam}-%{version} | |
56 | ||
57 | %build | |
c9d0fed0 JB |
58 | %{__perl} Makefile.PL \ |
59 | INSTALLDIRS=vendor | |
60 | ||
61 | %{__make} | |
de52701a | 62 | |
c9d0fed0 | 63 | %{?with_tests:%{__make} test} |
de52701a JR |
64 | |
65 | %install | |
66 | rm -rf $RPM_BUILD_ROOT | |
67 | ||
c9d0fed0 JB |
68 | %{__make} pure_install \ |
69 | DESTDIR=$RPM_BUILD_ROOT | |
de52701a JR |
70 | |
71 | install -d $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version} | |
72 | cp -a examples $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version} | |
73 | ||
74 | %clean | |
75 | rm -rf $RPM_BUILD_ROOT | |
76 | ||
77 | %files | |
78 | %defattr(644,root,root,755) | |
76a0d6bc | 79 | %doc Changes README |
de52701a | 80 | %{perl_vendorlib}/Test/Warnings.pm |
c9d0fed0 | 81 | %{_mandir}/man3/Test::Warnings.3pm* |
de52701a | 82 | %{_examplesdir}/%{name}-%{version} |