Package tests
This commit is contained in:
parent
51ebbc66a1
commit
8102eaff38
1
.fmf/version
Normal file
1
.fmf/version
Normal file
@ -0,0 +1 @@
|
|||||||
|
1
|
@ -1,6 +1,3 @@
|
|||||||
# Run optional test
|
|
||||||
%bcond_without perl_Module_CoreList_enables_optional_test
|
|
||||||
|
|
||||||
Name: perl-Module-CoreList
|
Name: perl-Module-CoreList
|
||||||
# Epoch to compete with perl.spec
|
# Epoch to compete with perl.spec
|
||||||
Epoch: 1
|
Epoch: 1
|
||||||
@ -28,10 +25,6 @@ BuildRequires: perl(List::Util)
|
|||||||
BuildRequires: perl(version) >= 0.88
|
BuildRequires: perl(version) >= 0.88
|
||||||
# Tests:
|
# Tests:
|
||||||
BuildRequires: perl(Test::More)
|
BuildRequires: perl(Test::More)
|
||||||
# Optional tests:
|
|
||||||
%if %{with perl_Module_CoreList_enables_optional_test} && !%{defined perl_bootstrap}
|
|
||||||
BuildRequires: perl(Test::Pod) >= 1.00
|
|
||||||
%endif
|
|
||||||
Requires: perl(:MODULE_COMPAT_%(eval "`perl -V:version`"; echo $version))
|
Requires: perl(:MODULE_COMPAT_%(eval "`perl -V:version`"; echo $version))
|
||||||
Requires: perl(List::Util)
|
Requires: perl(List::Util)
|
||||||
Requires: perl(version) >= 0.88
|
Requires: perl(version) >= 0.88
|
||||||
@ -56,20 +49,55 @@ Conflicts: perl-Module-CoreList < 1:5.20140914
|
|||||||
This package provides a corelist(1) tool which can be used to query what
|
This package provides a corelist(1) tool which can be used to query what
|
||||||
modules were shipped with given perl version.
|
modules were shipped with given perl version.
|
||||||
|
|
||||||
|
%package tests
|
||||||
|
Summary: Tests for %{name}
|
||||||
|
Requires: %{name} = %{?epoch:%{epoch}:}%{version}-%{release}
|
||||||
|
Requires: %{name}-tools = %{?epoch:%{epoch}:}%{version}-%{release}
|
||||||
|
Requires: perl-Test-Harness
|
||||||
|
|
||||||
|
%description tests
|
||||||
|
Tests from %{name}-%{version}. Execute them
|
||||||
|
with "%{_libexecdir}/%{name}/test".
|
||||||
|
|
||||||
%prep
|
%prep
|
||||||
%setup -q -n Module-CoreList-%{version}
|
%setup -q -n Module-CoreList-%{version}
|
||||||
|
|
||||||
|
# Help file to recognise the Perl scripts and normalize shebangs
|
||||||
|
for F in t/*.t; do
|
||||||
|
if head -1 "$F" | grep -q -e '^#!.*perl' ; then
|
||||||
|
perl -MConfig -pi -e 's|^#!.*perl\b|$Config{startperl}|' "$F"
|
||||||
|
else
|
||||||
|
perl -i -MConfig -ple 'print $Config{startperl} if $. == 1' "$F"
|
||||||
|
fi
|
||||||
|
chmod +x "$F"
|
||||||
|
done
|
||||||
|
|
||||||
|
# Remove release tests
|
||||||
|
rm t/pod.t
|
||||||
|
perl -i -ne 'print $_ unless m{^t/pod\.t}' MANIFEST
|
||||||
|
|
||||||
%build
|
%build
|
||||||
perl Makefile.PL INSTALLDIRS=vendor NO_PACKLIST=1 NO_PERLLOCAL=1
|
perl Makefile.PL INSTALLDIRS=vendor NO_PACKLIST=1 NO_PERLLOCAL=1
|
||||||
%{make_build}
|
%{make_build}
|
||||||
|
|
||||||
%install
|
%install
|
||||||
%{make_install}
|
%{make_install}
|
||||||
|
|
||||||
|
# Install tests
|
||||||
|
mkdir -p %{buildroot}/%{_libexecdir}/%{name}
|
||||||
|
cp -a t %{buildroot}/%{_libexecdir}/%{name}
|
||||||
|
cat > %{buildroot}/%{_libexecdir}/%{name}/test << 'EOF'
|
||||||
|
#!/bin/sh
|
||||||
|
unset PERL_CORE
|
||||||
|
cd %{_libexecdir}/%{name} && exec prove -I . -j "$(getconf _NPROCESSORS_ONLN)"
|
||||||
|
EOF
|
||||||
|
chmod +x %{buildroot}/%{_libexecdir}/%{name}/test
|
||||||
|
|
||||||
%{_fixperms} $RPM_BUILD_ROOT/*
|
%{_fixperms} $RPM_BUILD_ROOT/*
|
||||||
|
|
||||||
%check
|
%check
|
||||||
unset PERL_CORE
|
unset PERL_CORE
|
||||||
|
export HARNESS_OPTIONS=j$(perl -e 'if ($ARGV[0] =~ /.*-j([0-9][0-9]*).*/) {print $1} else {print 1}' -- '%{?_smp_mflags}')
|
||||||
make test
|
make test
|
||||||
|
|
||||||
%files
|
%files
|
||||||
@ -82,9 +110,13 @@ make test
|
|||||||
%{_bindir}/corelist
|
%{_bindir}/corelist
|
||||||
%{_mandir}/man1/corelist.*
|
%{_mandir}/man1/corelist.*
|
||||||
|
|
||||||
|
%files tests
|
||||||
|
%{_libexecdir}/%{name}
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
* Mon Feb 22 2021 Jitka Plesnikova <jplesnik@redhat.com> - 1:5.20210220-1
|
* Mon Feb 22 2021 Jitka Plesnikova <jplesnik@redhat.com> - 1:5.20210220-1
|
||||||
- 5.20210220 bump
|
- 5.20210220 bump
|
||||||
|
- Package tests
|
||||||
|
|
||||||
* Wed Jan 27 2021 Fedora Release Engineering <releng@fedoraproject.org> - 1:5.20210123-2
|
* Wed Jan 27 2021 Fedora Release Engineering <releng@fedoraproject.org> - 1:5.20210123-2
|
||||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild
|
- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild
|
||||||
|
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-Module-CoreList
|
||||||
|
require: perl-Module-CoreList-tests
|
||||||
|
test: /usr/libexec/perl-Module-CoreList/test
|
Loading…
Reference in New Issue
Block a user