Package the tests

epel9
Petr Písař 3 years ago
parent 2838091cc6
commit 2d37f9b386

@ -1 +1,2 @@
addFilter('spelling-error .* (versa|superset)') addFilter('spelling-error .* (versa|superset)')
addFilter('-tests\.noarch: W: no-documentation')

@ -54,6 +54,17 @@ format that aims to use an (almost) superset of the JSON data model, i.e.
when you can represent something useful in JSON, you should be able to when you can represent something useful in JSON, you should be able to
represent it in CBOR. represent it in CBOR.
%package tests
Summary: Tests for %{name}
BuildArch: noarch
Requires: %{name} = %{?epoch:%{epoch}:}%{version}-%{release}
Requires: perl-Test-Harness
Requires: perl(Math::BigInt::FastCalc)
%description tests
Tests from %{name}. Execute them
with "%{_libexecdir}/%{name}/test".
%prep %prep
%autosetup -p1 -n CBOR-XS-%{version} %autosetup -p1 -n CBOR-XS-%{version}
# Remove bundled libecb # Remove bundled libecb
@ -66,10 +77,19 @@ perl Makefile.PL INSTALLDIRS=vendor NO_PACKLIST=1 NO_PERLLOCAL=1 OPTIMIZE="$RPM_
%install %install
%{make_install} %{make_install}
find $RPM_BUILD_ROOT -type f -name '*.bs' -size 0 -delete find %{buildroot} -type f -name '*.bs' -size 0 -delete
%{_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 %check
export HARNESS_OPTIONS=j$(perl -e 'if ($ARGV[0] =~ /.*-j([0-9][0-9]*).*/) {print $1} else {print 1}' -- '%{?_smp_mflags}')
make test make test
%files %files
@ -79,9 +99,13 @@ make test
%{perl_vendorarch}/CBOR* %{perl_vendorarch}/CBOR*
%{_mandir}/man3/* %{_mandir}/man3/*
%files tests
%{_libexecdir}/%{name}
%changelog %changelog
* Thu Oct 21 2021 Petr Pisar <ppisar@redhat.com> - 1.84-1 * Thu Oct 21 2021 Petr Pisar <ppisar@redhat.com> - 1.84-1
- 1.84 bump - 1.84 bump
- Package the tests
* Thu Jul 22 2021 Fedora Release Engineering <releng@fedoraproject.org> - 1.83-4 * Thu Jul 22 2021 Fedora Release Engineering <releng@fedoraproject.org> - 1.83-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild - Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild

Loading…
Cancel
Save