]> git.pld-linux.org Git - packages/php-pecl-apcu_bc.git/commitdiff
run tests
authorElan Ruusamäe <glen@pld-linux.org>
Thu, 9 Nov 2017 19:29:45 +0000 (21:29 +0200)
committerElan Ruusamäe <glen@pld-linux.org>
Thu, 9 Nov 2017 19:29:45 +0000 (21:29 +0200)
php-pecl-apcu_bc.spec

index 03db7e63397dbb1b7d4e66e52b6635808cbcc6da..68bc16c30966a4f7b86efa819c411737b329059a 100644 (file)
@@ -1,3 +1,7 @@
+#
+# Conditional build:
+%bcond_without tests           # build without tests
+
 %define                php_name        php%{?php_suffix}
 %define                modname apcu_bc
 Summary:       APCu Backwards Compatibility Module
@@ -9,9 +13,13 @@ Group:                Development/Languages/PHP
 Source0:       https://pecl.php.net/get/%{modname}-%{version}.tgz
 # Source0-md5: 2ba61ea2cf887814e702e25ad7f1a5e1
 URL:           https://pecl.php.net/package/apcu_bc
+BuildRequires: %{php_name}-cli
 BuildRequires: %{php_name}-devel >= 4:7.0.0
 BuildRequires: %{php_name}-pecl-apcu-devel
 BuildRequires: rpmbuild(macros) >= 1.666
+%if %{with tests}
+BuildRequires: %{php_name}-pecl-apcu
+%endif
 %{?requires_php_extension}
 Requires:      %{php_name}-pecl-apcu
 Provides:      php(apcu) = %{version}
@@ -25,11 +33,33 @@ This module provides a backwards APC compatible API using APCu.
 %setup -qc
 mv %{modname}-%{version}/* .
 
+cat <<'EOF' > run-tests.sh
+#!/bin/sh
+export NO_INTERACTION=1 REPORT_EXIT_STATUS=1 MALLOC_CHECK_=2
+exec %{__make} test \
+       PHP_EXECUTABLE=%{__php} \
+       PHP_TEST_SHARED_SYSTEM_EXTENSIONS="apcu" \
+       RUN_TESTS_SETTINGS="-q $*"
+EOF
+chmod +x run-tests.sh
+
 %build
 phpize
 %configure
 %{__make}
 
+# simple module load test
+%{__php} -n -q \
+       -d extension_dir=modules \
+       -d extension=%{php_extensiondir}/apcu.so \
+       -d extension=apc.so \
+       -m > modules.log
+grep apc modules.log
+
+%if %{with tests}
+./run-tests.sh --show-diff
+%endif
+
 %install
 rm -rf $RPM_BUILD_ROOT
 %{__make} install \
This page took 0.06879 seconds and 4 git commands to generate.