Changeset 6686


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

Fix up test targets in Ant build scripts.

Location:
trunk
Files:
9 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 
  • trunk/ant/toplevel.xml

    r6234 r6686  
    444444 
    445445  <target name="utils-formats" depends="jar-formats" 
    446     description="compile extra utilities for LOCI Plugins for ImageJ"> 
     446    description="compile extra utilities for Bio-Formats"> 
    447447    <ant dir="components/bio-formats" target="formats.utils"/> 
    448448  </target> 
  • trunk/components/bio-formats/build.xml

    r6072 r6686  
    1313  <property file="build.properties"/> 
    1414 
    15   <target name="test" 
    16     depends="jar,compile-tests,test-no-mdb,test-no-netcdf,test-no-ome-xml, 
    17     test-no-poi,test-no-jai,test-no-lurawave" 
    18     description="run tests" if="doTests"> 
     15  <target name="test" depends="jar,compile-tests,test-no-mdb,test-no-netcdf, 
     16    test-no-ome-xml, test-no-poi,test-no-jai,test-no-lurawave" 
     17    description="run tests"> 
     18    <!-- NOTE: Overrides default "test" target from java.xml --> 
    1919    <copy tofile="${build.dir}/testng.xml" overwrite="true" 
    2020      file="${tests.dir}/loci/formats/utests/testng.xml"/> 
    21     <testng classpath="${test-classes.dir}:${classes.dir}:${component.classpath}" 
    22       groups="all" testname="${component.name}"> 
     21    <testng haltonfailure="true" groups="all" testname="${component.name}"> 
     22      <classpath> 
     23        <pathelement location="${test-classes.dir}"/> 
     24        <pathelement location="${classes.dir}"/> 
     25        <pathelement path="${component.classpath}"/> 
     26      </classpath> 
    2327      <xmlfileset file="${build.dir}/testng.xml"/> 
    2428      <jvmarg value="-mx${testng.memory}"/> 
     
    3135    <copy tofile="${build.dir}/testng.xml" overwrite="true" 
    3236      file="${tests.dir}/loci/formats/utests/testng-no-mdb.xml"/> 
    33     <testng classpath= 
    34       "${test-classes.dir}:${classes.dir}:${component.cp.no-mdb}"> 
    35     <!--<testng classpath="${test-classes.dir}:${classes.dir}:${artifact.dir}/loci-common.jar">--> 
     37    <testng> 
     38      <classpath> 
     39        <pathelement location="${test-classes.dir}"/> 
     40        <pathelement location="${classes.dir}"/> 
     41        <pathelement path="${component.cp.no-mdb}"/> 
     42      </classpath> 
    3643      <xmlfileset file="${build.dir}/testng.xml"/> 
    3744      <jvmarg value="-mx${testng.memory}"/> 
     
    4350    <copy tofile="${build.dir}/testng.xml" overwrite="true" 
    4451      file="${tests.dir}/loci/formats/utests/testng-no-netcdf.xml"/> 
    45     <testng classpath= 
    46       "${test-classes.dir}:${classes.dir}:${component.cp.no-netcdf}"> 
     52    <testng> 
     53      <classpath> 
     54        <pathelement location="${test-classes.dir}"/> 
     55        <pathelement location="${classes.dir}"/> 
     56        <pathelement path="${component.cp.no-netcdf}"/> 
     57      </classpath> 
    4758      <xmlfileset file="${build.dir}/testng.xml"/> 
    4859      <jvmarg value="-mx${testng.memory}"/> 
     
    5465    <copy tofile="${build.dir}/testng.xml" overwrite="true" 
    5566      file="${tests.dir}/loci/formats/utests/testng-no-ome-xml.xml"/> 
    56     <testng classpath= 
    57     "${test-classes.dir}:${classes.dir}:${component.cp.no-xml}"> 
     67    <testng> 
     68      <classpath> 
     69        <pathelement location="${test-classes.dir}"/> 
     70        <pathelement location="${classes.dir}"/> 
     71        <pathelement path="${component.cp.no-xml}"/> 
     72      </classpath> 
    5873      <xmlfileset file="${build.dir}/testng.xml"/> 
    5974      <jvmarg value="-mx${testng.memory}"/> 
     
    6580    <copy tofile="${build.dir}/testng.xml" overwrite="true" 
    6681      file="${tests.dir}/loci/formats/utests/testng-no-poi.xml"/> 
    67     <testng classpath= 
    68       "${test-classes.dir}:${classes.dir}:${component.cp.no-poi}"> 
     82    <testng> 
     83      <classpath> 
     84        <pathelement location="${test-classes.dir}"/> 
     85        <pathelement location="${classes.dir}"/> 
     86        <pathelement path="${component.cp.no-poi}"/> 
     87      </classpath> 
    6988      <xmlfileset file="${build.dir}/testng.xml"/> 
    7089      <jvmarg value="-mx${testng.memory}"/> 
     
    7695    <copy tofile="${build.dir}/testng.xml" overwrite="true" 
    7796      file="${tests.dir}/loci/formats/utests/testng-no-jai.xml"/> 
    78     <testng classpath= 
    79       "${test-classes.dir}:${classes.dir}:${component.cp.no-jai}"> 
     97    <testng> 
     98      <classpath> 
     99        <pathelement location="${test-classes.dir}"/> 
     100        <pathelement location="${classes.dir}"/> 
     101        <pathelement path="${component.cp.no-jai}"/> 
     102      </classpath> 
    80103      <xmlfileset file="${build.dir}/testng.xml"/> 
    81104      <jvmarg value="-mx${testng.memory}"/> 
     
    87110    <copy tofile="${build.dir}/testng.xml" overwrite="true" 
    88111      file="${tests.dir}/loci/formats/utests/testng-no-lurawave.xml"/> 
    89     <testng classpath= 
    90       "${test-classes.dir}:${classes.dir}:${component.cp.no-lurawave}"> 
     112    <testng> 
     113      <classpath> 
     114        <pathelement location="${test-classes.dir}"/> 
     115        <pathelement location="${classes.dir}"/> 
     116        <pathelement path="${component.cp.no-lurawave}"/> 
     117      </classpath> 
    91118      <xmlfileset file="${build.dir}/testng.xml"/> 
    92119      <jvmarg value="-mx${testng.memory}"/> 
     
    96123  <target name="test-metadata" depends="compile-tests" 
    97124    description="test metadata level support for a single file" if="doTests"> 
    98     <testng sourcedir="${test.dir}" 
    99       classpath="${test-classes.dir}:${classes.dir}:${component.classpath}" 
    100       testname="Metadata tests"> 
     125    <testng sourcedir="${test.dir}" testname="Metadata tests"> 
     126      <classpath> 
     127        <pathelement location="${test-classes.dir}"/> 
     128        <pathelement location="${classes.dir}"/> 
     129        <pathelement path="${component.classpath}"/> 
     130      </classpath> 
    101131      <classfileset file="${test-classes.dir}/loci/formats/utests/MetadataConfigurableTest.class"/> 
    102132      <sysproperty key="testng.filename" value="${testng.filename}"/> 
  • trunk/components/common/build.xml

    r6093 r6686  
    1313  <property file="build.properties"/> 
    1414 
    15   <target name="test" depends="jar, compile-tests" 
    16     description="run tests" if="doTests"> 
     15  <target name="test" depends="jar, compile-tests" description="run tests"> 
    1716    <!-- NOTE: Overrides default "test" target from java.xml --> 
    1817    <copy tofile="${build.dir}/testng.xml" 
    1918      file="${testng.xml.template}" overwrite="true"> 
    2019      <filterset> 
    21         <filter token="PARALLEL" value=""/>  <!-- Disable parallelization --> 
     20        <filter token="PARALLEL" value=""/> <!-- Disable parallelization --> 
    2221      </filterset> 
    2322    </copy> 
    24     <testng 
    25         classpath="${test-classes.dir}:${classes.dir}:${component.runtime-cp}"> 
     23    <testng> 
     24      <classpath> 
     25        <pathelement location="${test-classes.dir}"/> 
     26        <pathelement location="${classes.dir}"/> 
     27        <pathelement path="${component.runtime-cp}"/> 
     28      </classpath> 
    2629      <xmlfileset file="${build.dir}/testng.xml"/> 
    2730      <jvmarg value="-mx${testng.memory}"/> 
     
    3740      </filterset> 
    3841    </copy> 
    39     <testng 
    40         classpath="${test-classes.dir}:${classes.dir}:${component.runtime-cp}"> 
     42    <testng> 
     43      <classpath> 
     44        <pathelement location="${test-classes.dir}"/> 
     45        <pathelement location="${classes.dir}"/> 
     46        <pathelement path="${component.runtime-cp}"/> 
     47      </classpath> 
    4148      <xmlfileset file="${build.dir}/testng.xml"/> 
    4249      <jvmarg value="-mx${testng.memory}"/> 
  • trunk/components/loci-plugins/build.properties

    r6684 r6686  
    2727component.main-class     = loci.plugins.About 
    2828component.runtime-cp     = ${component.classpath} 
     29 
     30component.junit          = true 
  • trunk/components/loci-plugins/build.xml

    r6506 r6686  
    1212  <import file="${root.dir}/ant/java.xml"/> 
    1313  <property file="build.properties"/> 
    14  
    15   <target name="test" depends="jar, compile-tests" 
    16     description="run tests" if="doTests"> 
    17     <!-- overrides default 'test' target in java.xml --> 
    18  
    19     <junit> 
    20       <classpath> 
    21         <pathelement path="${component.classpath}"/> 
    22         <pathelement location="${test-classes.dir}"/> 
    23       </classpath> 
    24       <formatter type="plain" usefile="true"/> 
    25       <test name="loci.plugins.in.ImporterTest"/> 
    26     </junit> 
    27   </target> 
    2814</project> 
  • trunk/components/ome-io/build.xml

    r6026 r6686  
    1313  <property file="build.properties"/> 
    1414 
    15   <target name="test" depends="jar,test-no-omeio" description="run tests" if="doTests"> 
     15  <target name="test" depends="jar, test-no-omeio" description="run tests"> 
     16    <!-- NOTE: Overrides default "test" target from java.xml --> 
    1617    <copy tofile="${build.dir}/testng.xml" overwrite="true" 
    1718      file="${tests.dir}/loci/ome/utests/testng.xml"/> 
    18     <testng 
    19       classpath="${test-classes.dir}:${classes.dir}:${component.classpath}"> 
     19    <testng> 
     20      <classpath> 
     21        <pathelement location="${test-classes.dir}"/> 
     22        <pathelement location="${classes.dir}"/> 
     23        <pathelement path="${component.classpath}"/> 
     24      </classpath> 
    2025      <xmlfileset file="${build.dir}/testng.xml"/> 
    2126      <jvmarg value="-mx${testng.memory}"/> 
     
    2631    <copy tofile="${build.dir}/testng.xml" overwrite="true" 
    2732      file="${tests.dir}/loci/ome/utests/testng-no-ome-io.xml"/> 
    28     <testng classpath="${test-classes.dir}:${component.classpath}"> 
     33    <testng> 
     34      <classpath> 
     35        <pathelement location="${test-classes.dir}"/> 
     36        <pathelement path="${component.classpath}"/> 
     37      </classpath> 
    2938      <xmlfileset file="${build.dir}/testng.xml"/> 
    3039      <jvmarg value="-mx${testng.memory}"/> 
  • trunk/components/test-suite/build.xml

    r6016 r6686  
    1313  <property file="build.properties"/> 
    1414 
    15   <taskdef name="testng" classpath="${component.classpath}" 
    16     classname="org.testng.TestNGAntTask"/> 
    17  
    1815  <target name="test-convert" depends="compile" 
    1916    description="run automated tests on writers"> 
    2017    <testng sourcedir="${dest.dir}" 
    21       classpath="${classes.dir}:${component.classpath}" 
    2218      annotations="Javadoc" groups="all" testname="Writer tests" 
    2319      listener="loci.tests.testng.DotTestListener" 
    2420      suitename="LOCI software test suite"> 
     21      <classpath> 
     22        <pathelement location="${classes.dir}"/> 
     23        <pathelement path="${component.classpath}"/> 
     24      </classpath> 
    2525      <classfileset file="${classes.dir}/${writer-test.class}"/> 
    2626      <sysproperty key="testng.filename" value="${testng.filename}"/> 
     
    3434    description="run all automated tests"> 
    3535    <testng sourcedir="${dest.dir}" 
    36       classpath="${classes.dir}:${component.classpath}" 
    3736      annotations="Javadoc" groups="all" testname="All tests" 
    3837      listener="loci.tests.testng.DotTestListener" 
    3938      suitename="LOCI software test suite"> 
     39      <classpath> 
     40        <pathelement location="${classes.dir}"/> 
     41        <pathelement path="${component.classpath}"/> 
     42      </classpath> 
    4043      <classfileset file="${classes.dir}/${reader-test.class}"/> 
    4144      <sysproperty key="testng.filename" value="${testng.filename}"/> 
     
    5053    description="generate config files for automated test suite"> 
    5154    <testng sourcedir="${dest.dir}" 
    52       classpath="${classes.dir}:${component.classpath}" 
    5355      annotations="Javadoc" groups="config" testname="Config generation" 
    5456      listener="loci.tests.testng.DotTestListener" 
    5557      suitename="LOCI software test suite"> 
     58      <classpath> 
     59        <pathelement location="${classes.dir}"/> 
     60        <pathelement path="${component.classpath}"/> 
     61      </classpath> 
    5662      <classfileset file="${classes.dir}/${reader-test.class}"/> 
    5763      <sysproperty key="testng.filename" value="${testng.filename}"/> 
     
    6672    description="run automated tests in group 'fast'"> 
    6773    <testng sourcedir="${dest.dir}" 
    68       classpath="${classes.dir}:${component.classpath}" 
    6974      annotations="Javadoc" groups="fast" testname="Fast tests" 
    7075      listener="loci.tests.testng.DotTestListener" 
    7176      suitename="LOCI software test suite"> 
     77      <classpath> 
     78        <pathelement location="${classes.dir}"/> 
     79        <pathelement path="${component.classpath}"/> 
     80      </classpath> 
    7281      <classfileset file="${classes.dir}/${reader-test.class}"/> 
    7382      <sysproperty key="testng.filename" value="${testng.filename}"/> 
     
    8291    description="run automated tests in group 'pixels'"> 
    8392    <testng sourcedir="${dest.dir}" 
    84       classpath="${classes.dir}:${component.classpath}" 
    8593      annotations="Javadoc" groups="pixels" testname="Pixels tests" 
    8694      listener="loci.tests.testng.DotTestListener" 
    8795      suitename="LOCI software test suite"> 
     96      <classpath> 
     97        <pathelement location="${classes.dir}"/> 
     98        <pathelement path="${component.classpath}"/> 
     99      </classpath> 
    88100      <classfileset file="${classes.dir}/${reader-test.class}"/> 
    89101      <sysproperty key="testng.filename" value="${testng.filename}"/> 
     
    98110    description="run automated tests in group 'xml'"> 
    99111    <testng sourcedir="${dest.dir}" 
    100       classpath="${classes.dir}:${component.classpath}" 
    101112      annotations="Javadoc" groups="xml" testname="XML tests" 
    102113      listener="loci.tests.testng.DotTestListener" 
    103114      suitename="LOCI software test suite"> 
     115      <classpath> 
     116        <pathelement location="${classes.dir}"/> 
     117        <pathelement path="${component.classpath}"/> 
     118      </classpath> 
    104119      <classfileset file="${classes.dir}/${reader-test.class}"/> 
    105120      <sysproperty key="testng.filename" value="${testng.filename}"/> 
  • trunk/components/visbio/build.properties

    r6521 r6686  
    3131component.main-class     = loci.visbio.VisBio 
    3232component.runtime-cp     = ${component.classpath} 
     33 
     34component.junit          = true 
    3335 
    3436# Properties for dist targets 
Note: See TracChangeset for help on using the changeset viewer.