Package tests
This commit is contained in:
parent
aef6dd7852
commit
529366b11d
1
.fmf/version
Normal file
1
.fmf/version
Normal file
@ -0,0 +1 @@
|
||||
1
|
||||
7
gating.yaml
Normal file
7
gating.yaml
Normal 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}
|
||||
@ -13,6 +13,7 @@ BuildRequires: make
|
||||
BuildRequires: perl-generators
|
||||
%endif
|
||||
BuildRequires: perl-interpreter >= 4:5.22.0-351
|
||||
BuildRequires: perl(Config)
|
||||
BuildRequires: perl(ExtUtils::MakeMaker) >= 6.76
|
||||
BuildRequires: perl(File::Copy)
|
||||
BuildRequires: perl(File::Find)
|
||||
@ -44,12 +45,39 @@ Recommends: perl(version)
|
||||
# The generators and attribute files were split from rpm-build
|
||||
Conflicts: rpm-build < 4.11.2-15
|
||||
|
||||
# Filter modules bundled for tests
|
||||
%global __provides_exclude_from %{?__provides_exclude_from:%__provides_exclude_from|}^%{_libexecdir}
|
||||
%global __requires_exclude %{?__requires_exclude:%__requires_exclude|}^perl\\(PerlNS\\)
|
||||
|
||||
%description
|
||||
This package provides RPM Perl dependencies generators which are used for
|
||||
getting provides and requires from Perl binaries and modules.
|
||||
|
||||
%package tests
|
||||
Summary: Tests for %{name}
|
||||
Requires: %{name} = %{?epoch:%{epoch}:}%{version}-%{release}
|
||||
Requires: perl-Test-Harness
|
||||
%if %{defined perl_bootstrap}
|
||||
# Supply run-time dependencies manually when perl-generators is not available
|
||||
Requires: perl(Exporter)
|
||||
Requires: perl(lib)
|
||||
Requires: perl(strict)
|
||||
Requires: perl(Test::More)
|
||||
Requires: perl(Test::Simple)
|
||||
Requires: perl(warnings)
|
||||
%endif
|
||||
|
||||
%description tests
|
||||
Tests from %{name}. Execute them
|
||||
with "%{_libexecdir}/%{name}/test".
|
||||
|
||||
%prep
|
||||
%setup -q -n generators-%{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 INSTALLVENDORSCRIPT=%{_rpmconfigdir} \
|
||||
@ -63,6 +91,16 @@ perl Makefile.PL INSTALLDIRS=vendor INSTALLVENDORSCRIPT=%{_rpmconfigdir} \
|
||||
mkdir -p %{buildroot}%{_rpmconfigdir}/fileattrs/
|
||||
install -p -m 644 fileattrs/* '%{buildroot}%{_rpmconfigdir}/fileattrs'
|
||||
|
||||
# Install tests
|
||||
mkdir -p %{buildroot}%{_libexecdir}/%{name}
|
||||
cp -a t %{buildroot}%{_libexecdir}/%{name}
|
||||
perl -i -pe "s{bin/perl}{%{_rpmconfigdir}/perl}" %{buildroot}%{_libexecdir}/%{name}/t/lib/PerlNS.pm
|
||||
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
|
||||
|
||||
@ -71,9 +109,13 @@ make test
|
||||
%{_rpmconfigdir}/perl*
|
||||
%{_rpmconfigdir}/fileattrs/perl*.attr
|
||||
|
||||
%files tests
|
||||
%{_libexecdir}/%{name}
|
||||
|
||||
%changelog
|
||||
* Tue Dec 06 2022 Jitka Plesnikova <jplesnik@redhat.com> - 1.15-1
|
||||
- 1.15 bump
|
||||
- Package tests
|
||||
|
||||
* Tue Aug 16 2022 Jitka Plesnikova <jplesnik@redhat.com> - 1.14-1
|
||||
- 1.14 bump
|
||||
|
||||
5
plans/sanity.fmf
Normal file
5
plans/sanity.fmf
Normal file
@ -0,0 +1,5 @@
|
||||
summary: Sanity tests
|
||||
discover:
|
||||
how: fmf
|
||||
execute:
|
||||
how: tmt
|
||||
4
tests/upstream-tests.fmf
Normal file
4
tests/upstream-tests.fmf
Normal file
@ -0,0 +1,4 @@
|
||||
summary: Upstream tests
|
||||
component: perl-generators
|
||||
require: perl-generators-tests
|
||||
test: /usr/libexec/perl-generators/test
|
||||
Loading…
Reference in New Issue
Block a user