diff --git a/.fmf/version b/.fmf/version new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/.fmf/version @@ -0,0 +1 @@ +1 diff --git a/gating.yaml b/gating.yaml new file mode 100644 index 0000000..282e16b --- /dev/null +++ b/gating.yaml @@ -0,0 +1,7 @@ +--- !Policy +product_versions: + - fedora-* +decision_context: bodhi_update_push_stable +subject_type: koji_build +rules: + - !PassingTestCaseRule {test_case_name: fedora-ci.koji-build.tier0.functional} diff --git a/perl-Math-BigInt-GMP.spec b/perl-Math-BigInt-GMP.spec index a3a0fb5..ea1ff05 100644 --- a/perl-Math-BigInt-GMP.spec +++ b/perl-Math-BigInt-GMP.spec @@ -24,7 +24,7 @@ BuildRequires: perl(XSLoader) >= 0.02 BuildRequires: perl(Config) BuildRequires: perl(Exporter) BuildRequires: perl(Math::BigFloat) >= 1.994 -BuildRequires: perl(Math::BigInt) >= 1.999817 +BuildRequires: perl(Math::BigInt) >= 1.999819 BuildRequires: perl(Storable) BuildRequires: perl(Test::More) >= 0.88 BuildRequires: perl(threads) @@ -34,6 +34,10 @@ Requires: perl(:MODULE_COMPAT_%(eval "`perl -V:version`"; echo $version)) %{?perl_default_filter} +# Filter modules bundled for tests +%global __requires_exclude %{?__requires_exclude:%__requires_exclude|}perl\\(.::t/.*.inc\\) +%global __provides_exclude_from %{?__provides_exclude_from:%__provides_exclude_from|}^%{_libexecdir} + %description Provides support for big integer calculations by means of the GMP library, as a replacement (drop-in) module for Math::BigInt's core, Math::BigInt::Calc.pm. @@ -41,6 +45,16 @@ Math::BigInt::GMP does not use Math::GMP, but provides its own XS layer to access the GMP library. This cuts out another (perl subroutine) layer and also reduces the memory footprint by not loading Math::GMP and Carp at all. +%package tests +Summary: Tests for %{name} +Requires: %{name} = %{?epoch:%{epoch}:}%{version}-%{release} +Requires: perl-Test-Harness +Requires: perl(Math::BigInt) >= 1.999819 + +%description tests +Tests from %{name}. Execute them +with "%{_libexecdir}/%{name}/test". + %prep %setup -q -n Math-BigInt-GMP-%{version} @@ -65,8 +79,19 @@ perl Makefile.PL \ find %{buildroot} -type f -name '*.bs' -empty -delete %{_fixperms} -c %{buildroot} +# Install tests +mkdir -p %{buildroot}%{_libexecdir}/%{name} +cp -a t %{buildroot}%{_libexecdir}/%{name} +rm %{buildroot}%{_libexecdir}/%{name}/t/00sig.t +cat > %{buildroot}%{_libexecdir}/%{name}/test << 'EOF' +#!/bin/sh +cd %{_libexecdir}/%{name} && exec prove -I . -j "$(getconf _NPROCESSORS_ONLN)" +EOF +chmod +x %{buildroot}%{_libexecdir}/%{name}/test + %check unset TEST_SIGNATURE +export HARNESS_OPTIONS=j$(perl -e 'if ($ARGV[0] =~ /.*-j([0-9][0-9]*).*/) {print $1} else {print 1}' -- '%{?_smp_mflags}') make test %files @@ -76,9 +101,13 @@ make test %{perl_vendorarch}/Math/ %{_mandir}/man3/Math::BigInt::GMP.3* +%files tests +%{_libexecdir}/%{name} + %changelog * Wed Jul 07 2021 Jitka Plesnikova - 1.6008-1 - 1.6008 bump +- Package tests * Fri May 21 2021 Jitka Plesnikova - 1.6007-6 - Perl 5.34 rebuild diff --git a/plans/sanity.fmf b/plans/sanity.fmf new file mode 100644 index 0000000..a72ded4 --- /dev/null +++ b/plans/sanity.fmf @@ -0,0 +1,5 @@ +summary: Sanity tests +discover: + how: fmf +execute: + how: tmt diff --git a/tests/upstream-tests.fmf b/tests/upstream-tests.fmf new file mode 100644 index 0000000..469ca50 --- /dev/null +++ b/tests/upstream-tests.fmf @@ -0,0 +1,4 @@ +summary: Upstream tests +component: perl-Math-BigInt-GMP +require: perl-Math-BigInt-GMP-tests +test: /usr/libexec/perl-Math-BigInt-GMP/test