]> git.pld-linux.org Git - packages/php-pecl-zstd.git/commitdiff
Run unit tests
authorElan Ruusamäe <glen@pld-linux.org>
Mon, 16 Mar 2020 14:46:31 +0000 (16:46 +0200)
committerElan Ruusamäe <glen@pld-linux.org>
Mon, 16 Mar 2020 20:54:21 +0000 (22:54 +0200)
php-pecl-zstd.spec

index 389765d76e649e1725578a34b5960474d39da558..6e5b82b1b291f9220db0321cc5824f9e3842381f 100644 (file)
@@ -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 \
This page took 0.171754 seconds and 4 git commands to generate.