]> git.pld-linux.org Git - packages/php-pecl-translit.git/commitdiff
run tests auto/th/php-pecl-translit-0.6.2-1
authorElan Ruusamäe <glen@delfi.ee>
Wed, 11 Jan 2017 12:57:03 +0000 (14:57 +0200)
committerElan Ruusamäe <glen@delfi.ee>
Wed, 11 Jan 2017 12:57:03 +0000 (14:57 +0200)
php-pecl-translit.spec

index df4efb04e7d86582eb578bfb3caa8d0a46fe2544..ee3a921f5fd38ca448062f8569c70c15ede204c7 100644 (file)
@@ -1,5 +1,8 @@
+#
+# Conditional build:
+%bcond_without tests           # build without tests
+
 %define                php_name        php%{?php_suffix}
-%define                status          beta
 %define                modname         translit
 Summary:       %{modname} - transliterates non-latin character sets to latin
 Summary(pl.UTF-8):     %{modname} - translitacja alfabetów niełacińskich do łacińskiego
@@ -14,6 +17,10 @@ URL:         https://github.com/derickr/pecl-translit
 BuildRequires: %{php_name}-devel >= 3:5.0.4
 BuildRequires: libtool
 BuildRequires: rpmbuild(macros) >= 1.650
+%if %{with tests}
+BuildRequires: %{php_name}-cli
+BuildRequires: %{php_name}-iconv
+%endif
 %{?requires_php_extension}
 Requires:      %{php_name}-iconv
 Provides:      php(%{modname}) = %{version}
@@ -29,8 +36,6 @@ forms of transliteration such as converting ligatures such as the
 Norwegian "ae" ligature to separate "ae" characters and normalizing
 punctuation and spacing.
 
-In PECL status of this extension is: %{status}.
-
 %description -l pl.UTF-8
 To rozszerzenie umożliwia transliterację tekstu ze znaków
 niełacińskich (takich jak chińskie, cyrilica, greckie) na znaki
@@ -40,8 +45,6 @@ specjalne formy transliteracji, takie jak konwersja ligatur takich jak
 norweska ligatura "ae" na oddzielne znaki "ae" oraz normalizacja
 znaków przestankowych i odstępów.
 
-To rozszerzenie ma w PECL status: %{status}.
-
 %prep
 %setup -qc
 mv pecl-translit-*/* .
@@ -51,6 +54,28 @@ phpize
 %configure
 %{__make}
 
+%if %{with tests}
+# simple module load test
+%{__php} -n -q \
+       -d extension_dir=modules \
+       -d extension=%{php_extensiondir}/iconv.so \
+       -d extension=%{modname}.so \
+       -m > modules.log
+grep %{modname} modules.log
+
+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="iconv" \
+       RUN_TESTS_SETTINGS="-q $*"
+EOF
+chmod +x run-tests.sh
+
+./run-tests.sh
+%endif
+
 %install
 rm -rf $RPM_BUILD_ROOT
 install -d $RPM_BUILD_ROOT{%{php_sysconfdir}/conf.d,%{php_extensiondir}}
This page took 0.085408 seconds and 4 git commands to generate.