Package tests

This commit is contained in:
Jitka Plesnikova 2023-05-18 21:16:15 +02:00
parent 5d0b48cfb2
commit 2ec66980ea
5 changed files with 45 additions and 0 deletions

1
.fmf/version Normal file
View File

@ -0,0 +1 @@
1

7
gating.yaml Normal file
View File

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

View File

@ -35,6 +35,15 @@ Conflicts: perl < 4:5.22.0-347
This package provides Perl functions that can convert strings into various
Unicode normalization forms as defined in Unicode Standard Annex #15.
%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 Unicode-Normalize-%{base_version}
%patch -P0 -p1
@ -43,6 +52,12 @@ Unicode normalization forms as defined in Unicode Standard Annex #15.
perl -MDevel::PPPort \
-e 'Devel::PPPort::WriteFile() or die "Could not generate ppport.h: $!"'
# 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 NO_PACKLIST=1 NO_PERLLOCAL=1 OPTIMIZE="%{optflags}"
%{make_build}
@ -52,6 +67,15 @@ perl Makefile.PL INSTALLDIRS=vendor NO_PACKLIST=1 NO_PERLLOCAL=1 OPTIMIZE="%{opt
find %{buildroot} -type f -name '*.bs' -size 0 -delete
%{_fixperms} %{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
@ -62,9 +86,13 @@ make test
%{perl_vendorarch}/Unicode
%{_mandir}/man3/Unicode::Normalize*
%files tests
%{_libexecdir}/%{name}
%changelog
* Thu May 18 2023 Jitka Plesnikova <jplesnik@redhat.com> - 1.32-1
- Upgrade to 1.32 as provided in perl-5.37.11
- Package tests
* Fri Jan 20 2023 Fedora Release Engineering <releng@fedoraproject.org> - 1.31-490
- Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild

5
plans/sanity.fmf Normal file
View File

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

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

@ -0,0 +1,4 @@
summary: Upstream tests
component: perl-Unicode-Normalize
require: perl-Unicode-Normalize-tests
test: /usr/libexec/perl-Unicode-Normalize/test