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