public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
To: git-commits@fedoraproject.org
Subject: [rpms/perl-Shell-Config-Generate] f44: Package the tests
Date: Mon, 07 Sep 2026 11:25:48 GMT	[thread overview]
Message-ID: <178878034849.1.17033510949494563291.rpms-perl-Shell-Config-Generate-3a3aa5ace2dd@fedoraproject.org> (raw)

A new commit has been pushed.

Repo   : rpms/perl-Shell-Config-Generate
Branch : f44
Commit : 3a3aa5ace2dd2ba32f7395d41586a5ffa8ab9539
Author : Petr Písař <ppisar@redhat.com>
Date   : 2026-09-07T13:25:06+02:00
Stats  : +46/-7 in 2 file(s)
URL    : https://src.fedoraproject.org/rpms/perl-Shell-Config-Generate/c/3a3aa5ace2dd2ba32f7395d41586a5ffa8ab9539?branch=f44

Log:
Package the tests

---
diff --git a/perl-Shell-Config-Generate.rpmlintrc b/perl-Shell-Config-Generate.rpmlintrc
index 774a6e6..4df9145 100644
--- a/perl-Shell-Config-Generate.rpmlintrc
+++ b/perl-Shell-Config-Generate.rpmlintrc
@@ -1,2 +1,2 @@
-from Config import *
-addFilter("spelling-error .* (cmd|csh|exe|Portably)");
+addFilter('spelling-error .* (cmd|csh|exe|Portably)')
+addFilter('-tests\.noarch: W: no-documentation')

diff --git a/perl-Shell-Config-Generate.spec b/perl-Shell-Config-Generate.spec
index 1c2837d..56e7a95 100644
--- a/perl-Shell-Config-Generate.spec
+++ b/perl-Shell-Config-Generate.spec
@@ -11,6 +11,7 @@ BuildRequires:  make
 BuildRequires:  perl-generators
 BuildRequires:  perl-interpreter
 BuildRequires:  perl(:VERSION) >= 5.8.1
+BuildRequires:  perl(Config)
 BuildRequires:  perl(ExtUtils::MakeMaker) >= 6.76
 BuildRequires:  perl(strict)
 BuildRequires:  perl(warnings)
@@ -20,14 +21,12 @@ BuildRequires:  perl(Exporter)
 BuildRequires:  perl(Shell::Guess) >= 0.02
 # Tests:
 BuildRequires:  perl(base)
-BuildRequires:  perl(Config)
 BuildRequires:  perl(constant)
 BuildRequires:  perl(Data::Dumper)
 BuildRequires:  perl(Env)
 BuildRequires:  perl(File::Spec)
 BuildRequires:  perl(File::Temp)
-BuildRequires:  perl(FindBin)
-# IPC::Open3 not used
+BuildRequires:  perl(IPC::Open3)
 BuildRequires:  perl(lib)
 BuildRequires:  perl(Test2::API) >= 1.302015
 BuildRequires:  perl(Test2::Mock) >= 0.000121
@@ -42,15 +41,43 @@ BuildRequires:  zsh
 Requires:       perl(Shell::Guess) >= 0.02
 
 # Remove under-specified dependencies
-%global __requires_exclude %{?__requires_exclude:%{__requires_exclude}|}^perl\\(Shell::Guess\\)$
+%global __requires_exclude %{?__requires_exclude:%{__requires_exclude}|}^perl\\((Shell::Guess|Test2::API|Test2::Mock|Test2::V0)\\)$
+# Hide private modules
+%global __requires_exclude %{?__requires_exclude:%{__requires_exclude}|}^perl\\((TestLib|TestPath)\\)
+%global __provides_exclude %{?__provides_exclude:%{__provides_exclude}|}^perl\\((TestLib|TestPath)\\)
 
 %description
 This Perl module provides an interface for specifying shell configurations for
 different shell environments without having to worry about the arcane
 differences between shells such as csh, sh, cmd.exe and command.com.
 
+%package tests
+Summary:        Tests for %{name}
+BuildArch:      noarch
+Requires:       %{name} = %{?epoch:%{epoch}:}%{version}-%{release}
+Requires:       perl-Test-Harness
+Requires:       perl(Data::Dumper)
+Requires:       perl(IPC::Open3)
+Requires:       perl(Test2::API) >= 1.302015
+Requires:       perl(Test2::Mock) >= 0.000121
+Requires:       perl(Test2::V0) >= 0.000121
+# Optional tests:
+Requires:       bash
+Requires:       fish
+Requires:       ksh
+Requires:       zsh
+
+%description tests
+Tests from %{name}. Execute them
+with "%{_libexecdir}/%{name}/test".
+
 %prep
 %setup -q -n Shell-Config-Generate-%{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
@@ -58,7 +85,15 @@ 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}')
@@ -72,9 +107,13 @@ make test
 %{perl_vendorlib}/Shell/Config/Generate.pm
 %{_mandir}/man3/Shell::Config::Generate.*
 
+%files tests
+%{_libexecdir}/%{name}
+
 %changelog
 * Mon Sep 07 2026 Petr Pisar <ppisar@redhat.com> - 0.35-1
 - 0.35 bump
+- Package the tests
 
 * Sat Jan 17 2026 Fedora Release Engineering <releng@fedoraproject.org> - 0.34-18
 - Rebuilt for https://fedoraproject.org/wiki/Fedora_44_Mass_Rebuild

                 reply	other threads:[~2026-09-07 11:25 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=178878034849.1.17033510949494563291.rpms-perl-Shell-Config-Generate-3a3aa5ace2dd@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