public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
* [rpms/perl-Tree-Simple] rawhide: Package the tests
@ 2026-06-05 11:19
0 siblings, 0 replies; only message in thread
From: @ 2026-06-05 11:19 UTC (permalink / raw)
To: git-commits
A new commit has been pushed.
Repo : rpms/perl-Tree-Simple
Branch : rawhide
Commit : bbbe10ee8ffa24770917dcaab448392b6e9ce2ec
Author : Petr Písař <ppisar@redhat.com>
Date : 2026-06-05T13:17:01+02:00
Stats : +33/-2 in 1 file(s)
URL : https://src.fedoraproject.org/rpms/perl-Tree-Simple/c/bbbe10ee8ffa24770917dcaab448392b6e9ce2ec?branch=rawhide
Log:
Package the tests
---
diff --git a/perl-Tree-Simple.spec b/perl-Tree-Simple.spec
index a601bcb..879c532 100644
--- a/perl-Tree-Simple.spec
+++ b/perl-Tree-Simple.spec
@@ -11,6 +11,7 @@ BuildRequires: make
BuildRequires: perl-generators
BuildRequires: perl-interpreter
BuildRequires: perl(:VERSION) >= 5.6
+BuildRequires: perl(Config)
BuildRequires: perl(ExtUtils::MakeMaker) >= 6.76
BuildRequires: perl(strict)
BuildRequires: perl(warnings)
@@ -25,7 +26,7 @@ BuildRequires: perl(Test::Memory::Cycle) >= 1.02
Requires: perl(Scalar::Util) >= 1.18
# Remove under-specified dependencies
-%global __requires_exclude %{?__requires_exclude:%{__requires_exclude}|}^perl\\(Scalar::Util\\)$
+%global __requires_exclude %{?__requires_exclude:%{__requires_exclude}|}^perl\\((Scalar::Util|Test::Exception|Test::More)\\)$
%description
This Perl module in an fully object-oriented implementation of a simple n-ary
@@ -34,8 +35,26 @@ every Tree::Simple object has both a parent and a set of children (who
themselves may have children, and so on). Every Tree::Simple object also has
siblings, as they are just the children of their immediate parent.
+%package tests
+Summary: Tests for %{name}
+Requires: %{name} = %{?epoch:%{epoch}:}%{version}-%{release}
+Requires: perl-Test-Harness
+Requires: perl(Scalar::Util) >= 1.18
+Requires: perl(Test::Exception) >= 0.15
+Requires: perl(Test::More) >= 1.001002
+Requires: perl(Test::Memory::Cycle) >= 1.02
+
+%description tests
+Tests from %{name}. Execute them
+with "%{_libexecdir}/%{name}/test".
+
%prep
%setup -q -n Tree-Simple-%{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
@@ -43,7 +62,15 @@ perl Makefile.PL INSTALLDIRS=vendor NO_PACKLIST=1 NO_PERLLOCAL=1
%install
%{make_install}
-chmod -R u+w $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}')
@@ -58,9 +85,13 @@ make test
%{_mandir}/man3/Tree::Simple.*
%{_mandir}/man3/Tree::Simple::*
+%files tests
+%{_libexecdir}/%{name}
+
%changelog
* Fri Jun 05 2026 Petr Pisar <ppisar@redhat.com> - 1.34-16
- Modernize a spec file
+- Package the tests
* Sat Jan 17 2026 Fedora Release Engineering <releng@fedoraproject.org> - 1.34-15
- Rebuilt for https://fedoraproject.org/wiki/Fedora_44_Mass_Rebuild
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2026-06-05 11:19 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-06-05 11:19 [rpms/perl-Tree-Simple] rawhide: Package the tests
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox