public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
* [rpms/perl-Shell-Config-Generate] rawhide: Package the tests
@ 2026-09-07 11:18 
  0 siblings, 0 replies; only message in thread
From:  @ 2026-09-07 11:18 UTC (permalink / raw)
  To: git-commits

A new commit has been pushed.

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

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 9b1a13c..b035797 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
 
 * Thu Jul 16 2026 Fedora Release Engineering <releng@fedoraproject.org> - 0.34-19
 - Rebuilt for https://fedoraproject.org/wiki/Fedora_45_Mass_Rebuild

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2026-09-07 11:18 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-09-07 11:18 [rpms/perl-Shell-Config-Generate] 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