diff --git a/perl-Package-Stash.spec b/perl-Package-Stash.spec index 4a602e4..01f5091 100644 --- a/perl-Package-Stash.spec +++ b/perl-Package-Stash.spec @@ -1,5 +1,17 @@ # We need to patch the test suite if we have an old version of Test::More %global old_test_more %(perl -MTest::More -e 'print (($Test::More::VERSION < 0.88) ? 1 : 0);' 2>/dev/null || echo 0) +# Run extra test +%if ! (0%{?rhel}) +%bcond_without perl_Package_Stash_enables_extra_test +%else +%bcond_with perl_Package_Stash_enables_extra_test +%endif +# Run optional test +%if ! (0%{?rhel}) +%bcond_without perl_Package_Stash_enables_optional_test +%else +%bcond_with perl_Package_Stash_enables_optional_test +%endif Name: perl-Package-Stash Version: 0.37 @@ -39,10 +51,12 @@ BuildRequires: perl(lib) BuildRequires: perl(Test::Fatal) BuildRequires: perl(Test::More) BuildRequires: perl(Test::Requires) -%if ! (0%{?rhel}) +%if %{with perl_Package_Stash_enables_optional_test} # Optional Tests BuildRequires: perl(Package::Anon) BuildRequires: perl(Variable::Magic) +%endif +%if %{with perl_Package_Stash_enables_extra_test} # Extra Tests BuildRequires: perl(Pod::Coverage::TrustPod) BuildRequires: perl(Test::EOL) @@ -84,7 +98,7 @@ find %{buildroot} -type f -name .packlist -exec rm -f {} \; %check make test # Extra Tests: Pod Coverage test fails due to lack of POD for Package::Stash::Conflicts -%if ! (0%{?rhel}) +%if %{with perl_Package_Stash_enables_extra_test} make test TEST_FILES="$(echo $(find xt/ -name '*.t' | grep -v pod-coverage))" %endif