Gentoo Archives: gentoo-dev

From: Thomas Deutschmann <whissi@g.o>
To: gentoo-dev@l.g.o
Subject: [gentoo-dev] [PATCH] php-ext-source-r3.eclass: Add src_test function
Date: Fri, 07 Oct 2016 22:19:18
Message-Id: 20161007221842.101905-2-whissi@gentoo.org
In Reply to: [gentoo-dev] [PATCH] php-ext-source-r3.eclass: Add src_test function by Thomas Deutschmann
1 php-ext-source-r3 eclass currently does not provide FEATURES=test support
2 like php-ext-pecl-r3 eclass does. This commit will add and export the
3 src_test function from php-ext-pecl-r3 eclass to php-ext-source-r3 eclass
4 to allow testing of PHP standalone extensions as well.
5 ---
6 eclass/php-ext-source-r3.eclass | 14 +++++++++++++-
7 1 file changed, 13 insertions(+), 1 deletion(-)
8
9 diff --git a/eclass/php-ext-source-r3.eclass b/eclass/php-ext-source-r3.eclass
10 index 3372a4b..f2999d4 100644
11 --- a/eclass/php-ext-source-r3.eclass
12 +++ b/eclass/php-ext-source-r3.eclass
13 @@ -12,7 +12,7 @@
14
15 inherit autotools
16
17 -EXPORT_FUNCTIONS src_unpack src_prepare src_configure src_compile src_install
18 +EXPORT_FUNCTIONS src_unpack src_prepare src_configure src_compile src_install src_test
19
20 case ${EAPI} in
21 6) ;;
22 @@ -230,6 +230,18 @@ php-ext-source-r3_src_install() {
23 php-ext-source-r3_createinifiles
24 }
25
26 +# @FUNCTION: php-ext-source-r3_src_test
27 +# @DESCRIPTION:
28 +# Run tests delivered with the standalone PHP extension. Phpize will have generated
29 +# a run-tests.php file to be executed by `make test`. We only need to
30 +# force the test suite to run in non-interactive mode.
31 +php-ext-source-r3_src_test() {
32 + for slot in $(php_get_slots); do
33 + php_init_slot_env "${slot}"
34 + NO_INTERACTION="yes" emake test
35 + done
36 +}
37 +
38 # @FUNCTION: php_get_slots
39 # @DESCRIPTION:
40 # Get a list of PHP slots contained in both the ebuild's USE_PHP and the
41 --
42 2.10.1