Package tests
This commit is contained in:
parent
7cbc0e99fb
commit
ad8e4653be
|
@ -1,2 +1,3 @@
|
||||||
from Config import *
|
from Config import *
|
||||||
addFilter("spelling-error .* (Awaitable|subtests)");
|
addFilter("spelling-error .* (Awaitable|subtests)");
|
||||||
|
addFilter("-tests.noarch: W: no-documentation");
|
||||||
|
|
|
@ -68,7 +68,7 @@ Recommends: perl(Role::Tiny)
|
||||||
%endif
|
%endif
|
||||||
|
|
||||||
# Remove under-specified dependencies
|
# Remove under-specified dependencies
|
||||||
%global __requires_exclude %{?__requires_exclude:%{__requires_exclude}|}^perl\\((Future|Test::More)\\)$
|
%global __requires_exclude %{?__requires_exclude:%{__requires_exclude}|}^perl\\((Future|Syntax::Keyword::Try|Test::More)\\)$
|
||||||
|
|
||||||
%description
|
%description
|
||||||
This Perl module provides syntax for deferring and resuming subroutines while
|
This Perl module provides syntax for deferring and resuming subroutines while
|
||||||
|
@ -89,6 +89,34 @@ Future::AsyncAwait::Awaitable role. It runs tests that simulate various ways
|
||||||
in which Future::AsyncAwait will try to use an instance of this class, to
|
in which Future::AsyncAwait will try to use an instance of this class, to
|
||||||
check that the implementation is valid.
|
check that the implementation is valid.
|
||||||
|
|
||||||
|
%package tests
|
||||||
|
Summary: Tests for %{name}
|
||||||
|
BuildArch: noarch
|
||||||
|
Requires: %{name} = %{?epoch:%{epoch}:}%{version}-%{release}
|
||||||
|
Requires: %{name}-Test = %{?epoch:%{epoch}:}%{version}-%{release}
|
||||||
|
Requires: perl-Test-Harness
|
||||||
|
Requires: perl(Future) >= 0.43
|
||||||
|
%if %{with perl_Future_AsyncAwait_enables_role}
|
||||||
|
Requires: perl(Role::Tiny)
|
||||||
|
Requires: perl(Role::Tiny::With)
|
||||||
|
%endif
|
||||||
|
Requires: perl(Test::More) >= 0.88
|
||||||
|
%if %{with perl_Future_AsyncAwait_enables_optional_test}
|
||||||
|
%if %{with perl_Future_AsyncAwait_enables_Devel_MAT}
|
||||||
|
Requires: perl(Devel::MAT)
|
||||||
|
Requires: perl(Devel::MAT::Dumper)
|
||||||
|
%endif
|
||||||
|
Requires: perl(IO::Async::Loop)
|
||||||
|
Requires: perl(Object::Pad) >= 0.15
|
||||||
|
Requires: perl(Syntax::Keyword::Dynamically) >= 0.04
|
||||||
|
Requires: perl(Syntax::Keyword::Try) >= 0.18
|
||||||
|
Requires: perl(Test::Pod) >= 1.00
|
||||||
|
%endif
|
||||||
|
|
||||||
|
%description tests
|
||||||
|
Tests from %{name}. Execute them
|
||||||
|
with "%{_libexecdir}/%{name}/test".
|
||||||
|
|
||||||
%prep
|
%prep
|
||||||
%setup -q -n Future-AsyncAwait-%{version}
|
%setup -q -n Future-AsyncAwait-%{version}
|
||||||
for F in \
|
for F in \
|
||||||
|
@ -97,7 +125,7 @@ for F in \
|
||||||
%endif
|
%endif
|
||||||
%if !%{with perl_Future_AsyncAwait_enables_optional_test}
|
%if !%{with perl_Future_AsyncAwait_enables_optional_test}
|
||||||
t/80await+dynamically.t t/80await+try.t t/81async-method+dynamically.t \
|
t/80await+dynamically.t t/80await+try.t t/81async-method+dynamically.t \
|
||||||
t/81memory-growth.t \
|
t/81memory-growth.t t/99pod.t \
|
||||||
%endif
|
%endif
|
||||||
%if !%{with perl_Future_AsyncAwait_enables_role}
|
%if !%{with perl_Future_AsyncAwait_enables_role}
|
||||||
t/51awaitable-role.t \
|
t/51awaitable-role.t \
|
||||||
|
@ -106,6 +134,7 @@ for F in \
|
||||||
rm "$F"
|
rm "$F"
|
||||||
perl -i -ne 'print $_ unless m{^\Q'"$F"'\E}' MANIFEST
|
perl -i -ne 'print $_ unless m{^\Q'"$F"'\E}' MANIFEST
|
||||||
done
|
done
|
||||||
|
chmod +x t/*.t
|
||||||
|
|
||||||
%build
|
%build
|
||||||
perl Build.PL --installdirs=vendor --optimize="$RPM_OPT_FLAGS"
|
perl Build.PL --installdirs=vendor --optimize="$RPM_OPT_FLAGS"
|
||||||
|
@ -118,8 +147,20 @@ find $RPM_BUILD_ROOT -type f -name '*.bs' -size 0 -delete
|
||||||
# Move Test subpackage content to a noarch location
|
# Move Test subpackage content to a noarch location
|
||||||
install -m 0755 -d ${RPM_BUILD_ROOT}%{perl_vendorlib}
|
install -m 0755 -d ${RPM_BUILD_ROOT}%{perl_vendorlib}
|
||||||
mv ${RPM_BUILD_ROOT}%{perl_vendorarch}/Test ${RPM_BUILD_ROOT}%{perl_vendorlib}
|
mv ${RPM_BUILD_ROOT}%{perl_vendorarch}/Test ${RPM_BUILD_ROOT}%{perl_vendorlib}
|
||||||
|
# Install tests
|
||||||
|
mkdir -p %{buildroot}%{_libexecdir}/%{name}
|
||||||
|
cp -a t %{buildroot}%{_libexecdir}/%{name}
|
||||||
|
%if %{with perl_Future_AsyncAwait_enables_optional_test}
|
||||||
|
rm %{buildroot}%{_libexecdir}/%{name}/t/99pod.t
|
||||||
|
%endif
|
||||||
|
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
|
%check
|
||||||
|
export HARNESS_OPTIONS=j$(perl -e 'if ($ARGV[0] =~ /.*-j([0-9][0-9]*).*/) {print $1} else {print 1}' -- '%{?_smp_mflags}')
|
||||||
./Build test
|
./Build test
|
||||||
|
|
||||||
%files
|
%files
|
||||||
|
@ -135,9 +176,13 @@ mv ${RPM_BUILD_ROOT}%{perl_vendorarch}/Test ${RPM_BUILD_ROOT}%{perl_vendorlib}
|
||||||
%{perl_vendorlib}/Test
|
%{perl_vendorlib}/Test
|
||||||
%{_mandir}/man3/Test::*
|
%{_mandir}/man3/Test::*
|
||||||
|
|
||||||
|
%files tests
|
||||||
|
%{_libexecdir}/%{name}
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
* Thu Feb 25 2021 Petr Pisar <ppisar@redhat.com> - 0.49-1
|
* Thu Feb 25 2021 Petr Pisar <ppisar@redhat.com> - 0.49-1
|
||||||
- 0.49 bump
|
- 0.49 bump
|
||||||
|
- Package tests
|
||||||
|
|
||||||
* Wed Feb 03 2021 Petr Pisar <ppisar@redhat.com> - 0.48-1
|
* Wed Feb 03 2021 Petr Pisar <ppisar@redhat.com> - 0.48-1
|
||||||
- 0.48 bump
|
- 0.48 bump
|
||||||
|
|
Loading…
Reference in New Issue