From 5e1b107645f70753dcaa78c8b8b7643a13ce8d9f Mon Sep 17 00:00:00 2001 From: Remi Collet Date: Sun, 31 Aug 2014 10:19:51 +0200 Subject: php-phpunit-PHP-TokenStream: 1.3.0 --- Autoload.php.in | 24 ++++++++++++++++++++ php-phpunit-PHP-TokenStream.spec | 48 ++++++++++++++++++++++++++++------------ 2 files changed, 58 insertions(+), 14 deletions(-) create mode 100644 Autoload.php.in diff --git a/Autoload.php.in b/Autoload.php.in new file mode 100644 index 0000000..c6d8bd4 --- /dev/null +++ b/Autoload.php.in @@ -0,0 +1,24 @@ += 5.3.3 +BuildRequires: %{_bindir}/phpab %if %{with_tests} BuildRequires: php-pear-PHPUnit >= 3.7.0 %endif @@ -47,17 +55,15 @@ Wrapper around PHP tokenizer extension. %prep %setup -q -n %{gh_project}-%{gh_commit} -rm PHP/Token/Stream/Autoload.php.in +# Restore PSR-0 tree to ensure current sources are used by tests +mv src PHP %build -# Empty build section, most likely nothing required. - -# If upstream drop Autoload.php, command to generate it. -#phpab \ -# --output PHP/Token/Stream/Autoload.php \ -# --template PHP/Token/Stream/Autoload.php.in \ -# PHP +phpab \ + --output PHP/Token/Stream/Autoload.php \ + --template %{SOURCE1} \ + PHP %install @@ -68,7 +74,15 @@ cp -pr PHP %{buildroot}%{php_home}/PHP %if %{with_tests} %check -phpunit -d date.timezone=UTC +# Use generated autoloader +sed -e 's:vendor/autoload.php:PHP/Token/Stream/Autoload.php:' \ + -i tests/bootstrap.php + +# Run tests +phpunit \ + --bootstrap tests/bootstrap.php \ + -d date.timezone=UTC \ + tests %endif @@ -85,11 +99,17 @@ fi %files %defattr(-,root,root,-) -%doc LICENSE README.md +%{!?_licensedir:%global license %%doc} +%license LICENSE +%doc README.md composer.json %{php_home}/PHP %changelog +* Sun Aug 31 2014 Remi Collet - 1.3.0-1 +- Update to 1.3.0 +- enable tests during build + * Wed Jun 25 2014 Remi Collet - 1.2.2-5 - composer dependencies -- cgit