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

A new commit has been pushed.

Repo   : rpms/perl-SDL
Branch : f43
Commit : 35cce804746fba575488e6756eff091156fe1b33
Author : Petr Písař <ppisar@redhat.com>
Date   : 2025-10-07T15:45:37+02:00
Stats  : +105/-3 in 3 file(s)
URL    : https://src.fedoraproject.org/rpms/perl-SDL/c/35cce804746fba575488e6756eff091156fe1b33?branch=f43

Log:
Package the tests

---
diff --git a/SDL-2.548-Read-only-t-core_rwops.t.patch b/SDL-2.548-Read-only-t-core_rwops.t.patch
new file mode 100644
index 0000000..251aead
--- /dev/null
+++ b/SDL-2.548-Read-only-t-core_rwops.t.patch
@@ -0,0 +1,62 @@
+From 4cc57bf07c5ee60baac971e2b06c342851eeaff2 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= <ppisar@redhat.com>
+Date: Tue, 7 Oct 2025 15:33:33 +0200
+Subject: [PATCH] Read-only t/core_rwops.t
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+t/core_rwops.t used to create a file in the current working directory
+and then test that SDL::RWOps can open it, seek in it and read it.
+I.e. the test did not perform any write operation, yet setting up the
+test required writing.
+
+This unnecessary write prevented from running the tests from
+a read-only location.
+
+This patch precreates the test file so that no write operation is
+needed when running the test.
+
+Signed-off-by: Petr Písař <ppisar@redhat.com>
+---
+ t/core_rwops.t  | 7 +------
+ test/data/rwops | 1 +
+ 2 files changed, 2 insertions(+), 6 deletions(-)
+ create mode 100644 test/data/rwops
+
+diff --git a/t/core_rwops.t b/t/core_rwops.t
+index 5f40a82f..0c9d5628 100644
+--- a/t/core_rwops.t
++++ b/t/core_rwops.t
+@@ -11,11 +11,7 @@ my @done = qw/
+ 	/;
+ can_ok( 'SDL::RWOps', @done );
+ 
+-open FH, '>', '.rwops';
+-print FH 'rwops';
+-close FH;
+-
+-my $file = SDL::RWOps->new_file( '.rwops', 'rw' );
++my $file = SDL::RWOps->new_file( 'test/data/rwops', 'r' );
+ isa_ok( $file, 'SDL::RWOps', '[from_file] returns RWOps' );
+ 
+ #0        SEEK_SET
+@@ -35,7 +31,6 @@ SKIP:
+ 	is( $blocks, 5, '[read] got ' . $char );
+ }
+ $file->close();
+-unlink '.rwops';
+ my @left = qw/
+ 	from_fp
+ 	from_mem
+diff --git a/test/data/rwops b/test/data/rwops
+new file mode 100644
+index 00000000..d6380184
+--- /dev/null
++++ b/test/data/rwops
+@@ -0,0 +1 @@
++rwops
+\ No newline at end of file
+-- 
+2.51.0
+

diff --git a/perl-SDL.rpmlintrc b/perl-SDL.rpmlintrc
new file mode 100644
index 0000000..a5d5f5e
--- /dev/null
+++ b/perl-SDL.rpmlintrc
@@ -0,0 +1 @@
+addFilter('-tests\.noarch: W: no-documentation')

diff --git a/perl-SDL.spec b/perl-SDL.spec
index e3ddb17..4255a45 100644
--- a/perl-SDL.spec
+++ b/perl-SDL.spec
@@ -26,13 +26,13 @@ Summary:        Simple DirectMedia Layer for Perl
 # src/SDL.xs:           LGPL-2.1-or-later
 # src/SDLx/SFont.h:     LGPL-2.1-or-later
 # src/SDLx/SFont.xs:    LGPL-2.1-or-later
-## Used at build-time, but not in any binary package
-# Build.PL:                 refers to LGPL
-# inc/My/Builder.pm:        LGPL-2.1-or-later
 # test/data/5x7.fnt:        LGPL-2.1-only (see test/data/README)
 # test/data/tribe_i.wav:    GPL-3.0-only OR LGPL-2.0-only OR CC-BY-SA-3.0
 #                           (see test/data/README; there is a typo in the file
 #                           name)
+## Used at build-time, but not in any binary package
+# Build.PL:                 refers to LGPL
+# inc/My/Builder.pm:        LGPL-2.1-or-later
 ## Not in any binary package and not used
 # META.json:    refers to LGPL-2.1
 # OFL.txt:      OFL-1.1-RFN text
