From: Elan Ruusamäe Date: Mon, 4 Nov 2013 09:38:25 +0000 (+0200) Subject: add tests X-Git-Url: http://git.pld-linux.org/gitweb.cgi?a=commitdiff_plain;h=512c7faf1e849bebc1479f4c32258b3568afb46d;p=projects%2Ftemplate-specs.git add tests --- diff --git a/php-pecl.spec b/php-pecl.spec index d4f68d2..413e830 100644 --- a/php-pecl.spec +++ b/php-pecl.spec @@ -14,6 +14,7 @@ Group: Development/Languages/PHP Source0: http://pecl.php.net/get/%{modname}-%{version}.tgz # Source0-md5: - URL: http://pecl.php.net/package/modname/ +%{?with_tests:BuildRequires: %{php_name}-cli} BuildRequires: %{php_name}-devel BuildRequires: rpmbuild(macros) >= 1.666 %{?requires_php_extension} @@ -32,6 +33,19 @@ phpize %configure %{__make} +%if %{with tests} +# simple module load test +%{__php} -n -q \ + -d extension_dir=modules \ + -d extension=%{modname}.so \ + -m > modules.log +grep %{modname} modules.log + +export NO_INTERACTION=1 REPORT_EXIT_STATUS=1 MALLOC_CHECK_=2 +%{__make} test \ + PHP_EXECUTABLE=%{__php} +%endif + %install rm -rf $RPM_BUILD_ROOT install -d $RPM_BUILD_ROOT%{php_sysconfdir}/conf.d