ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Matthew Denner <>
Subject JUnit reports "no tests found" but they are there
Date Thu, 12 Jun 2003 20:54:09 GMT

I do my development using Eclipse and I have a build.xml file that runs 
some unittests using JUnit.  When the build.xml file is run in Eclipse 
the tests get run as expected, but the automated build system I have 
that is using Ant 1.5.3 keeps reporting "no tests found"!

I've followed the FAQ and moved the optional.jar file out of the lib 
directory.  I've used taskdef to define the junit task.  But when run 
from the command line I always see this error.  Does anybody have any 
idea why this is happening?

My environment is Redhat Linux running JDK 1.4.1, Ant 1.5.3, and the 
relevent build.xml section is:

   <!-- task.junit.defined is set in Eclipse -->
   <target name="unittest.prepare" unless="task.junit.defined">
     <taskdef name="junit" 
         <path location="${ant.home}/optional/optional.jar"/>
       	<path refid="build.classpath.unittests"/>

   <target name="unittest" depends="compile,unittest.prepare">
     <javac destdir="${build.dir.testcode}">
       <src path="${src.dir.testcode}"/>
         <path refid="build.classpath.src"/>
	<path refid="build.classpath.unittests"/>
	<pathelement location="${build.dir.classes}"/>
       <include name="**/*.java"/>

     <junit haltonerror="yes" printsummary="yes">
       <batchtest haltonfailure="yes" haltonerror="yes">
         <fileset dir="${build.dir.testcode}">
           <include name="**/*Test.class"/>
         <path refid="build.classpath.src"/>
     	<path refid="build.classpath.unittests"/>
     	<pathelement location="${build.dir.classes}"/>
     	<pathelement location="${build.dir.testcode}"/>
       <formatter type="plain" usefile="no"/>


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message