Package tests

This commit is contained in:
Michal Josef Špaček 2021-05-11 17:08:58 +02:00
parent a572189779
commit 0ab3ac0f83
2 changed files with 34 additions and 0 deletions

View File

@ -1,2 +1,3 @@
from Config import *
addFilter("spelling-error .* (gethostbyaddr|gethostbyname)");
addFilter("-tests\.noarch: W: no-documentation");

View File

@ -115,10 +115,31 @@ Recommends: perl(IO::Socket::IP) >= 0.32
%description Nameserver
Instances of the "Net::DNS::Nameserver" class represent DNS server objects.
%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 Net-DNS-%{version}
chmod -x demo/*
perl -MConfig -i -pe 's{^#!/usr/local/bin/perl}{$Config{startperl}}' demo/*
# Remove author tests
for F in \
t/00-install.t \
t/00-pod.t \
; do
rm "$F"
perl -i -ne 'print $_ unless m{\A\Q'"$F"'\E}' MANIFEST
done
# Help generators to recognize Perl scripts
for F in t/*.t; do
chmod +x "$F"
done
%build
export PERL_MM_USE_DEFAULT=yes
@ -129,6 +150,14 @@ perl Makefile.PL INSTALLDIRS=vendor NO_PACKLIST=1 NO_PERLLOCAL=1 --no-online-tes
%{make_install}
find %{buildroot} -type f -name '*.bs' -a -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
@ -149,8 +178,12 @@ make test
%{perl_vendorlib}/Net/DNS/Nameserver.pm
%{_mandir}/man3/Net::DNS::Nameserver*
%files tests
%{_libexecdir}/%{name}
%changelog
* Tue Feb 22 2022 Michal Josef Špaček <mspacek@redhat.com> - 1.33-2
- Package tests
- Remove obsolete dependency to Net::DNS::SEC
There was dependency until 1.29 version and it was used for tests.