]> git.pld-linux.org Git - packages/composer.git/commitdiff
prepare to run tests
authorElan Ruusamäe <glen@delfi.ee>
Thu, 26 Nov 2015 11:55:20 +0000 (13:55 +0200)
committerElan Ruusamäe <glen@delfi.ee>
Thu, 26 Nov 2015 11:55:20 +0000 (13:55 +0200)
composer.spec

index 4b1fe204ee1e81be09162ebb2167f5a75a11b798..44aff00470e4db9b0ab566180faa5f61f1084aec 100644 (file)
@@ -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}
This page took 0.190784 seconds and 4 git commands to generate.