ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Swaminathan Gurumoorthy <swamiolym...@yahoo.com>
Subject Re: How to call a JUnit TestSuite?
Date Mon, 12 May 2003 19:32:57 GMT
You can use something like this...it creates a neat html report after running all tests. Replace
<test> tag in <junit> task with your own test name *********************************
<project name="projectname" default="main" basedir=".">
<property name="reportdir"          value="${basedir}/reports"/>
 <target name="init">
   <tstamp prefix="build"/>
   <echo>Build starts at ${build.DSTAMP}-${build.TSTAMP}</echo>
  </target>     <target name="unittest" depends="init">
       <junit printsummary="yes" haltonfailure="no">
         <classpath refid="project.class.path"/>
         <test name="com.company.unittest.AllTests" haltonfailure="no" outfile="result">
      <formatter type="xml"/>
    </test>       
       </junit>
       
       <mkdir dir="${reportdir}/report-${build.DSTAMP}-${build.TSTAMP}"/>
       
       <junitreport todir="${reportdir}/report-${build.DSTAMP}-${build.TSTAMP}">
    <fileset dir="${basedir}" includes="result.xml"/>
    <report format="frames" todir="${reportdir}/report-${build.DSTAMP}-${build.TSTAMP}"/>
  </junitreport>
      </target>
    
  
  </project>

"Duffey, Kevin" <KDuffey@marketron.com> wrote:Hi all,

We are trying to get JUnit tests to run. Normally we create a class with main() and call the
suite() method which we run all tests with. Is there any way to call this from the junit task,
or do I have to run all the individual tests in the junit task?

Thanks.


---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.467 / Virus Database: 266 - Release Date: 4/1/2003



***********************************************************
The information contained in this e-mail message may be 
confidential and protected from disclosure. If you are 
not the intended recipient, any dissemination, distribution
or copying is strictly prohibited. If you think that you 
have received this e-mail message in error,
please e-mail the sender at exchangeadmins@marketron.com
***********************************************************


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


---------------------------------
Do you Yahoo!?
The New Yahoo! Search - Faster. Easier. Bingo.
Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message