Control extra test with a build condition
This commit is contained in:
parent
343d705cfc
commit
779c0c57d2
@ -1,3 +1,6 @@
|
||||
# Run extra test
|
||||
%bcond_without perl_Test_Requires_enables_extra_test
|
||||
|
||||
# Only need manual requires for "use base XXX;" prior to rpm 4.9
|
||||
%global rpm49 0%(rpm --version | perl -p -e 's/^.* (\\d+)\\.(\\d+).*/sprintf("%d.%03d",$1,$2) ge 4.009 ? 1 : 0/e')
|
||||
|
||||
@ -26,12 +29,14 @@ BuildRequires: perl(warnings)
|
||||
# Test Suite
|
||||
BuildRequires: perl(Data::Dumper)
|
||||
BuildRequires: perl(Test::More) >= 0.47
|
||||
%if %{with perl_Test_Requires_enables_extra_test}
|
||||
# Extra Tests
|
||||
%if 0%{!?perl_bootstrap:1} && 0%{!?rhel:1}
|
||||
# Test::Perl::Critic -> Perl::Critic -> PPIx::Regexp -> Test::Kwalitee ->
|
||||
# Module::CPANTS::Analyse -> Test::Warn -> Sub::Uplevel -> Pod::Wordlist::hanekomu -> Test::Requires
|
||||
BuildRequires: perl(Test::Perl::Critic)
|
||||
%endif
|
||||
%endif
|
||||
# Runtime
|
||||
Requires: perl(:MODULE_COMPAT_%(eval "`perl -V:version`"; echo $version))
|
||||
%if ! %{rpm49}
|
||||
@ -59,7 +64,9 @@ find %{buildroot} -type f -name .packlist -exec rm -f {} ';'
|
||||
%check
|
||||
# note the "skipped" warnings indicate success :)
|
||||
make test
|
||||
%if %{with perl_Test_Requires_enables_extra_test}
|
||||
make test TEST_FILES="xt/*.t"
|
||||
%endif
|
||||
|
||||
%clean
|
||||
rm -rf %{buildroot}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user