Package the tests

f38
Petr Písař 3 years ago
parent 5c250281b9
commit 1a45f0b621

@ -35,13 +35,28 @@ Requires: perl(overload)
Requires: perl(Sub::Exporter::Progressive) >= 0.001006
# Remove under-specified dependencies
%global __requires_exclude %{?__requires_exclude:%__requires_exclude|}^perl\\(Sub::Exporter::Progressive\\)$
%global __requires_exclude %{?__requires_exclude:%__requires_exclude|}^perl\\((Sub::Exporter::Progressive|Test::More|Test::Requires)\\)$
%description
This is a lightweight module which provides 'Junction' operators, the most
commonly used being any and all. Inspired by the Perl6 design docs,
<http://dev.perl.org/perl6/doc/design/exe/E06.html>.
%package tests
Summary: Tests for %{name}
Requires: %{name} = %{?epoch:%{epoch}:}%{version}-%{release}
Requires: perl-Test-Harness
Requires: perl(Test::More) >= 0.88
Requires: perl(Test::Requires) >= 0.07
%if %{with perl_Syntax_Keyword_Junction_enables_optional_test}
Requires: perl(if)
Requires: perl(Sub::Exporter) >= 0.986
%endif
%description tests
Tests from %{name}. Execute them
with "%{_libexecdir}/%{name}/test".
%prep
%setup -q -n Syntax-Keyword-Junction-%{version}
for F in t/release-pod-syntax.t \
@ -59,9 +74,18 @@ perl Makefile.PL INSTALLDIRS=vendor NO_PACKLIST=1 NO_PERLLOCAL=1
%install
%{make_install}
%{_fixperms} $RPM_BUILD_ROOT/*
%{_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
export HARNESS_OPTIONS=j$(perl -e 'if ($ARGV[0] =~ /.*-j([0-9][0-9]*).*/) {print $1} else {print 1}' -- '%{?_smp_mflags}')
make test
%files
@ -70,9 +94,13 @@ make test
%{perl_vendorlib}/*
%{_mandir}/man3/*
%files tests
%{_libexecdir}/%{name}
%changelog
* Mon Jan 10 2022 Petr Pisar <ppisar@redhat.com> - 0.003008-22
- Modernize a spec file
- Package the tests
* Thu Jul 22 2021 Fedora Release Engineering <releng@fedoraproject.org> - 0.003008-21
- Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild

Loading…
Cancel
Save