ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Paul Taylor <>
Subject Some junit tasks fail if run in ant with forkmode="once"
Date Fri, 09 Nov 2007 13:38:14 GMT

If I run my junit tasks from within ant using forkmode="once" a few of 
the tests fail - if I remove the forkmode="once" option they work. I 
cant really understand why this is the case, there is File/IO involved 
in the tests
but the original files are copied as a new file for each test so cannot 
see how that they interfere with each other.

The reason why I need to use formode="once" is because Im using 
cobertura for code coverage, and it loads class information for each VM 
which takes alot longer. So with forkmode="once" my total build takes 1 
min 50 secs,
but without it takes 6 mins 20 seconds.

Anybody have any ideas, thanks paul

<target name="run.tests" depends="compile.tests" description="Run test 
cases" unless="skip.tests">
        <mkdir dir="${junitreport.dir}"/>
        <mkdir dir="${junitreport.testdatatmp.dir}"/>
        <junit fork="yes" forkmode="once" printsummary="true" 
            <classpath location="${instrumented.dir}" />    
            <classpath refid="runtestclasspath"/>        
            <classpath refid="cobertura.classpath" />            
            <batchtest  todir="${junitreport.dir}">
                <formatter type="xml"/>                
                    <fileset dir="${testoutput.dir}">
                        <include name="**/*Test.class"/>                  
        <junitreport todir="${junitreport.dir}">
              <fileset dir="${junitreport.dir}">
                    <include name="TEST-*.xml"/>
              <report format="frames" todir="${junitreport.dir}"/>
        <cobertura-report format="html" destdir="${coveragereport.dir}" 
srcdir="${src.dir}" />

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

View raw message