Control additional tests with build conditions

This commit is contained in:
Petr Písař 2017-12-08 10:16:12 +01:00
parent f3b25bcadd
commit 510f6a79b6

View File

@ -1,3 +1,8 @@
# Run extra test
%bcond_without perl_Package_Stash_XS_enables_extra_test
# Run optional test
%bcond_without perl_Package_Stash_XS_enables_optional_test
Name: perl-Package-Stash-XS Name: perl-Package-Stash-XS
Version: 0.28 Version: 0.28
Release: 16%{?dist} Release: 16%{?dist}
@ -35,6 +40,7 @@ BuildRequires: perl(Symbol)
BuildRequires: perl(Test::Fatal) BuildRequires: perl(Test::Fatal)
BuildRequires: perl(Test::More) BuildRequires: perl(Test::More)
BuildRequires: perl(Test::Requires) BuildRequires: perl(Test::Requires)
%if %{with perl_Package_Stash_XS_enables_optional_test}
# Optional Tests # Optional Tests
%if 0%{?fedora} > 15 || 0%{?rhel} > 6 %if 0%{?fedora} > 15 || 0%{?rhel} > 6
BuildRequires: perl(Package::Anon) BuildRequires: perl(Package::Anon)
@ -42,6 +48,8 @@ BuildRequires: perl(Package::Anon)
%if "%{?rhel}" != "5" %if "%{?rhel}" != "5"
BuildRequires: perl(Variable::Magic) BuildRequires: perl(Variable::Magic)
%endif %endif
%endif
%if %{with perl_Package_Stash_XS_enables_extra_test}
# Author Tests # Author Tests
%if ! (0%{?rhel} >= 7) %if ! (0%{?rhel} >= 7)
BuildRequires: perl(Test::LeakTrace) BuildRequires: perl(Test::LeakTrace)
@ -52,6 +60,7 @@ BuildRequires: perl(Test::EOL)
BuildRequires: perl(Test::NoTabs) BuildRequires: perl(Test::NoTabs)
BuildRequires: perl(Test::Pod) BuildRequires: perl(Test::Pod)
BuildRequires: perl(Test::Pod::Coverage) BuildRequires: perl(Test::Pod::Coverage)
%endif
# Dependencies # Dependencies
Requires: perl(:MODULE_COMPAT_%(eval "`perl -V:version`"; echo $version)) Requires: perl(:MODULE_COMPAT_%(eval "`perl -V:version`"; echo $version))
@ -84,11 +93,13 @@ find %{buildroot} -type f -name '*.bs' -empty -delete
%check %check
make test make test
%if %{with perl_Package_Stash_XS_enables_extra_test}
%if ! (0%{?rhel} >= 7) %if ! (0%{?rhel} >= 7)
make test TEST_FILES="$(echo $(find xt/ -name '*.t'))" make test TEST_FILES="$(echo $(find xt/ -name '*.t'))"
%else %else
make test TEST_FILES="$(echo $(find xt/release/ -name '*.t'))" make test TEST_FILES="$(echo $(find xt/release/ -name '*.t'))"
%endif %endif
%endif
%clean %clean
rm -rf %{buildroot} rm -rf %{buildroot}