Package tests

epel9
Michal Josef Špaček 4 years ago
parent 87bb86abfe
commit 6ef8178d2a

@ -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}

@ -1,2 +1,3 @@
from Config import *
addFilter("spelling-error %description -l en_US metamodels -> ")
addFilter("-tests\.noarch: W: no-documentation");

@ -1,6 +1,6 @@
Name: perl-Algorithm-C3
Version: 0.11
Release: 4%{?dist}
Release: 5%{?dist}
Summary: Module for merging hierarchies using the C3 algorithm
License: GPL+ or Artistic
URL: https://metacpan.org/release/Algorithm-C3
@ -22,14 +22,32 @@ BuildRequires: perl(Test::More) >= 0.47
# Runtime
Requires: perl(:MODULE_COMPAT_%(eval "`perl -V:version`"; echo $version))
# Remove under-specified dependencies
%global __requires_exclude %{?__requires_exclude:%{__requires_exclude}|}^perl\\((Test::More)\\)$
%description
This module implements the C3 algorithm. Most of the uses I have for C3
revolve around class building and metamodels but it could also be used for
things like dependency resolution as well since it tends to do such a nice
job of preserving local precedence orderings.
%package tests
Summary: Tests for %{name}
Requires: %{name} = %{?epoch:%{epoch}:}%{version}-%{release}
Requires: perl-Test-Harness
Requires: perl(Test::More) >= 0.47
%description tests
Tests from %{name}. Execute them
with "%{_libexecdir}/%{name}/test".
%prep
%setup -q -n Algorithm-C3-%{version}
# Help generators to recognize Perl scripts
for F in t/*.t; do
perl -i -MConfig -ple 'print $Config{startperl} if $. == 1 && !s{\A#!.*perl\b}{$Config{startperl}}' "$F"
chmod +x "$F"
done
%build
perl Makefile.PL INSTALLDIRS=vendor
@ -39,6 +57,14 @@ make %{?_smp_mflags}
make pure_install DESTDIR=%{buildroot}
find %{buildroot} -type f -name .packlist -delete
%{_fixperms} -c %{buildroot}
# Install tests
mkdir -p %{buildroot}%{_libexecdir}/%{name}
cp -a t %{buildroot}%{_libexecdir}/%{name}
cat > %{buildroot}%{_libexecdir}/%{name}/test << 'EOF'
#!/bin/sh
cd %{_libexecdir}/%{name} && exec prove -r -I . -j "$(getconf _NPROCESSORS_ONLN)"
EOF
chmod +x %{buildroot}%{_libexecdir}/%{name}/test
%check
make test
@ -49,7 +75,13 @@ make test
%{perl_vendorlib}/Algorithm/
%{_mandir}/man3/Algorithm::C3.3*
%files tests
%{_libexecdir}/%{name}
%changelog
* Tue Aug 03 2021 Michal Josef Špaček <mspacek@redhat.com> - 0.11-5
- Package tests
* Thu Jul 22 2021 Fedora Release Engineering <releng@fedoraproject.org> - 0.11-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild

@ -0,0 +1,5 @@
summary: Sanity tests
discover:
how: fmf
execute:
how: tmt

@ -0,0 +1,4 @@
summary: Upstream tests
component: perl-Algorithm-C3
require: perl-Algorithm-C3
test: /usr/libexec/perl-Algorithm-C3/test
Loading…
Cancel
Save