joerg       2004/04/29 14:32:49

  Modified:    tools/targets test-build.xml
               .        build.properties
  Log:
  added junit-test-debug target for doing remote debugging;
  added <fail> after junitreport for letting the build fail if a junit test 
failed or caused an error
  
  Revision  Changes    Path
  1.8       +26 -5     cocoon-2.1/tools/targets/test-build.xml
  
  Index: test-build.xml
  ===================================================================
  RCS file: /home/cvs/cocoon-2.1/tools/targets/test-build.xml,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- test-build.xml    29 Apr 2004 00:36:06 -0000      1.7
  +++ test-build.xml    29 Apr 2004 21:32:49 -0000      1.8
  @@ -23,13 +23,14 @@
     <!-- Runs all tests -->
     <target name="test" depends="junit-tests, block-tests" description="Runs 
all tests"/>
   
  -  <!-- Runs JUnit tests -->
  -  <target name="junit-tests" depends="compile-tests">
  +  <target name="junit-prepare">
       <delete dir="${build.test.output}"/>
       <mkdir dir="${build.test.output}"/>
  -    <junit printsummary="yes" fork="yes">
  -      <!--jvmarg value="-Xdebug"/>
  -      <jvmarg 
value="-Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000"/-->
  +  </target>
  +
  +  <!-- Runs JUnit tests -->
  +  <target name="junit-tests" depends="compile-tests, junit-prepare">
  +    <junit printsummary="yes" fork="yes" failureproperty="junit.test.failed">
         <classpath refid="test.classpath"/>
         <formatter type="plain"/>
         <formatter type="xml"/>
  @@ -44,12 +45,32 @@
           </fileset>
         </batchtest>
       </junit>
  +    <antcall target="junit-report"/>
  +  </target>
  +
  +  <!-- Runs JUnit tests in debug mode -->
  +  <target name="junit-test-debug" depends="compile-tests, junit-prepare">
  +    <fail unless="junit.testcase" message="Please set the property 
$${junit.testcase} to a JUnit testcase (package.Classname, e.g. 
org.test.MyTestCase)."/>
  +    <echo message="The JVM will be suspended until you connect with your 
favourite debugger to port ${junit.test.debugport}."/>
  +    <junit printsummary="yes" fork="yes" failureproperty="junit.test.failed">
  +      <jvmarg value="-Xdebug"/>
  +      <jvmarg 
value="-Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=${junit.test.debugport}"/>
  +      <classpath refid="test.classpath"/>
  +      <formatter type="plain"/>
  +      <formatter type="xml"/>
  +      <test name="${junit.testcase}" todir="${build.test.output}"/>
  +    </junit>
  +    <antcall target="junit-report"/>
  +  </target>
  +
  +  <target name="junit-report">
       <junitreport todir="${build.test.output}">
         <fileset dir="${build.test.output}">
          <include name="TEST-*.xml"/>
         </fileset>
         <report format="frames" todir="${build.test.output}"/>
       </junitreport>
  +    <fail if="junit.test.failed" message="One or more JUnit tests failed or 
caused errors. Please have a look into the report for details."/>
     </target>
   
     <!-- Anteater tests  -->
  
  
  
  1.39      +5 -0      cocoon-2.1/build.properties
  
  Index: build.properties
  ===================================================================
  RCS file: /home/cvs/cocoon-2.1/build.properties,v
  retrieving revision 1.38
  retrieving revision 1.39
  diff -u -r1.38 -r1.39
  --- build.properties  29 Apr 2004 00:33:34 -0000      1.38
  +++ build.properties  29 Apr 2004 21:32:49 -0000      1.39
  @@ -63,6 +63,11 @@
   # disable some long-running tests by default
   # anteater.test.bug26186InternalRequestMemoryLeak.enabled = true
   
  +# ---- JUnit 
-------------------------------------------------------------------
  +
  +junit.test.debugport=8000
  +#junit.testcase=org.apache.cocoon.util.test.NetUtilsTestCase
  +
   # ---- Build 
-------------------------------------------------------------------
   
   build.root=build
  
  
  

Reply via email to