ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Mohamed, Haneef" <Haneef_Moha...@G1.com>
Subject jpcoverage/junit intergration: how do I capture junit coverage wi th with JProbe?
Date Tue, 16 Apr 2002 17:35:40 GMT
Hello everyone!

Here is the problem I am encountering:

Aim
To run junit tests and capture code coverage metrics with jprobe as part of
the build process [pre-deployment] 
via ant

What I have tried
1. tried to run junit as a nested element within jpcoverage -- failed

2. tried to do an 'antcall' to run junit -- failed

3. The only thing that worked [this is my fallback position] is to pass
junit.textui.TestRunner,
one arg at a time, each TestClass, passing one arg is shown below:

  <target name="hm">
            <jpcoverage home="${jpcoveragehome}"
	     	warnlevel="9"
	     	recordfromstart="coverage" snapshotdir="${build}/coverage"
		workingdir="${test.classes}"
	     	classname="junit.textui.TestRunner">
			<classpath refid="c1p.test.classpath"/>
			<arg>
                		<filters defaultexclude="false">
                    			<include class="*Test*" method="*"/>
                		</filters>
			</arg>
	    </jpcoverage>
    </target>

Notes
1. Our junit testclasses do not have a main(...), that would have made my
life a lot easier
2. I am appending the junit target at the end as well

Any suggestions would be greatly appreciated.

thanks,

Haneef Mohamed


=========
junit target
=========
<target name="test" depends="jar-test, jar-server"
		description="Execute Unit Tests">

		<mkdir dir="${build}/reports"/>
		
		<junit failureProperty="junit.failed">
			<classpath refid="c1p.test.classpath"/>
			<formatter type="xml" />
			
			<batchtest todir="${test.reports}">
				    <fileset dir="${test.classes}">
      					<include name="**/Test*.class" />
      					<exclude name="**/TestAll.class" />
      					<exclude name="**/Test*$$*.class" />
					<exclude
name="**/*TestCase*.class"/>
    				    </fileset>
			</batchtest>
			
		</junit>
		
		<junitreport todir="${test.reports}">
			<fileset dir="${test.reports}">
				<include name="TEST-*.xml"/>
			</fileset>
			<report format="noframes" todir="${test.reports}"/>
		</junitreport>
</target>


Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message