From 510f6a79b6b04617e0d2cb8712826218c5c94e46 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= Date: Fri, 8 Dec 2017 10:16:12 +0100 Subject: [PATCH] Control additional tests with build conditions --- perl-Package-Stash-XS.spec | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/perl-Package-Stash-XS.spec b/perl-Package-Stash-XS.spec index 055810b..82add82 100644 --- a/perl-Package-Stash-XS.spec +++ b/perl-Package-Stash-XS.spec @@ -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}