Package test

This commit is contained in:
Jitka Plesnikova 2024-06-26 12:18:52 +02:00
parent 5541780d65
commit 47294fe07b
5 changed files with 57 additions and 2 deletions

1
.fmf/version Normal file
View File

@ -0,0 +1 @@
1

7
gating.yaml Normal file
View File

@ -0,0 +1,7 @@
# RHEL
--- !Policy
product_versions:
- rhel-*
decision_context: osci_compose_gate
rules:
- !PassingTestCaseRule {test_case_name: osci.brew-build.tier0.functional}

View File

@ -3,7 +3,7 @@
Name: perl-Algorithm-Diff
Version: %{upstream_version}%{?extra_version}
Release: 12%{?dist}
Release: 13%{?dist}
Summary: Compute 'intelligent' differences between two files/lists
License: GPL-1.0-or-later OR Artistic-1.0-Perl
URL: https://metacpan.org/release/Algorithm-Diff
@ -16,6 +16,7 @@ BuildRequires: findutils
BuildRequires: make
BuildRequires: perl-generators
BuildRequires: perl-interpreter
BuildRequires: perl(Config)
BuildRequires: perl(ExtUtils::MakeMaker)
BuildRequires: perl(warnings)
# Run-time:
@ -37,11 +38,26 @@ or any other two lists of things. It uses an intelligent algorithm similar to
(or identical to) the one used by the Unix "diff" program. It is guaranteed to
find the *smallest possible* set of differences.
%package tests
Summary: Tests for %{name}
Requires: %{name} = %{?epoch:%{epoch}:}%{version}-%{release}
Requires: perl-Test-Harness
%description tests
Tests from %{name}. Execute them
with "%{_libexecdir}/%{name}/test".
%prep
%setup -q -n Algorithm-Diff-%{upstream_version}
# Generate provide for perl(Algorithm::DiffOld)
%patch0
%patch -P0
# 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
@ -51,6 +67,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 -I . -j "$(getconf _NPROCESSORS_ONLN)"
EOF
chmod +x %{buildroot}%{_libexecdir}/%{name}/test
%check
make test
@ -61,7 +85,13 @@ make test
%{_mandir}/man3/Algorithm::Diff.3*
%{_mandir}/man3/Algorithm::DiffOld.3*
%files tests
%{_libexecdir}/%{name}
%changelog
* Tue Jun 25 2024 Jitka Plesnikova <jplesnik@redhat.com> - 1.2010-13
- Package tests
* Mon Jun 24 2024 Troy Dawson <tdawson@redhat.com> - 1.2010-12
- Bump release for June 2024 mass rebuild

5
plans/sanity.fmf Normal file
View File

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

12
tests/upstream-tests.fmf Normal file
View File

@ -0,0 +1,12 @@
summary: Upstream tests
contact: Jitka Plesnikova <jplesnik@redhat.com>
component: perl-Algorithm-Diff
require: perl-Algorithm-Diff-tests
test: /usr/libexec/perl-Algorithm-Diff/test
enabled: true
tag:
- rhel-buildroot
adjust:
- enabled: false
when: distro < rhel-10 or distro < centos-stream-10
continue: false