Package tests

This commit is contained in:
Jitka Plesnikova 2023-03-24 13:43:25 +01:00
parent 83c690539e
commit 8324e4b34a
5 changed files with 51 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

@ -15,6 +15,7 @@ BuildRequires: perl-devel
BuildRequires: perl-generators
BuildRequires: perl-interpreter
BuildRequires: perl(:VERSION) >= 5.6
BuildRequires: perl(Config)
BuildRequires: perl(ExtUtils::CBuilder) >= 0.15
BuildRequires: perl(Module::Build)
BuildRequires: perl(strict)
@ -37,13 +38,32 @@ Conflicts: perl(B::Hooks::OP::Check) < 0.19
%{?perl_default_filter}
# Filter modules bundled for tests
%global __provides_exclude_from %{?__provides_exclude_from:%__provides_exclude_from|}^%{_libexecdir}
%global __requires_exclude %{?__requires_exclude:%__requires_exclude|}^perl\\(t::code.*\\)
%description
This module implements lexical scoping of static variables and subroutines.
Although it can be used directly, it is mainly intended to be
infrastructure for modules that manage name spaces.
%package tests
Summary: Tests for %{name}
BuildArch: noarch
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 Lexical-Var-%{version}
# Help generators to recognize Perl scripts
for F in `find t -name *.t`; do
perl -i -MConfig -ple 'print $Config{startperl} if $. == 1 && !s{\A#!.*perl\b}{$Config{startperl}}' "$F"
chmod +x "$F"
done
%build
perl Build.PL --installdirs=vendor --optimize="$RPM_OPT_FLAGS"
@ -54,6 +74,16 @@ perl Build.PL --installdirs=vendor --optimize="$RPM_OPT_FLAGS"
find $RPM_BUILD_ROOT -type f -name '*.bs' -empty -delete
%{_fixperms} -c $RPM_BUILD_ROOT
# Install tests
mkdir -p %{buildroot}%{_libexecdir}/%{name}
cp -a t %{buildroot}%{_libexecdir}/%{name}
rm %{buildroot}%{_libexecdir}/%{name}/t/pod_*.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
./Build test
@ -63,9 +93,13 @@ find $RPM_BUILD_ROOT -type f -name '*.bs' -empty -delete
%{perl_vendorarch}/Lexical*
%{_mandir}/man3/*
%files tests
%{_libexecdir}/%{name}
%changelog
* Fri Mar 24 2023 Jitka Plesnikova <jplesnik@redhat.com> - 0.010-1
- 0.010 bump
- Package tests
* Fri Jan 20 2023 Fedora Release Engineering <releng@fedoraproject.org> - 0.009-31
- 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-Lexical-Var
require: perl-Lexical-Var-tests
test: /usr/libexec/perl-Lexical-Var/test