[packages/composer] prepare to run tests
glen
glen at pld-linux.org
Thu Nov 26 13:50:06 CET 2015
commit 24c65dc2b058f4b9fc3c700fbfb43eb4a5814357
Author: Elan Ruusamäe <glen at delfi.ee>
Date: Thu Nov 26 13:55:20 2015 +0200
prepare to run tests
composer.spec | 15 +++++++++++++++
1 file changed, 15 insertions(+)
---
diff --git a/composer.spec b/composer.spec
index 4b1fe20..44aff00 100644
--- a/composer.spec
+++ b/composer.spec
@@ -1,3 +1,7 @@
+#
+# Conditional build:
+%bcond_with tests # build with tests
+
# NOTE
# - release tarballs: http://getcomposer.org/download/
@@ -27,6 +31,10 @@ Patch3: version.patch
URL: http://www.getcomposer.org/
BuildRequires: rpm-php-pearprov >= 4.4.2-11
BuildRequires: rpmbuild(macros) >= 1.673
+%if %{with tests}
+BuildRequires: phpab
+BuildRequires: phpunit
+%endif
Requires: php(core) >= %{php_min_version}
Requires: php(ctype)
Requires: php(date)
@@ -93,6 +101,13 @@ cp -p %{SOURCE3} src/Composer/autoload.php
# cleanup backups after patching
find '(' -name '*~' -o -name '*.orig' ')' -print0 | xargs -0 -r -l512 rm -f
+%build
+%if %{with tests}
+phpab -n -o src/bootstrap.php -e '*/Fixtures/*' src/ tests/
+echo "require 'src/Composer/autoload.php';" >> src/bootstrap.php
+phpunit
+%endif
+
%install
rm -rf $RPM_BUILD_ROOT
install -d $RPM_BUILD_ROOT{%{_bindir},%{php_data_dir}/Composer,/var/cache/composer}
================================================================
---- gitweb:
http://git.pld-linux.org/gitweb.cgi/packages/composer.git/commitdiff/e0a7614407df7c1312804ba1acff1d788f8cd21c
More information about the pld-cvs-commit
mailing list