Skip to content

Commit

Permalink
Added test to run all the tests and rearranged build files a bit. Wor…
Browse files Browse the repository at this point in the history
…ks although not ideal.
  • Loading branch information
Jennifer committed Mar 6, 2010
1 parent b7712e1 commit 31809ac
Show file tree
Hide file tree
Showing 5 changed files with 41 additions and 28 deletions.
33 changes: 23 additions & 10 deletions common.xml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,15 @@
</section>
</manifest>
</target>


<target name="dist" depends="clean" description="Build distribution.">
<ant antfile="build.xml" target="jar" inheritAll="false"/>
<mkdir dir="${build.dir}/dist"/>
<copy toDir="${build.dir}/dist" >
<path refid="dist.path"/>
</copy>
</target>

<target name="test.compile" depends="compile" description="Compile test source.">
<fail unless="testtype" message="The 'testtype' property is unset"/>
<fail unless="testdirtocompile" message="The 'testdirtocompile' property is unset"/>
Expand All @@ -53,19 +61,21 @@
</copy>
</target>

<target name="runtests" depends="test.compile" description="Execute unit tests">
<target name="runtests" depends="dist, test.compile" description="Execute unit tests">
<fail unless="testtype" message="The 'testtype' property is unset"/>
<mkdir dir="${build.dir}/reports"/>
<mkdir dir="${build.dir}/${testtype}/reports"/>
<mkdir dir="${build.dir}/tmp"/>
<junit fork="yes" printsummary="yes">
<classpath>
<pathelement location="${build.dir}/${testtype}"/>
<pathelement location="${build.dir}/dist"/>
<pathelement location="${build.dir}/classes"/>
<path refid="compile.classpath"/>
</classpath>

<formatter type="plain"/>

<batchtest fork="yes" todir="${build.dir}/reports">
<batchtest fork="yes" todir="${build.dir}/${testtype}/reports">
<fileset dir="${build.dir}/${testtype}">
<include name="**/*Test.class"/>
</fileset>
Expand All @@ -75,18 +85,21 @@
</target>

<target name="unittest" description="Compile and execute unittests">
<antcall target="runtests">
<param name="testtype" value="unittest"/>
<param name="testdirtocompile" value="${unittest.dir}"/>
</antcall>
<property name="testtype" value="unittest"/>
<property name="testdirtocompile" value="${unittest.dir}"/>
<antcall target="runtests"/>
</target>

<target name="acceptancetest" description="Compile and execute acceptance tests">
<target name="acceptancetest" description="Compile and execute acceptance tests">
<!-- <property name="testtype" value="acceptancetest"/>
<property name="testdirtocompile" value="${acceptancetest.dir}"/> -->
<antcall target="runtests">
<param name="testtype" value="acceptancetest"/>
<param name="testdirtocompile" value="${acceptancetest.dir}"/>
</antcall>
</target>
</target>

<target name="test" depends="unittest, acceptancetest" description="Compiles all code and runs all the tests"/>

<target name="clean" description="Remove generated files.">
<delete dir="${build.dir}"/>
Expand Down
1 change: 1 addition & 0 deletions org.netmelody.docnap.core/build.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@ unittest.dir=unittest
acceptancetest.dir=acceptancetest
build.dir=build
module=org.netmelody.docnap.core
buildxml.dir=org.netmelody.docnap.core
vendor.dir=vendor
19 changes: 10 additions & 9 deletions org.netmelody.docnap.core/build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,16 @@
<project name="docnap-core" basedir="." default="jar">

<import file="../common.xml"/>

<path id="compile.classpath">
<fileset dir="vendor/lib" includes="*.jar"/>
<fileset dir="vendor/buildlib" includes="*.jar"/>
</path>

<path id="dist.path">
<fileset dir="vendor/lib" includes="*.jar"/>
<fileset dir="${build.dir}" includes="*.jar"/>
</path>

<target name="launchdatabasemanager" description="Launch the HSQLDB database manager">
<java classname="org.hsqldb.util.DatabaseManager">
Expand All @@ -20,14 +25,10 @@
<fileset dir="db" includes="**/*.*"/>
<fileset dir="${build.dir}/classes"/>
</jar>
</target>

<target name="dist" depends="clean, jar" description="Build distribution.">
<mkdir dir="${build.dir}/dist"/>
<copy toDir="${build.dir}/dist">
<fileset dir="vendor/lib" includes="*.jar"/>
<fileset dir="${build.dir}" includes="*.jar"/>

<copy toDir="${build.dir}/classes">
<fileset dir="db" includes="**/*.*"/>
</copy>
</target>

</project>
1 change: 1 addition & 0 deletions org.netmelody.docnap.swingclient/build.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@ unittest.dir=unittest
acceptancetest.dir=acceptancetest
build.dir=build
module=org.netmelody.docnap.swingclient
buildxml.dir=org.netmelody.docnap.swingclient
15 changes: 6 additions & 9 deletions org.netmelody.docnap.swingclient/build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,12 @@
<fileset dir="${core.dir}/${build.dir}/dist" includes="*.jar"/>
</path>

<path id="dist.path">
<fileset dir="${core.dir}/${build.dir}/dist" includes="*.jar"/>
<fileset dir="vendor/lib" includes="*.jar"/>
<fileset dir="${build.dir}" includes="*.jar"/>
</path>

<target name="distcore" description="Build core distribution.">
<ant antfile="${core.dir}/build.xml" target="dist" inheritAll="false"/>
</target>
Expand All @@ -28,15 +34,6 @@
</jar>
</target>

<target name="dist" depends="clean, jar" description="Build distribution.">
<mkdir dir="${build.dir}/dist"/>
<copy toDir="${build.dir}/dist">
<fileset dir="${core.dir}/${build.dir}/dist" includes="*.jar"/>
<fileset dir="vendor/lib" includes="*.jar"/>
<fileset dir="${build.dir}" includes="*.jar"/>
</copy>
</target>

<target name="release" depends="dist" description="Build single release jar with dependencies embedded.">
<mkdir dir="${build.dir}/release"/>
<jar jarfile="${build.dir}/release/${ant.project.name}-standalone-${version}.jar">
Expand Down

0 comments on commit 31809ac

Please sign in to comment.