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..3b56a2d --- /dev/null +++ b/gating.yaml @@ -0,0 +1,16 @@ +--- !Policy +product_versions: + - fedora-* +decision_context: bodhi_update_push_testing +subject_type: koji_build +rules: + - !PassingTestCaseRule {test_case_name: fedora-ci.koji-build.tier0.functional} + +# Rawhide +--- !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-String-ShellQuote.spec b/perl-String-ShellQuote.spec index 734c0fb..d909311 100644 --- a/perl-String-ShellQuote.spec +++ b/perl-String-ShellQuote.spec @@ -1,15 +1,17 @@ Name: perl-String-ShellQuote Version: 1.04 -Release: 42%{?dist} +Release: 43%{?dist} Summary: Perl module for quoting strings for passing through the shell License: (GPL-1.0-or-later OR Artistic-1.0-Perl) AND GPL-2.0-or-later URL: https://metacpan.org/release/String-ShellQuote Source0: https://cpan.metacpan.org/authors/id/R/RO/ROSCH/String-ShellQuote-%{version}.tar.gz BuildArch: noarch # Build -BuildRequires: make -BuildRequires: perl-interpreter +BuildRequires: coreutils +BuildRequires: make BuildRequires: perl-generators +BuildRequires: perl-interpreter +BuildRequires: perl(Config) BuildRequires: perl(ExtUtils::MakeMaker) >= 6.76 # Runtime BuildRequires: perl(Carp) @@ -26,17 +28,40 @@ This package contains a Perl module and a command line utility which are useful for quoting strings which are going to pass through the shell or a shell-like object. +%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 String-ShellQuote-%{version} +# Help generators to recognize Perl scripts +perl -i -MConfig -ple 'print $Config{startperl} if $. == 1 && !s{\A#!.*perl\b}{$Config{startperl}}' test.t +chmod +x test.t + %build -perl Makefile.PL INSTALLDIRS=vendor NO_PACKLIST=1 -make %{?_smp_mflags} +perl Makefile.PL INSTALLDIRS=vendor NO_PACKLIST=1 NO_PERLLOCAL=1 +%{make_build} %install -make pure_install DESTDIR=%{buildroot} +%{make_install} %{_fixperms} %{buildroot}/* +# Install tests +mkdir -p %{buildroot}%{_libexecdir}/%{name}/t +cp -a test.t %{buildroot}%{_libexecdir}/%{name}/t +perl -i -pe 's{blib/script}{%{_bindir}}' %{buildroot}%{_libexecdir}/%{name}/t/test.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 make test @@ -44,10 +69,16 @@ make test %doc Changes README %{_bindir}/shell-quote %{perl_vendorlib}/String -%{_mandir}/man1/* -%{_mandir}/man3/* +%{_mandir}/man1/shell-quote* +%{_mandir}/man3/String::ShellQuote* + +%files tests +%{_libexecdir}/%{name} %changelog +* Thu Feb 08 2024 Jitka Plesnikova - 1.04-43 +- Package tests + * Thu Jan 25 2024 Fedora Release Engineering - 1.04-42 - Rebuilt for https://fedoraproject.org/wiki/Fedora_40_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..f76468a --- /dev/null +++ b/tests/upstream-tests.fmf @@ -0,0 +1,4 @@ +summary: Upstream tests +component: perl-String-ShellQuote +require: perl-String-ShellQuote-tests +test: /usr/libexec/perl-String-ShellQuote/test