Package tests

This commit is contained in:
Jitka Plesnikova 2024-07-12 10:22:50 +02:00
parent 00ede1a879
commit 7a931f64bb
5 changed files with 58 additions and 5 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-gettext
Version: 1.07
Release: 32%{?dist}
Release: 33%{?dist}
Summary: Interface to gettext family of functions
License: GPL-1.0-or-later OR Artistic-1.0-Perl
@ -16,6 +16,7 @@ BuildRequires: %{__perl}
BuildRequires: perl-devel
BuildRequires: perl-generators
BuildRequires: perl(Config)
BuildRequires: perl(ExtUtils::MakeMaker)
BuildRequires: gettext
# Run-time:
@ -33,12 +34,15 @@ BuildRequires: perl(Test)
# Testsuite fails w/ LANG=C.UTF-8 on fedora >= 40
BuildRequires: glibc-langpack-en
# Filter modules bundled for tests
%global __provides_exclude_from %{?__provides_exclude_from:%__provides_exclude_from|}^%{_libexecdir}
%global __requires_exclude %{?__requires_exclude:%__requires_exclude|}^perl\\(test_data.*\\)
%description
The gettext module permits access from perl to the gettext() family of
functions for retrieving message strings from databases constructed to
internationalize software.
%package -n perl-%{tarname}
Summary: %{summary}
@ -47,32 +51,56 @@ The gettext module permits access from perl to the gettext() family of
functions for retrieving message strings from databases constructed to
internationalize software.
%package -n perl-%{tarname}-tests
Summary: Tests for %{name}
Requires: perl-%{tarname} = %{?epoch:%{epoch}:}%{version}-%{release}
Requires: perl-Test-Harness
%description -n perl-%{tarname}-tests
Tests from perl-%{tarname}. Execute them
with "%{_libexecdir}/perl-%{tarname}/test".
%prep
%setup -q -n %{tarname}-%{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 OPTIMIZE="$RPM_OPT_FLAGS" NO_PACKLIST=1 NO_PERLLOCAL=1
%{make_build}
%install
%{make_install}
%{_fixperms} $RPM_BUILD_ROOT/*
# Install tests
mkdir -p $RPM_BUILD_ROOT%{_libexecdir}/perl-%{tarname}
cp -a t test_data $RPM_BUILD_ROOT%{_libexecdir}/perl-%{tarname}
cat > $RPM_BUILD_ROOT%{_libexecdir}/perl-%{tarname}/test << 'EOF'
#!/bin/sh
cd %{_libexecdir}/perl-%{tarname} && exec prove -I . -j "$(getconf _NPROCESSORS_ONLN)"
EOF
chmod +x $RPM_BUILD_ROOT%{_libexecdir}/perl-%{tarname}/test
%check
# Testsuite fails w/ LANG=C.UTF-8 on fedora >= 40
LANG=en_US.UTF-8 %{__make} test
%files -n perl-%{tarname}
%doc README
%{perl_vendorarch}/auto/Locale
%{perl_vendorarch}/Locale
%{_mandir}/man3/*.3*
%files -n perl-%{tarname}-tests
%{_libexecdir}/perl-%{tarname}
%changelog
* Fri Jul 12 2024 Jitka Plesnikova <jplesnik@redhat.com> - 1.07-33
- Package tests
* Mon Jun 24 2024 Troy Dawson <tdawson@redhat.com> - 1.07-32
- 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-Locale-gettext
require: perl-Locale-gettext-tests
test: /usr/libexec/perl-Locale-gettext/test
enabled: true
tag:
- rhel-buildroot
adjust:
- enabled: false
when: distro < rhel-10 or distro < centos-stream-10
continue: false