Package tests
This commit is contained in:
parent
8e750a6af1
commit
e37c49bde9
@ -15,6 +15,7 @@ BuildRequires: coreutils
|
||||
BuildRequires: make
|
||||
BuildRequires: perl-generators
|
||||
BuildRequires: perl-interpreter
|
||||
BuildRequires: perl(Config)
|
||||
BuildRequires: perl(ExtUtils::MakeMaker) >= 6.76
|
||||
BuildRequires: perl(strict)
|
||||
BuildRequires: perl(warnings)
|
||||
@ -43,13 +44,12 @@ BuildRequires: perl(URI) >= 1.10
|
||||
BuildRequires: perl(Clone)
|
||||
%endif
|
||||
# Tests only:
|
||||
BuildRequires: perl(Config)
|
||||
BuildRequires: perl(File::Spec)
|
||||
BuildRequires: perl(lib)
|
||||
BuildRequires: perl(overload)
|
||||
BuildRequires: perl(PerlIO::encoding)
|
||||
BuildRequires: perl(Test::More)
|
||||
# Testing requires Time::Local on MacOS only
|
||||
BuildRequires: perl(Test::More) >= 0.88
|
||||
# Time::Local only used on MacOS
|
||||
BuildRequires: perl(Try::Tiny)
|
||||
Requires: perl(:MODULE_COMPAT_%(eval "`perl -V:version`"; echo $version))
|
||||
%if %{with perl_HTTP_Message_enables_Clone}
|
||||
@ -76,14 +76,32 @@ Conflicts: perl-libwww-perl < 6
|
||||
# Remove underspecified dependencies
|
||||
%global __requires_exclude %{?__requires_exclude:%__requires_exclude|}^perl\\((Exporter|HTTP::Date|URI)\\)$
|
||||
%global __provides_exclude %{?__provides_exclude:%__provides_exclude|}^perl\\(HTTP::Headers\\)$
|
||||
# Remove private modules and unused dependencies
|
||||
%global __requires_exclude %{__requires_exclude}|^perl\\((Secret|Time::Local)\\)
|
||||
%global __provides_exclude %{__provides_exclude}|^perl\\(Secret\\)$
|
||||
|
||||
%description
|
||||
The HTTP-Message distribution contains classes useful for representing the
|
||||
messages passed in HTTP style communication. These are classes representing
|
||||
requests, responses and the headers contained within them.
|
||||
|
||||
%package tests
|
||||
Summary: Tests for %{name}
|
||||
Requires: %{name} = %{?epoch:%{epoch}:}%{version}-%{release}
|
||||
Requires: coreutils
|
||||
Requires: perl-Test-Harness
|
||||
|
||||
%description tests
|
||||
Tests from %{name}. Execute them
|
||||
with "%{_libexecdir}/%{name}/test".
|
||||
|
||||
%prep
|
||||
%setup -q -n HTTP-Message-%{version}
|
||||
# Help generators to recognize Perl scripts
|
||||
for F in t/*.t; do
|
||||
perl -i -MConfig -ple 'print $Config{startperl} if $. == 1 && !s{\A#!\s*perl}{$Config{startperl}}' "$F"
|
||||
chmod +x "$F"
|
||||
done
|
||||
|
||||
%build
|
||||
perl Makefile.PL INSTALLDIRS=vendor NO_PACKLIST=1 NO_PERLLOCAL=1
|
||||
@ -91,9 +109,25 @@ perl Makefile.PL INSTALLDIRS=vendor NO_PACKLIST=1 NO_PERLLOCAL=1
|
||||
|
||||
%install
|
||||
%{make_install}
|
||||
# Install tests
|
||||
mkdir -p %{buildroot}/%{_libexecdir}/%{name}
|
||||
cp -a t %{buildroot}/%{_libexecdir}/%{name}
|
||||
cat > %{buildroot}/%{_libexecdir}/%{name}/test << 'EOF'
|
||||
#!/bin/bash
|
||||
set -e
|
||||
# t/status-old.t writes into CWD
|
||||
DIR=$(mktemp -d)
|
||||
cp -a %{_libexecdir}/%{name}/t "$DIR"
|
||||
pushd "$DIR"
|
||||
prove -I . -j "$(getconf _NPROCESSORS_ONLN)"
|
||||
popd
|
||||
rm -r "$DIR"
|
||||
EOF
|
||||
chmod +x %{buildroot}/%{_libexecdir}/%{name}/test
|
||||
%{_fixperms} %{buildroot}/*
|
||||
|
||||
%check
|
||||
export HARNESS_OPTIONS=j$(perl -e 'if ($ARGV[0] =~ /.*-j([0-9][0-9]*).*/) {print $1} else {print 1}' -- '%{?_smp_mflags}')
|
||||
make test
|
||||
|
||||
%files
|
||||
@ -102,9 +136,13 @@ make test
|
||||
%{perl_vendorlib}/*
|
||||
%{_mandir}/man3/*
|
||||
|
||||
%files tests
|
||||
%{_libexecdir}/%{name}
|
||||
|
||||
%changelog
|
||||
* Mon Feb 22 2021 Petr Pisar <ppisar@redhat.com> - 6.28-1
|
||||
- 6.28 bump
|
||||
- Package tests
|
||||
|
||||
* Wed Jan 27 2021 Fedora Release Engineering <releng@fedoraproject.org> - 6.27-2
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild
|
||||
|
||||
Loading…
Reference in New Issue
Block a user