Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/zabbix/zabbix.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexander Vladishev <aleksander.vladishev@zabbix.com>2019-06-18 10:07:10 +0300
committerAlexander Vladishev <aleksander.vladishev@zabbix.com>2019-06-18 10:07:37 +0300
commit6a5e32cf5b0fc27f0d844e8b01907b5e80d44f66 (patch)
tree2b97e1fd06c52ec5c5cc9a49c246591eaf718412 /build.xml
parent5f10e8b42fb180b22dc025b929ce057c1192a4d4 (diff)
.......... [ZBXNEXT-686] added filtering option for PHP unit tests
(cherry picked from commit 4df52a2f442339cd0284e068bb72428aaad6a2a1)
Diffstat (limited to 'build.xml')
-rw-r--r--build.xml23
1 files changed, 20 insertions, 3 deletions
diff --git a/build.xml b/build.xml
index d01d2b4e769..c05ff2d4f3a 100644
--- a/build.xml
+++ b/build.xml
@@ -1,6 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
<project name="Zabbix" default="build" basedir=".">
<target name="init-common">
+ <condition property="phpunit_filter" value=" --filter='${PHPUNIT_FILTER}'" else="">
+ <and>
+ <isset property="PHPUNIT_FILTER" />
+ <length string="${PHPUNIT_FILTER}" when="greater" length="0"/>
+ </and>
+ </condition>
+
<!-- Cleanup from the previous run -->
<delete dir="build/logs" failonerror="off"/>
<mkdir dir="build/logs"/>
@@ -281,25 +288,35 @@
<target name="test-phpunit" depends="init-common">
<exec executable="phpunit" dir="frontends/php/tests/unit" failonerror="off">
<arg line="--log-junit=${basedir}/build/logs/phpunit.xml"/>
+ <arg line="${phpunit_filter}"/>
<arg line="include/"/>
</exec>
</target>
<target name="test-frontend">
<exec executable="phpunit" dir="frontends/php/tests" failonerror="off">
- <arg line="--log-junit=${basedir}/build/logs/phpunit.xml --bootstrap=bootstrap.php frontend.php"/>
+ <arg line="--log-junit=${basedir}/build/logs/phpunit.xml"/>
+ <arg line="--bootstrap=bootstrap.php"/>
+ <arg line="${phpunit_filter}"/>
+ <arg line="frontend.php"/>
</exec>
</target>
<target name="test-api">
<exec executable="phpunit" dir="frontends/php/tests" failonerror="off">
- <arg line="--log-junit=${basedir}/build/logs/phpunit.xml --bootstrap=bootstrap.php api_json/ApiJsonTests.php"/>
+ <arg line="--log-junit=${basedir}/build/logs/phpunit.xml"/>
+ <arg line="--bootstrap=bootstrap.php"/>
+ <arg line="${phpunit_filter}"/>
+ <arg line="api_json/ApiJsonTests.php"/>
</exec>
</target>
<target name="test-integration">
<exec executable="phpunit" dir="frontends/php/tests" failonerror="off">
- <arg line="--log-junit=${basedir}/build/logs/phpunit.xml --bootstrap=bootstrap.php integration/IntegrationTests.php"/>
+ <arg line="--log-junit=${basedir}/build/logs/phpunit.xml"/>
+ <arg line="--bootstrap=bootstrap.php"/>
+ <arg line="${phpunit_filter}"/>
+ <arg line="integration/IntegrationTests.php"/>
</exec>
</target>