You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by Phillip Lord <p....@russet.org.uk> on 2003/08/01 15:16:42 UTC

Standard Out Flushing in JUnit



Hello all


I've been using the JUnit task for a while now, and its generally very
good. But there is one thing about it that I find annoying. 

Some of my tests take a reasonable amount of time, but standard output
and standard error are held until the test finishes. I'd much rather
get the information straight out as it comes. 

The reason for this is that I sometimes use tests while developing
just as a handy place to put debugging statements in, and waiting till
the whole test finishes is often unnecessary. 

My target looks like this...


  <target name="test" depends="compiletests"
	  description="runs the test files">
    <mkdir dir="${test-results}"/>
    <junit fork="yes" haltonfailure="no" printsummary="${junit.printsummary}">
      <classpath refid = "tools-classpath" />
      <!-- set usefile="no" to write to console -->
      <formatter usefile="${junit.usefile}" type="plain"/>
      <test name="${testsuite}" todir="${test-results}"/>
    </junit>
  </target>


with these property set

junit.usefile=no
junit.printsummary=withOutAndErr


Is there anyway that I can do this? 

Cheers

Phil

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