|
@@ -511,11 +511,15 @@ xmlns:cs="antlib:com.puppycrawl.tools.checkstyle.ant">
|
|
|
<env key="ACLOCAL" value="aclocal -I ${cppunit.m4}"/>
|
|
|
</exec>
|
|
|
<mkdir dir="${build.dir}/c" />
|
|
|
+ <condition property="enable.gcov.arg" value="--enable-gcov" else="">
|
|
|
+ <equals arg1="${enable.gcov}" arg2="true"/>
|
|
|
+ </condition>
|
|
|
<exec executable="${c.src.dir}/configure" dir="${build.dir}/c"
|
|
|
failonerror="yes">
|
|
|
<env key="base_dir" value="${basedir}"/>
|
|
|
<env key="CALLER" value="ANT"/>
|
|
|
<arg value="--prefix=${build.dir}/c/build/${package.prefix}"/>
|
|
|
+ <arg line="${enable.gcov.arg}"/>
|
|
|
</exec>
|
|
|
<property name="c.build" value="${build.dir}/c/build"/>
|
|
|
<exec dir="${build.dir}/c" executable="make" failonerror="true">
|
|
@@ -1332,7 +1336,29 @@ xmlns:cs="antlib:com.puppycrawl.tools.checkstyle.ant">
|
|
|
</condition>
|
|
|
</target>
|
|
|
|
|
|
- <target name="check-cppunit-makefile" depends="init" >
|
|
|
+ <target name="verify-cppunit-makefile-gcov">
|
|
|
+ <fileset id="fileset.makefile.gcov.enabled" dir="${test.cppunit.dir}" erroronmissingdir="false">
|
|
|
+ <include name="Makefile"/>
|
|
|
+ <containsregexp expression="^[^#]+-ftest-coverage.*$"/>
|
|
|
+ </fileset>
|
|
|
+ <condition property="makefile.gcov.enabled">
|
|
|
+ <resourcecount when="greater" count="0" refid="fileset.makefile.gcov.enabled"/>
|
|
|
+ </condition>
|
|
|
+ <echo message="makefile.gcov.enabled = ${makefile.gcov.enabled}"/>
|
|
|
+ <condition property="delete.cppunit.makefile">
|
|
|
+ <and>
|
|
|
+ <isset property="makefile.gcov.enabled"/>
|
|
|
+ <not><equals arg1="${enable.gcov}" arg2="true"/></not>
|
|
|
+ </and>
|
|
|
+ </condition>
|
|
|
+ <echo message="delete.cppunit.makefile = ${delete.cppunit.makefile}"/>
|
|
|
+ </target>
|
|
|
+
|
|
|
+ <target name="delete-cppunit-makefile" if="delete.cppunit.makefile">
|
|
|
+ <delete file="${test.cppunit.dir}/Makefile"/>
|
|
|
+ </target>
|
|
|
+
|
|
|
+ <target name="check-cppunit-makefile" depends="init,verify-cppunit-makefile-gcov,delete-cppunit-makefile" >
|
|
|
<condition property="need.cppunit.makefile">
|
|
|
<not> <available file="${test.cppunit.dir}/Makefile"/> </not>
|
|
|
</condition>
|
|
@@ -1362,11 +1388,15 @@ xmlns:cs="antlib:com.puppycrawl.tools.checkstyle.ant">
|
|
|
<param name="cppunit" value="true"/>
|
|
|
</antcall>
|
|
|
<mkdir dir="${test.cppunit.dir}"/>
|
|
|
+ <condition property="enable.gcov.arg" value="--enable-gcov" else="">
|
|
|
+ <equals arg1="${enable.gcov}" arg2="true"/>
|
|
|
+ </condition>
|
|
|
<exec executable="${c.src.dir}/configure" dir="${test.cppunit.dir}"
|
|
|
failonerror="yes">
|
|
|
<env key="base_dir" value="${basedir}"/>
|
|
|
<env key="CALLER" value="ANT"/>
|
|
|
<arg value="--prefix=${test.cppunit.dir}"/>
|
|
|
+ <arg line="${enable.gcov.arg}"/>
|
|
|
</exec>
|
|
|
</target>
|
|
|
|
|
@@ -1485,6 +1515,29 @@ xmlns:cs="antlib:com.puppycrawl.tools.checkstyle.ant">
|
|
|
</clover-report>
|
|
|
</target>
|
|
|
|
|
|
+ <target name="c_coverage_report" description="Runs coverage report for ZK C client code.">
|
|
|
+ <!-- delete configure and make files so that they get regenerated with coverage enabled -->
|
|
|
+ <delete file="${c.src.dir}/configure"/>
|
|
|
+ <delete file="${test.cppunit.dir}/Makefile"/>
|
|
|
+ <subant target="test-core-cppunit" failonerror="false">
|
|
|
+ <property name="enable.gcov" value="true"/>
|
|
|
+ <fileset dir="." file="build.xml"/>
|
|
|
+ </subant>
|
|
|
+ <mkdir dir="${build.dir}/c_coverage" />
|
|
|
+ <copy todir="${build.dir}/c" verbose="true" overwrite="true" failonerror="true">
|
|
|
+ <fileset dir="${build.dir}/test/test-cppunit/.libs">
|
|
|
+ <include name="*.gcno"/>
|
|
|
+ <include name="*.gcda"/>
|
|
|
+ </fileset>
|
|
|
+ </copy>
|
|
|
+ <exec dir="${build.dir}/c" executable="lcov">
|
|
|
+ <arg line="-t testname -o ZK_C_client.info -c -d ."/>
|
|
|
+ </exec>
|
|
|
+ <exec dir="${build.dir}/c_coverage" executable="genhtml">
|
|
|
+ <arg line="-o report ${build.dir}/c/ZK_C_client.info"/>
|
|
|
+ </exec>
|
|
|
+ </target>
|
|
|
+
|
|
|
<!-- Run with 'ant -Dfindbugs.home="path to Findbugs directory" findbugs -->
|
|
|
<property name="findbugs.home" value="" />
|
|
|
<target name="findbugs" depends="check-for-findbugs, jar" if="findbugs.present">
|