Simplify running of tests

There were a test (common-req.t) which was writing to directory, from
which test run. It was fixed in 6.31.
This commit is contained in:
Michal Josef Špaček 2021-05-12 12:50:45 +02:00
parent 88a1f544fc
commit 2d5988d456

View File

@ -90,7 +90,6 @@ requests, responses and the headers contained within them.
%package tests
Summary: Tests for %{name}
Requires: %{name} = %{?epoch:%{epoch}:}%{version}-%{release}
Requires: coreutils
Requires: perl-Test-Harness
Requires: perl(URI::URL)
@ -116,15 +115,8 @@ perl Makefile.PL INSTALLDIRS=vendor NO_PACKLIST=1 NO_PERLLOCAL=1
mkdir -p %{buildroot}%{_libexecdir}/%{name}
cp -a t %{buildroot}%{_libexecdir}/%{name}
cat > %{buildroot}%{_libexecdir}/%{name}/test << 'EOF'
#!/bin/bash
set -e
# t/status-old.t writes into CWD
DIR=$(mktemp -d)
cp -a %{_libexecdir}/%{name}/t "$DIR"
pushd "$DIR"
prove -I . -j "$(getconf _NPROCESSORS_ONLN)"
popd
rm -r "$DIR"
#!/bin/sh
cd %{_libexecdir}/%{name} && exec prove -I . -j "$(getconf _NPROCESSORS_ONLN)"
EOF
chmod +x %{buildroot}%{_libexecdir}/%{name}/test
%{_fixperms} %{buildroot}/*
@ -145,6 +137,7 @@ make test
%changelog
* Wed May 12 2021 Michal Josef Špaček <mspacek@redhat.com> - 6.31-1
- 6.31 bump
- Simplify running of tests
* Tue May 11 2021 Michal Josef Špaček <mspacek@redhat.com> - 6.30-1
- 6.30 bump