<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<project name="test_parent" default="prep_dumps">
<!--PROPERTIES-->
<property name="p4d.port" value="5500" />
<property name="p4d.host" value="localhost" />
<property name="src.dir" location="${basedir}/.." />
<property name="logfile" value="system_test.log" />
<taskdef resource="net/sf/antcontrib/antlib.xml">
<classpath>
<pathelement location="${src.dir}/ext/ant-contrib-1.0b3.jar"/>
</classpath>
</taskdef>
<!-- iterate through all the *.dump files and test each one sequentially -->
<target name="prep_dumps">
<var name="p4d.port" value="${p4d.port}" />
<echo file="${logfile}" append="true" > preparing all tests ${line.separator}</echo>
<for param="file">
<path>
<fileset dir="dumps" >
<include name="*.dump" />
</fileset>
</path>
<sequential>
<antcall target="prep_dump">
<param name="dumpfile" value="@{file}"/>
<param name="port" value="${p4d.host}:${p4d.port}" />
</antcall>
<increment value="${p4d.port}" variable="p4d.port" />
</sequential>
</for>
</target>
<target name="prep_dump">
<basename property="dirname" file="${dumpfile}" suffix=".dump" />
<if>
<not><available file="${dirname}/build.xml" /></not>
<then>
<echo file="${logfile}" append="true" > creating build.xml for ${dumpfile} port ${port} ${line.separator}</echo>
<echo file="${logfile}" append="true" > in directory ${dirname} ${line.separator}</echo>
<mkdir dir="${dirname}" />
<copy file="buildchild.xml" tofile="${dirname}/build.xml" verbose="true" >
<filterset>
<filter token="DUMP" value="${dumpfile}"/>
<filter token="PORT" value="${port}"/>
<filter token="SOURCE" value="${src.dir}"/>
</filterset>
</copy>
</then>
<else>
<echo file="${logfile}" append="true" > ${dirname}/build.xml exists, skipping preparation ${line.separator}</echo>
</else>
</if>
</target>
<!-- takes a value, increments it, and writes it out to a var -->
<scriptdef name="increment" language="javascript">
<attribute name="value" />
<attribute name="variable" />
<![CDATA[
var initVal = attributes.get("value");
var nextNum = parseInt(initVal,10) + 1;
varnew = project.createTask("var");
varnew.setName(attributes.get("variable"))
varnew.setValue(nextNum.toString());
varnew.perform();
]]>
</scriptdef>
<target name="test_dumps">
<echo file="${logfile}" append="true" > running all tests ${line.separator}</echo>
<for param="testdir">
<path>
<dirset dir=".">
<include name="*"/>
</dirset>
</path>
<sequential>
<antcall target="test_dump">
<param name="dirname" value="@{testdir}"/>
</antcall>
</sequential>
</for>
</target>
<target name="test_dump" >
<if>
<and>
<available file="${dirname}/build.xml" />
<not><available file="${dirname}/status.properties" /></not>
</and>
<then>
<echo file="${logfile}" append="true" > running test in ${dirname} ${line.separator}</echo>
<trycatch property="test.result" reference="test.reference">
<try>
<!-- Call the build.xml in the test directory to do the rest -->
<ant antfile="build.xml" dir="${dirname}" inheritAll="false" />
</try>
<catch>
<echo file="${logfile}" append="true" > Test of ${dirname}.dump FAILED! ${line.separator}</echo>
<echo file="${logfile}" append="true" > Result ${test.result} ${line.separator}</echo>
<echo file="${logfile}" append="true" > Reference ${toString:test.reference}</echo>
</catch>
</trycatch>
</then>
</if>
</target>
</project>
# |
Change |
User |
Description |
Committed |
|
#1
|
10025 |
Norman Morse |
fixed system_test to work with both IMPORT and CONVERT mode |
|
|