Changeset 26115 for main


Ignore:
Timestamp:
2012-08-16T13:56:40+12:00 (12 years ago)
Author:
sjm84
Message:

Two new tasks for automated building and running of collection tests

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/trunk/greenstone3/build.xml

    r26082 r26115  
    2323  <!--<taskdef name="svn" classname="org.tigris.subversion.svnant.SvnTask" classpathref="project.classpath"/>-->
    2424  <taskdef name="if" classname="ise.antelope.tasks.IfTask" classpathref="project.classpath"/>
     25  <taskdef name="for" classname="net.sf.antcontrib.logic.ForTask" classpathref="project.classpath"/>
    2526  <taskdef name="stringutil" classname="ise.antelope.tasks.StringUtilTask" classpathref="project.classpath"/>
    2627
     
    24202421  </target>
    24212422   
     2423    <target name="run-collection-tests">
     2424        <if><bool><not><available file="${basedir}/ext/testing" type="dir"/></not></bool>
     2425            <fail>The testing extension is not available. This is required to perform the tests. It can be acquired from SVN by running the command "svn co http://svn.greenstone.org/gs3-extensions/testing/trunk/src testing" in the ext directory of your Greenstone 3 installation. </fail>
     2426        </if>
     2427        <for param="testjar">
     2428            <path>
     2429                <fileset dir="${basedir}" includes="web/sites/*/collect/*/tests/tests.jar"/>
     2430            </path>
     2431            <sequential>
     2432                <echo>Testing @{testjar}</echo>
     2433                <java classname="org.junit.runner.JUnitCore" fork="true">
     2434                    <arg value="gstests.TestClass"/>
     2435                    <jvmarg value="-DSERVERURL=http://${tomcat.server}:${tomcat.port}${app.path}${server.default.servlet} "/>
     2436                    <classpath>
     2437                        <fileset dir="${basedir}/ext/testing/lib/java">
     2438                            <include name="*.jar"/>
     2439                        </fileset>
     2440                        <files includes="@{testjar}"/>
     2441                    </classpath>
     2442                </java>
     2443            </sequential>
     2444        </for>
     2445    </target>
     2446   
     2447    <target name="build-collection-tests">
     2448        <if><bool><not><available file="${basedir}/ext/testing" type="dir"/></not></bool>
     2449            <fail>The testing extension is not available. This is required to perform the tests. It can be acquired from SVN by running the command "svn co http://svn.greenstone.org/gs3-extensions/testing/trunk/src testing" in the ext directory of your Greenstone 3 installation. </fail>
     2450        </if>
     2451        <for param="compiledir">
     2452            <path>
     2453                <dirset dir="${basedir}" includes="web/sites/*/collect/*/tests/src"/>
     2454            </path>
     2455            <sequential>
     2456                <echo>Compiling @{compiledir}</echo>
     2457                <if><bool><not><available file="@{compiledir}/../build" type="dir"/></not></bool>
     2458                    <mkdir dir="@{compiledir}/../build"/>
     2459                </if>
     2460                <javac
     2461                    srcdir="@{compiledir}"
     2462                    destdir="@{compiledir}/../build"
     2463                    debug="${compile.debug}"
     2464                    deprecation="${compile.deprecation}"
     2465                    optimize="${compile.optimize}">
     2466                    <classpath>
     2467                        <fileset dir="${basedir}/ext/testing/lib/java">
     2468                            <include name="*.jar"/>
     2469                        </fileset>
     2470                    </classpath>
     2471                    <include name="gstests/*.java"/>
     2472                </javac>
     2473                <jar destfile="@{compiledir}/../tests.jar">
     2474                    <fileset dir="@{compiledir}/../build">
     2475                        <include name="gstests/**"/>
     2476                    </fileset>
     2477                    <manifest>
     2478                        <attribute name="Built-By" value="${user.name}" />
     2479                    </manifest>
     2480                </jar>
     2481            </sequential>
     2482        </for>
     2483    </target>
    24222484</project>
Note: See TracChangeset for help on using the changeset viewer.