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/.gitignore b/.gitignore index f749f31..2d443e1 100644 --- a/.gitignore +++ b/.gitignore @@ -34,3 +34,4 @@ /Socket-2.029.tar.gz /Socket-2.030.tar.gz /Socket-2.031.tar.gz +/Socket-2.032.tar.gz diff --git a/Socket-2.032.tar.gz b/Socket-2.032.tar.gz deleted file mode 100644 index 5558406..0000000 Binary files a/Socket-2.032.tar.gz and /dev/null differ 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-Socket.spec b/perl-Socket.spec index 0d547e1..5a82c6e 100644 --- a/perl-Socket.spec +++ b/perl-Socket.spec @@ -43,9 +43,24 @@ socket(), setsockopt() and bind(). It also provides several other support functions, mostly for dealing with conversions of network addresses between human-readable and native binary forms, and for hostname resolver operations. +%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 Socket-%{version} +# Help file to recognise the 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 NO_PACKLIST=1 NO_PERLLOCAL=1 OPTIMIZE="$RPM_OPT_FLAGS" %{make_build} @@ -55,7 +70,17 @@ perl Makefile.PL INSTALLDIRS=vendor NO_PACKLIST=1 NO_PERLLOCAL=1 OPTIMIZE="$RPM_ find $RPM_BUILD_ROOT -type f -name '*.bs' -size 0 -delete %{_fixperms} $RPM_BUILD_ROOT/* +# 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}') make test %files @@ -65,9 +90,13 @@ make test %{perl_vendorarch}/Socket* %{_mandir}/man3/* +%files tests +%{_libexecdir}/%{name} + %changelog * Thu Jun 03 2021 Jitka Plesnikova - 4:2.032-1 - 2.032 bump +- Package tests * Fri May 21 2021 Jitka Plesnikova - 4:2.031-477 - Increase release to favour standalone package 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/sources b/sources index 1c23f31..dcd699c 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (Socket-2.031.tar.gz) = 8c44f20be19988a26ea2c451ec0e5a732d5471ea5cc1af93a1c1c202fb283ee6ccc094c940b9e258d7613ef8afcbfa52581ccdb65feb1008cead46fa7f036924 +SHA512 (Socket-2.032.tar.gz) = 9b412ffbfa0c7fa1a8d9c474eac9d2835d65e0089c9cc1338459800a18ea472e8ea5ae02a54c01cc9524da6de0585c26dbbd5e97f5b563207083b15ba03c35f2 diff --git a/tests/upstream-tests.fmf b/tests/upstream-tests.fmf new file mode 100644 index 0000000..4445e83 --- /dev/null +++ b/tests/upstream-tests.fmf @@ -0,0 +1,4 @@ +summary: Upstream tests +component: perl-Socket +require: perl-Socket-tests +test: /usr/libexec/perl-Socket/test