dol: initial dol commit
[jump.git] / dol / test / dolziptest.xml
1 <?xml version="1.0" encoding="UTF-8"?>\r
2 \r
3 <project name="runtest" default="runtest" basedir=".">\r
4 \r
5   <description>\r
6     Ant build file for automated testing of DOL.\r
7   </description>\r
8 \r
9   <property name="test.dir"           location="dolzip"/>\r
10   <property name="test.resource.dir"  location="${test.dir}/test"/>\r
11   <property name="test.src.dir"       location="${test.resource.dir}/src"/>\r
12   <property name="test.reference.dir" location="${test.resource.dir}/reference"/>\r
13   <property name="build.main.dir"     location="${test.dir}/build/bin/main"/>\r
14   <property name="jars.dir"           location="${test.dir}/bin"/>\r
15   <property name="jars"               value=".:${jars.dir}/jdom.jar:${jars.dir}/xercesImpl.jar"/>\r
16   <property name="systemc.inc"        value="/home/shapes/base/resources/lib/systemC/include"/>\r
17   <property name="systemc.lib"        value="/home/shapes/base/resources/lib/systemC/lib-linux/libsystemc.a"/>\r
18   \r
19   <target name="clean">\r
20     <delete dir="${test.dir}"/>\r
21   </target>\r
22 \r
23   <!-- copy dol_ethz.zip to test and unzip -->\r
24   <target name="unzipandcompiledol">\r
25     <mkdir dir="${test.dir}"/>\r
26     <unzip src="dol_ethz.zip" dest="${test.dir}"/>\r
27     <copy file="${test.dir}/build_zip.xml" tofile="${test.dir}/build_zip_temp.xml">\r
28       <filterchain>\r
29         <tokenfilter>\r
30           <replaceregex pattern="/home/shapes/base/resources/lib/systemC/include"\r
31                         replace="${systemc.inc}"\r
32                         flags="g"/>\r
33         </tokenfilter>\r
34         <tokenfilter>\r
35           <replaceregex pattern="/home/shapes/base/resources/lib/systemC/lib-linux/libsystemc.a"\r
36                         replace="${systemc.lib}"\r
37                         flags="g"/>\r
38         </tokenfilter>\r
39       </filterchain>\r
40     </copy>\r
41     <move file="${test.dir}/build_zip_temp.xml" tofile="${test.dir}/build_zip.xml"/>\r
42     <ant antfile="build_zip.xml"\r
43          dir="${test.dir}"\r
44          target="all"\r
45          inheritAll="false"/>\r
46   </target>\r
47   \r
48   <!-- get resources required for testing -->\r
49   <target name="preparetest">\r
50     <exec executable="svn">\r
51       <arg line="export --no-auth-cache --username tec file:///home/shapes/base/SVNTree/dolPrototype/trunk/test ${test.resource.dir}"/>\r
52     </exec>\r
53 \r
54     <javac destdir="${build.main.dir}" debug="true" classpath="${jars}">\r
55       <src path="${test.src.dir}"/>\r
56     </javac>\r
57     <copy todir="${build.main.dir}" file="${test.resource.dir}/runtests.xml"/>\r
58     <copy todir="${build.main.dir}" file="${test.resource.dir}/test.properties">\r
59       <filterchain>\r
60          <replacetokens>\r
61             <token key="schema_path" value="${test.dir}/schema"/>\r
62          </replacetokens>\r
63       </filterchain>\r
64     </copy>\r
65   </target>\r
66 \r
67   <!-- run tests (uses runtests.xml and runexample.xml in ${build.main.dir}) -->\r
68   <target name="runtest" depends="unzipandcompiledol, preparetest">\r
69     <ant antfile="runtests.xml"\r
70          dir="${build.main.dir}"\r
71          target="xml"\r
72          inheritAll="false"/>\r
73     <ant antfile="runtests.xml"\r
74          dir="${build.main.dir}"\r
75          target="checkexamples"\r
76          inheritAll="false"/>\r
77   </target>\r
78 </project>\r