Changeset 6686 for trunk/ant/java.xml


Ignore:
Timestamp:
07/09/10 14:22:11 (9 years ago)
Author:
curtis
Message:

Fix up test targets in Ant build scripts.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/ant/java.xml

    r6583 r6686  
    3131  </target> 
    3232 
    33   <target name="compile-tests" depends="compile, copy-test-source" description="compile test classes" if="doTests"> 
     33  <target name="compile-tests" depends="compile, copy-test-source" 
     34    description="compile test classes" if="doTests"> 
    3435    <javac debug="true" deprecation="${component.deprecation}" 
    3536      source="${component.java-version}" 
     
    4546  </target> 
    4647 
    47   <target name="test" depends="jar, compile-tests" description="run tests" if="doTests"> 
    48     <testng classpath="${test-classes.dir}:${classes.dir}:${component.classpath}" 
    49       groups="all" testname="${component.name}"> 
    50       <xmlfileset file="${testng.xml}"/> 
    51       <jvmarg value="-mx${testng.memory}"/> 
    52     </testng> 
     48  <target name="test" depends="jar, compile-tests" 
     49    description="run tests" if="doTests"> 
     50    <!-- run JUnit tests --> 
     51    <if> 
     52      <equals arg1="${component.junit}" arg2="true"/> 
     53      <then> 
     54        <junit haltonfailure="true"> 
     55          <classpath> 
     56            <pathelement location="${artifact.dir}/junit-4.8.2.jar"/> 
     57            <pathelement location="${test-classes.dir}"/> 
     58            <pathelement location="${classes.dir}"/> 
     59            <pathelement path="${component.runtime-cp}"/> 
     60          </classpath> 
     61          <formatter type="brief" usefile="false"/> 
     62          <batchtest> 
     63            <fileset dir="${test-classes.dir}"> 
     64              <include name="**/*Test.class"/> 
     65            </fileset> 
     66          </batchtest> 
     67        </junit> 
     68      </then> 
     69    </if> 
     70    <!-- run TestNG tests --> 
     71    <if> 
     72      <isset property="testng.xml"/> 
     73      <then> 
     74        <testng haltonfailure="true" groups="all" testname="${component.name}"> 
     75          <classpath> 
     76            <pathelement path="${component.classpath}"/> 
     77            <pathelement location="${test-classes.dir}"/> 
     78            <pathelement location="${classes.dir}"/> 
     79          </classpath> 
     80          <xmlfileset file="${testng.xml}"/> 
     81          <jvmarg value="-mx${testng.memory}"/> 
     82        </testng> 
     83      </then> 
     84    </if> 
    5385  </target> 
    5486 
Note: See TracChangeset for help on using the changeset viewer.