Package tests

This commit is contained in:
Petr Písař 2021-03-09 09:55:23 +01:00
parent ce1214051a
commit 5fe0516f55
2 changed files with 29 additions and 0 deletions

View File

@ -0,0 +1,2 @@
from Config import *
addFilter("-tests.noarch: W: no-documentation");

View File

@ -119,6 +119,15 @@ Why? It's dependency free, requires zero configuration, and stands alone
but it's maintainable and extensible with plug-ins and friendly to shell
scripting. When running, it requires only 10 MB of RAM.
%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 App-cpanminus-%{version}
# Unbundle fat-packed modules
@ -132,6 +141,12 @@ done
%patch0 -p1
# Help generators to recognize Perl scripts
for F in t/*.t; do
perl -i -MConfig -ple 'print $Config{startperl} if $. == 1' "$F"
chmod +x "$F"
done
%build
perl Makefile.PL INSTALLDIRS=vendor NO_PACKLIST=1 NO_PERLLOCAL=1
%{make_build}
@ -139,6 +154,14 @@ perl Makefile.PL INSTALLDIRS=vendor NO_PACKLIST=1 NO_PERLLOCAL=1
%install
%{make_install}
%{_fixperms} %{buildroot}/*
# Install tests
mkdir -p %{buildroot}%{_libexecdir}/%{name}
cp -a t %{buildroot}%{_libexecdir}/%{name}
cat > %{buildroot}%{_libexecdir}/%{name}/test << 'EOF'
#!/bin/bash
cd %{_libexecdir}/%{name} && exec prove -I . -j "$(getconf _NPROCESSORS_ONLN)"
EOF
chmod +x %{buildroot}%{_libexecdir}/%{name}/test
%check
make test
@ -151,9 +174,13 @@ make test
%{_mandir}/man1/*
%{_bindir}/cpanm
%files tests
%{_libexecdir}/%{name}
%changelog
* Tue Mar 09 2021 Petr Pisar <ppisar@redhat.com> - 1.7044-12
- Correct an SHA version in a message
- Package tests
* Tue Jan 26 2021 Fedora Release Engineering <releng@fedoraproject.org> - 1.7044-11
- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild