public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
To: git-commits@fedoraproject.org
Subject: [rpms/perl-Tree-Simple] rawhide: Package the tests
Date: Fri, 05 Jun 2026 11:19:23 GMT	[thread overview]
Message-ID: <178065836308.1.2907388180406630623.rpms-perl-Tree-Simple-bbbe10ee8ffa@fedoraproject.org> (raw)

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

                 reply	other threads:[~2026-06-05 11:19 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=178065836308.1.2907388180406630623.rpms-perl-Tree-Simple-bbbe10ee8ffa@fedoraproject.org \
    --to=git-commits@fedoraproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox