public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
* [rpms/perl-Digest-SHA3] epel8: Package tests
@ 2026-06-15 13:37 Jitka Plesnikova
  0 siblings, 0 replies; only message in thread
From: Jitka Plesnikova @ 2026-06-15 13:37 UTC (permalink / raw)
  To: git-commits

A new commit has been pushed.

Repo   : rpms/perl-Digest-SHA3
Branch : epel8
Commit : 2ab6ab337b69707b2052f5a79f07b3745ac4b90d
Author : Jitka Plesnikova <jplesnik@redhat.com>
Date   : 2022-08-09T14:42:38+02:00
Stats  : +50/-3 in 5 file(s)
URL    : https://src.fedoraproject.org/rpms/perl-Digest-SHA3/c/2ab6ab337b69707b2052f5a79f07b3745ac4b90d?branch=epel8

Log:
Package tests

---
diff --git a/.fmf/version b/.fmf/version
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/.fmf/version
@@ -0,0 +1 @@
+1

diff --git a/gating.yaml b/gating.yaml
new file mode 100644
index 0000000..282e16b
--- /dev/null
+++ b/gating.yaml
@@ -0,0 +1,7 @@
+--- !Policy
+product_versions:
+  - fedora-*
+decision_context: bodhi_update_push_stable
+subject_type: koji_build
+rules:
+  - !PassingTestCaseRule {test_case_name: fedora-ci.koji-build.tier0.functional}

diff --git a/perl-Digest-SHA3.spec b/perl-Digest-SHA3.spec
index dfd3af1..7a7e2fb 100644
--- a/perl-Digest-SHA3.spec
+++ b/perl-Digest-SHA3.spec
@@ -41,21 +41,47 @@ Digest::SHA3 is written in C for speed. If your platform lacks a C
 compiler, perhaps you can find the module in a binary form compatible with
 your particular processor and operating system.
 
+%package tests
+Summary:        Tests for %{name}
+Requires:       %{name} = %{?epoch:%{epoch}:}%{version}-%{release}
+Requires:       perl-Test-Harness
+
+%description tests
+Tests from %{name}. Execute them
+with "%{_libexecdir}/%{name}/test".
+
 %prep
 %setup -q -n Digest-SHA3-%{version}
 perl -MConfig -pi -e 's|^#!.*perl|$Config{startperl}|' examples/dups3
 chmod -c -x examples/dups3
 
+# Help generators to recognize Perl scripts
+for F in t/*.t; do
+    perl -i -MConfig -ple 'print $Config{startperl} if $. == 1 && !s{\A#!.*perl\b}{$Config{startperl}}' "$F"
+    chmod +x "$F"
+done
+
 %build
-perl Makefile.PL INSTALLDIRS=vendor OPTIMIZE="$RPM_OPT_FLAGS" NO_PACKLIST=1 NO_PERLLOCAL=1
+perl Makefile.PL INSTALLDIRS=vendor OPTIMIZE="%{optflags}" NO_PACKLIST=1 NO_PERLLOCAL=1
 %{make_build}
 
 %install
 %{make_install}
-find $RPM_BUILD_ROOT -type f -name '*.bs' -size 0 -delete
-%{_fixperms} $RPM_BUILD_ROOT/*
+find %{buildroot} -type f -name '*.bs' -size 0 -delete
+%{_fixperms} %{buildroot}/*
+
+# Install tests
+mkdir -p %{buildroot}%{_libexecdir}/%{name}
+cp -a t %{buildroot}%{_libexecdir}/%{name}
+rm %{buildroot}%{_libexecdir}/%{name}/t/pod*.t
+cat > %{buildroot}%{_libexecdir}/%{name}/test << 'EOF'
+#!/bin/sh
+cd %{_libexecdir}/%{name} && exec prove -I . -r -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}')
 make test
 
 %files
@@ -64,6 +90,9 @@ make test
 %{perl_vendorarch}/Digest*
 %{_mandir}/man3/*
 
+%files tests
+%{_libexecdir}/%{name}
+
 %package -n sha3sum
 Summary:        Compute and check SHA3 message digest
 BuildArch:      noarch
@@ -80,6 +109,7 @@ This script will compute and check the SHA3 message digest of a file
 %changelog
 * Tue Aug 09 2022 Jitka Plesnikova <jplesnik@redhat.com> - 1.05-1
 - 1.05 bump
+- Package tests
 
 * Fri Jul 22 2022 Fedora Release Engineering <releng@fedoraproject.org> - 1.04-16
 - Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild

diff --git a/plans/sanity.fmf b/plans/sanity.fmf
new file mode 100644
index 0000000..a72ded4
--- /dev/null
+++ b/plans/sanity.fmf
@@ -0,0 +1,5 @@
+summary: Sanity tests
+discover:
+    how: fmf
+execute:
+    how: tmt

diff --git a/tests/upstream-tests.fmf b/tests/upstream-tests.fmf
new file mode 100644
index 0000000..9efeef2
--- /dev/null
+++ b/tests/upstream-tests.fmf
@@ -0,0 +1,4 @@
+summary: Upstream tests
+component: perl-Digest-SHA3
+require: perl-Digest-SHA3-tests
+test: /usr/libexec/perl-Digest-SHA3/test

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

only message in thread, other threads:[~2026-06-15 13:37 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-06-15 13:37 [rpms/perl-Digest-SHA3] epel8: Package tests Jitka Plesnikova

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox