Add tests bootstrap to fix EPEL6 build

epel9
Shawn Iwinski 5 years ago
parent d7ab84f74a
commit 09f2a45219

@ -32,7 +32,7 @@
Name: php-%{composer_vendor}-%{composer_project} Name: php-%{composer_vendor}-%{composer_project}
Version: %{github_version} Version: %{github_version}
Release: 1%{?dist} Release: 2%{?dist}
Summary: Fedora Autoloader Summary: Fedora Autoloader
License: MIT License: MIT
@ -119,13 +119,24 @@ cp -p res/phpab/fedora*.php.tpl %{buildroot}%{phpab_template_dir}/
%check %check
%if %{with_tests} %if %{with_tests}
: Create tests bootstrap
cat <<'BOOTSTRAP' | tee bootstrap.php
<?php
require '%{buildroot}%{phpdir}/Fedora/Autoloader/autoload.php';
if (!class_exists('PHPUnit\\Framework\\TestCase')) {
class_alias('PHPUnit_Framework_TestCase', 'PHPUnit\\Framework\\TestCase');
}
BOOTSTRAP
: Upstream tests
RETURN_CODE=0 RETURN_CODE=0
for PHP_EXEC in "php %{phpunit}" %{?rhel:php54 php55 php56} php70 "php71 %{_bindir}/phpunit6" "php72 %{_bindir}/phpunit6" "php73 %{_bindir}/phpunit6" "php74 %{_bindir}/phpunit6"; do for PHP_EXEC in "php %{phpunit}" %{?rhel:php54 php55 php56} php70 "php71 %{_bindir}/phpunit6" "php72 %{_bindir}/phpunit6" "php73 %{_bindir}/phpunit6" "php74 %{_bindir}/phpunit6"; do
set $PHP_EXEC set $PHP_EXEC
if [ "php" == "$1" ] || which $PHP_EXEC; then if [ "php" == "$1" ] || which $PHP_EXEC; then
$1 -d include_path=.:%{buildroot}%{phpdir}:%{phpdir}:%{_datadir}/pear \ $1 -d include_path=.:%{buildroot}%{phpdir}:%{phpdir}:%{_datadir}/pear \
${2:-%{_bindir}/phpunit} \ ${2:-%{_bindir}/phpunit} \
--bootstrap %{buildroot}%{phpdir}/Fedora/Autoloader/autoload.php \ --bootstrap bootstrap.php \
--verbose --verbose
fi fi
done done
@ -148,6 +159,9 @@ exit $RETURN_CODE
%changelog %changelog
* Wed Feb 12 2020 Shawn Iwinski <shawn@iwin.ski> - 1.0.1-2
- Add tests bootstrap to fix EPEL6 build
* Wed Feb 12 2020 Shawn Iwinski <shawn@iwin.ski> - 1.0.1-1 * Wed Feb 12 2020 Shawn Iwinski <shawn@iwin.ski> - 1.0.1-1
- Update to 1.0.1 (RHBZ #1802372) - Update to 1.0.1 (RHBZ #1802372)

Loading…
Cancel
Save