From: Emilio C. <emi...@ho...> - 2012-03-27 22:33:45
|
Sure, here is how I'm instrumenting this: <cobertura-instrument todir="${instrumented.classes}/" maxmemory="512M" datafile="${cob.ser.file}"> <fileset dir="${dir.compile}"> <include name="**/*.class" /> </fileset> </cobertura-instrument> The problem here is that the compiled classes of the host (and the testng tests) are in 2 folders: a compiled one (like myhost/classes) and deployed (locally) in one WAR file.Maybe this is the problem, but I tried with the instrumentation of both of them.. and I had the same behavior. From: Joh...@sa... To: emi...@ho...; cob...@li... Subject: RE: [Cobertura-devel] Can't get the the proper code coverage using Cobertura + Testng + Ant Date: Tue, 27 Mar 2012 21:55:02 +0000 That is determined by how you are doing the instrumentation. Can I see your call to cobertura-instrument? From: Emilio Corengia [mailto:emi...@ho...] Sent: Tuesday, March 27, 2012 5:44 PM To: cob...@li... Subject: [Cobertura-devel] Can't get the the proper code coverage using Cobertura + Testng + Ant Hi guys, I don't have too much experience with Cobertura.. I'm trying to build the coverage reports for a Web app (using Atlas) running my TestNG tests. The problem that I have is when I try to generate the coverage reports it always show coverage only for my tests instead of the actual host classes (coverage for the classes of Web App is always 0). I don't want to know the coverage of my tests, I want the coverage for the App classes. I'm running these tests like this bellow: <target name="run-instrumented-testng"> <property name="groups" value="" /> <property name="groups.exclude" value="" /> <testng classpathref="cob.test.path" outputDir="${dir.testng.reports}" haltonfailure="true" haltonskipped="false" groups="${groups}"> <xmlfileset dir="${dir.testng.conf}" includes="testng.xml" /> <sysproperty key="net.sourceforge.cobertura.datafile" file="${cob.ser.file}" /> <!-- ser file --> </testng> </target> With: <path id="cob.test.path"> <pathelement path="${instrumented.classes}"/> <!-- instrumentation directory --> <pathelement path="${dir.compile}"/> <!-- main class files --> <pathelement path="${dir.servicetest.compile}"/> <!-- test class files --> <path refid="classpath.testng"/> <path refid="classpath.cobertura"/> </path> Any idea about where I messed up here is welcome... thanks in advance, Emilio. |