diff options
author | Viktors Tjarve <viktors.tjarve@zabbix.com> | 2018-05-14 15:22:47 +0300 |
---|---|---|
committer | Viktors Tjarve <viktors.tjarve@zabbix.com> | 2018-05-14 15:22:47 +0300 |
commit | a4ee472ccf017529863e7a0c9f513f7623675f66 (patch) | |
tree | bbae080881cb395053ed50be01de8e31d5048701 /build-backend.xml | |
parent | 788ae9c3d44b4787f0b7a66a14c7e6ae51f68dbe (diff) |
.......... [DEV-812] added cmocka tests coverage report targed for Jenkins
Diffstat (limited to 'build-backend.xml')
-rw-r--r-- | build-backend.xml | 30 |
1 files changed, 28 insertions, 2 deletions
diff --git a/build-backend.xml b/build-backend.xml index a3e9b56d355..47eb3034fe1 100644 --- a/build-backend.xml +++ b/build-backend.xml @@ -250,7 +250,7 @@ <!-- Build Zabbix with all supported databases --> <target name="make-db" depends="make-db-mysql,make-db-postgresql,make-db-oracle,make-db-db2"/> - + <macrodef name="make-tests"> <!-- Build Zabbix cmocka tests with the specified command line arguments --> <attribute name="conf"/> @@ -289,7 +289,7 @@ </trycatch> </sequential> </macrodef> - + <target name="init-cmocka-test-conf-options"> <!-- Zabbix various configuration parameters for cmocka tests --> <!-- Configuration option name must consist of prefix 'cmocka-', configuration order number @@ -312,6 +312,32 @@ </for> </target> + <target name="gen-test-coverage-report"> + <!-- Generate Zabbix cmocka tests coverage report--> + <delete dir="tests_results"/> + <mkdir dir="tests_results"/> + <mkdir dir="tests_results/html"/> + <exec executable="lcov" failonerror="on"> + <arg line="--directory"/> + <arg line="."/> + <arg line="-zerocounters"/> + </exec> + <exec executable="./bootstrap.sh" failonerror="on"/> + <make-tests conf="CFLAGS='--coverage' -q --enable-server --enable-agent --enable-proxy --enable-ipv6 --with-mysql --with-jabber --with-libxml2 --with-unixodbc --with-net-snmp --with-ssh2 --with-openipmi --with-libevent --with-mbedtls --with-ldap --with-libcurl --with-iconv --with-libpcre" conf-name="gen-test-coverage-report"/> + <exec executable="lcov" failonerror="on"> + <arg line="--directory"/> + <arg line="."/> + <arg line="--capture"/> + <arg line="--output-file"/> + <arg line="tests_results/html/app.info"/> + </exec> + <exec executable="genhtml" failonerror="on"> + <arg line="-o"/> + <arg line="tests_results/html"/> + <arg line="tests_results/html/app.info"/> + </exec> + </target> + <target name="run-unit-test"> <!-- Run C unit tests --> <sequential> |