From a70f8547e09939e4c5ceeef5543b185550f0d39c Mon Sep 17 00:00:00 2001 From: =?utf8?q?Elan=20Ruusam=C3=A4e?= Date: Wed, 2 Nov 2016 23:27:22 +0200 Subject: [PATCH] run tests --- php-pecl-imagick.spec | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/php-pecl-imagick.spec b/php-pecl-imagick.spec index e16bddb..c198c65 100644 --- a/php-pecl-imagick.spec +++ b/php-pecl-imagick.spec @@ -1,3 +1,7 @@ +# +# Conditional build: +%bcond_without tests # build without tests + %define php_name php%{?php_suffix} %define modname imagick %define status stable @@ -15,6 +19,10 @@ URL: http://pecl.php.net/package/imagick/ BuildRequires: %{php_name}-devel >= 4:5.3 BuildRequires: ImageMagick-devel >= 1:6.2.4.0 BuildRequires: rpmbuild(macros) >= 1.650 +%if %{with tests} +BuildRequires: %{php_name}-cli +BuildRequires: %{php_name}-spl +%endif %{?requires_php_extension} Requires(triggerpostun): sed >= 4.0 Requires: %{php_name}-spl @@ -59,6 +67,20 @@ phpize %{__make} \ CFLAGS_CLEAN="%{rpmcflags}" +%if %{with tests} +%{__php} -n -q \ + -d extension_dir=modules \ + -d extension=%{php_extensiondir}/spl.so \ + -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} \ + PHP_TEST_SHARED_SYSTEM_EXTENSIONS="spl" \ +%endif + %install rm -rf $RPM_BUILD_ROOT install -d $RPM_BUILD_ROOT{%{php_sysconfdir}/conf.d,%{php_extensiondir},%{_examplesdir}/%{name}-%{version}} -- 2.43.0