@@ -64,6 +64,9 @@ Patch5:         SDL-2.548-core_surface.t-test-data-icon.bmp-is-really-4-bits-p.p
 # Adapt t/core.t test to SDL-3.2.24, bug #2401791, proposed upstream,
 # <https://github.com/PerlGameDev/SDL/pull/311>
 Patch6:         SDL-2.548-Adapt-to-SDL-3.2.24.patch
+# Make the tests read-only, proposed upstream,
+# <https://github.com/PerlGameDev/SDL/pull/312>
+Patch7:         SDL-2.548-Read-only-t-core_rwops.t.patch
 BuildRequires:  coreutils
 BuildRequires:  findutils
 BuildRequires:  libGLU-devel
@@ -119,6 +122,11 @@ BuildRequires:  perl(threads::shared)
 Requires:       sil-gentium-basic-book-fonts
 
 %{?perl_default_filter}
+# Remove under-specified dependencies
+%global __requires_exclude %{?__requires_exclude:%{__requires_exclude}|}^perl\\(Test::Most\\)$
+# Hide private modules
+%global __requires_exclude %{?__requires_exclude:%{__requires_exclude}|}^perl\\(SDL::TestTool\\)
+%global __provides_exclude %{?__provides_exclude:%{__provides_exclude}|}^perl\\(SDL::TestTool\\)
 
 %description
 SDL_perl is a package of Perl modules that provide both functional and
@@ -139,6 +147,20 @@ some tasks specific to SDL applications - e.g. packaging SDL
 application/game into PAR archive.
 
 
+%package tests
+Summary:        Tests for %{name}
+License:        LGPL-2.1-or-later AND (GPL-3.0-only OR LGPL-2.0-only OR CC-BY-SA-3.0)
+BuildArch:      noarch
+Requires:       %{name} = %{?epoch:%{epoch}:}%{version}-%{release}
+Requires:       perl-Test-Harness
+Requires:       perl(Test::Most) >= 0.21
+Requires:       sil-gentium-basic-book-fonts
+
+%description tests
+Tests from %{name}. Execute them
+with "%{_libexecdir}/%{name}/test".
+
+
 %prep
 %autosetup -p1 -n SDL-%{version}
 # Delete a bundled font file, code removed with
@@ -156,6 +178,11 @@ sed -i -e 's|lib/pods|lib|' MANIFEST
 # Disable the sdlx_controller_interface.t test, it hangs on arm
 rm t/sdlx_controller_interface.t
 sed -i -e '/t\/sdlx_controller_interface\.t/d' MANIFEST
+# 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 Build.PL installdirs=vendor optimize="$RPM_OPT_FLAGS"
@@ -169,6 +196,14 @@ export HARNESS_OPTIONS=j$(perl -e 'if ($ARGV[0] =~ /.*-j([0-9][0-9]*).*/) {print
 ./Build install destdir=%{buildroot} create_packlist=0
 find %{buildroot} -type f -name '*.bs' -a -size 0 -delete
 %{_fixperms} %{buildroot}/*
+# Install tests
+mkdir -p %{buildroot}%{_libexecdir}/%{name}/upstream
+cp -a t test %{buildroot}%{_libexecdir}/%{name}/upstream
+cat > %{buildroot}%{_libexecdir}/%{name}/test << 'EOF'
+#!/bin/sh
+cd %{_libexecdir}/%{name}/upstream && exec prove -I . -j "$(getconf _NPROCESSORS_ONLN)"
+EOF
+chmod +x %{buildroot}%{_libexecdir}/%{name}/test
 
 %files
 %license COPYING
@@ -191,9 +226,13 @@ find %{buildroot} -type f -name '*.bs' -a -size 0 -delete
 %{perl_vendorarch}/Module/Build/SDL.pm
 %{_mandir}/man3/Module::Build::SDL.*
 
+%files tests
+%{_libexecdir}/%{name}
+
 %changelog
 * Tue Oct 07 2025 Petr Pisar <ppisar@redhat.com> - 2.548-31
 - Adapt tests to SDL-3.2.24 (bug #2401791)
+- Package the tests
 
 * Fri Jul 25 2025 Fedora Release Engineering <releng@fedoraproject.org> - 2.548-30
 - Rebuilt for https://fedoraproject.org/wiki/Fedora_43_Mass_Rebuild

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

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

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