[packages/php-pecl-zstd] Run unit tests
glen
glen at pld-linux.org
Mon Mar 16 21:56:40 CET 2020
commit 36ee533eaa240fd4ad0d863d9d31e51e7c24bc4b
Author: Elan Ruusamäe <glen at pld-linux.org>
Date: Mon Mar 16 16:46:31 2020 +0200
Run unit tests
php-pecl-zstd.spec | 17 +++++++++++++++++
1 file changed, 17 insertions(+)
---
diff --git a/php-pecl-zstd.spec b/php-pecl-zstd.spec
index 389765d..6e5b82b 100644
--- a/php-pecl-zstd.spec
+++ b/php-pecl-zstd.spec
@@ -17,6 +17,9 @@ BuildRequires: %{php_name}-cli
BuildRequires: %{php_name}-devel
BuildRequires: rpmbuild(macros) >= 1.666
BuildRequires: zstd-devel
+%if %{with tests}
+BuildRequires: %{php_name}-pcre
+%endif
%{?requires_php_extension}
Provides: php(%{modname}) = %{version}
BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
@@ -30,6 +33,16 @@ library.
mv %{modname}-%{version}/* .
rm -r zstd
+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="" \
+ RUN_TESTS_SETTINGS="-q $*"
+EOF
+chmod +x run-tests.sh
+
%build
phpize
%configure \
@@ -43,6 +56,10 @@ phpize
-m > modules.log
grep %{modname} modules.log
+%if %{with tests}
+./run-tests.sh --show-diff
+%endif
+
%install
rm -rf $RPM_BUILD_ROOT
%{__make} install \
================================================================
---- gitweb:
http://git.pld-linux.org/gitweb.cgi/packages/php-pecl-zstd.git/commitdiff/36ee533eaa240fd4ad0d863d9d31e51e7c24bc4b
More information about the pld-cvs-commit
mailing list