+ unit tests

This commit is contained in:
cbonar 2008-09-12 20:56:23 +00:00
parent 9865aabde6
commit 97faad77d8
2 changed files with 16 additions and 4 deletions

View file

@ -29,10 +29,14 @@ lib.dir=lib
# A working directory to store temporary files
build.dir=${basedir}/build
classes.dir=${build.dir}/classes
# Where to find the tests sources
tests.dir=${basedir}/src/test/java
# Where to write the JUnit XML results
tests.logs=${build.dir}/tests-results
# Where to create the packages
target.dir=${basedir}/target

View file

@ -33,13 +33,15 @@
<ivy:retrieve/>
<!-- Creates necessary directories -->
<mkdir dir="${build.dir}"/>
<mkdir dir="${tests.logs}"/>
<mkdir dir="${classes.dir}"/>
<mkdir dir="${target.dir}" />
</target>
<target name="compile" depends="validate" description="Compiles the source code of the project.">
<javac srcdir="${src.dir}" destdir="${build.dir}" source="1.4">
<javac srcdir="${src.dir}" destdir="${classes.dir}" source="1.4">
<src path="${src.dir}" />
<src path="${tests.dir}" />
<classpath>
@ -52,7 +54,7 @@
<dirset dir="/home/cbonar/src/jsunit/java/bin"/>
<dirset dir="${jsunit.dir}/java/config"/>
<copy todir="${build.dir}">
<copy todir="${classes.dir}">
<fileset dir="${rc.dir}" />
</copy>
@ -61,14 +63,20 @@
<!-- NOTE : These tests should not require the code be packaged or deployed. -->
<target name="test" depends="compile" description="Tests the compiled source code using a suitable unit testing framework.">
<!-- nothing to do -->
<junit fork="true">
<test name="java.net.jsunit.GeneratedStandaloneTestTest" todir="${tests.logs}">
<formatter type="xml" />
</test>
</junit>
</target>
<target name="package" depends="test, doc" description="Takes the compiled code and package it in its distributable format.">
<jar destfile="${target.dir}/${ant.project.name}-${ivy.revision}.jar"
basedir="${build.dir}">
basedir="${classes.dir}">
<include name="**/*"/>
</jar>