From 6bd31dc935aed6a3c63edd3a31ab4cff534199ad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= Date: Thu, 30 Jun 2022 14:07:07 +0200 Subject: [PATCH] Package the tests --- perl-Devel-ArgNames.rpmlintrc | 1 + perl-Devel-ArgNames.spec | 29 +++++++++++++++++++++++++++-- 2 files changed, 28 insertions(+), 2 deletions(-) create mode 100644 perl-Devel-ArgNames.rpmlintrc diff --git a/perl-Devel-ArgNames.rpmlintrc b/perl-Devel-ArgNames.rpmlintrc new file mode 100644 index 0000000..a5d5f5e --- /dev/null +++ b/perl-Devel-ArgNames.rpmlintrc @@ -0,0 +1 @@ +addFilter('-tests\.noarch: W: no-documentation') diff --git a/perl-Devel-ArgNames.spec b/perl-Devel-ArgNames.spec index 4edcf9a..e20d8cd 100644 --- a/perl-Devel-ArgNames.spec +++ b/perl-Devel-ArgNames.spec @@ -1,6 +1,6 @@ Name: perl-Devel-ArgNames Version: 0.03 -Release: 24%{?dist} +Release: 25%{?dist} Summary: Figure out the names of variables passed into subroutines License: GPL+ or Artistic URL: https://metacpan.org/release/Devel-ArgNames @@ -28,6 +28,16 @@ Requires: perl(:MODULE_COMPAT_%(eval "`perl -V:version`"; echo $version)) This Perl module provides a function which returns the names associated with the variables found on @_. +%package tests +Summary: Tests for %{name} +Requires: %{name} = %{?epoch:%{epoch}:}%{version}-%{release} +Requires: perl-Test-Harness +Requires: perl(Devel::ArgNames) + +%description tests +Tests from %{name}. Execute them +with "%{_libexecdir}/%{name}/test". + %prep %setup -q -n Devel-ArgNames-%{version} @@ -37,16 +47,31 @@ 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 %{perl_vendorlib}/* %{_mandir}/man3/* +%files tests +%{_libexecdir}/%{name} + %changelog +* Thu Jun 30 2022 Petr Pisar - 0.03-25 +- Package the tests + * Tue May 31 2022 Jitka Plesnikova - 0.03-24 - Perl 5.36 rebuild