| |
@@ -1,11 +1,12 @@
|
| |
Name: perl-Test-Timer
|
| |
- Version: 2.11
|
| |
- Release: 7%{?dist}
|
| |
+ Version: 2.12
|
| |
+ Release: 1%{?dist}
|
| |
Summary: Test module to test/assert response times
|
| |
License: Artistic 2.0
|
| |
URL: https://metacpan.org/release/Test-Timer
|
| |
Source0: https://cpan.metacpan.org/authors/id/J/JO/JONASBN/Test-Timer-%{version}.tar.gz
|
| |
BuildArch: noarch
|
| |
+ BuildRequires: coreutils
|
| |
BuildRequires: make
|
| |
BuildRequires: perl-generators
|
| |
BuildRequires: perl-interpreter
|
| |
@@ -36,31 +37,71 @@
|
| |
BuildRequires: perl(Test::Tester) >= 1.302111
|
| |
Requires: perl(:MODULE_COMPAT_%(eval "`perl -V:version`"; echo $version))
|
| |
|
| |
+ # Filter modules bundled for tests
|
| |
+ %global __requires_exclude %{?__requires_exclude:%__requires_exclude|}perl\\(Test::Timer::Test\\)
|
| |
+ %global __provides_exclude_from %{?__provides_exclude_from:%__provides_exclude_from|}^%{_libexecdir}
|
| |
+
|
| |
%description
|
| |
Test::Timer implements a set of test primitives to test and assert test
|
| |
times from bodies of code.
|
| |
|
| |
+ %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 Test-Timer-%{version}
|
| |
|
| |
+ # Help generators to recognize Perl scripts
|
| |
+ for F in t/*.t; do
|
| |
+ perl -i -MConfig -ple 'print $Config{startperl} if $. == 1 && !s{\A#!.*perl\b}{$Config{startperl}}' "$F"
|
| |
+ chmod +x "$F"
|
| |
+ done
|
| |
+
|
| |
%build
|
| |
perl Makefile.PL INSTALLDIRS=vendor NO_PACKLIST=1 NO_PERLLOCAL=1
|
| |
%{make_build}
|
| |
|
| |
%install
|
| |
%{make_install}
|
| |
- %{_fixperms} $RPM_BUILD_ROOT/*
|
| |
+ %{_fixperms} %{buildroot}/*
|
| |
+
|
| |
+ # Install tests
|
| |
+ mkdir -p %{buildroot}%{_libexecdir}/%{name}
|
| |
+ cp -a t %{buildroot}%{_libexecdir}/%{name}
|
| |
+ # Remove author and release tests
|
| |
+ rm %{buildroot}%{_libexecdir}/%{name}/t/author*
|
| |
+ rm %{buildroot}%{_libexecdir}/%{name}/t/release*
|
| |
+ 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
|
| |
+ unset AUTHOR_TESTING RELEASE_TESTING
|
| |
+ export HARNESS_OPTIONS=j$(perl -e 'if ($ARGV[0] =~ /.*-j([0-9][0-9]*).*/) {print $1} else {print 1}' -- '%{?_smp_mflags}')
|
| |
make test
|
| |
|
| |
%files
|
| |
%license LICENSE
|
| |
- %doc Changes README
|
| |
+ %doc CHANGELOG.md README
|
| |
%{perl_vendorlib}/*
|
| |
%{_mandir}/man3/*
|
| |
|
| |
+ %files tests
|
| |
+ %{_libexecdir}/%{name}
|
| |
+
|
| |
%changelog
|
| |
+ * Fri Jul 09 2021 Jitka Plesnikova <jplesnik@redhat.com> - 2.12-1
|
| |
+ - 2.12 bump
|
| |
+ - Package tests
|
| |
+
|
| |
* Fri May 21 2021 Jitka Plesnikova <jplesnik@redhat.com> - 2.11-7
|
| |
- Perl 5.34 rebuild
|
| |
|
| |