Skip to content

Commit

Permalink
Add "test" target - only run tests for Janeway so far
Browse files Browse the repository at this point in the history
  • Loading branch information
fracture91 committed Jan 17, 2013
1 parent dc9dad7 commit b353bf5
Show file tree
Hide file tree
Showing 4 changed files with 48 additions and 8 deletions.
44 changes: 36 additions & 8 deletions Janeway/build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,50 @@
<project name="Janeway" default="default">
<import file="../build-common.xml"/>

<path id="classpath">
<pathelement path="../Network/build"/>
<pathelement path="../Core/WPISuite-Interfaces/build"/>
<fileset dir="${core-lib}">
<include name="commons-codec-1.7.jar"/>
</fileset>
<pathelement path="build"/>
</path>

<path id="test-classpath">
<path refid="classpath"/>
<pathelement path="build-test"/>
<pathelement path="${junit-jar}"/>
</path>

<target name="compile">
<mkdir dir="build"/>
<javac srcdir="src" destdir="build" includeJavaRuntime="yes">
<classpath>
<pathelement path="../Network/build"/>
<pathelement path="../Core/WPISuite-Interfaces/build"/>
<fileset dir="${core-lib}">
<include name="commons-codec-1.7.jar"/>
</fileset>
<pathelement path="build"/>
</classpath>
<classpath refid="classpath"/>
</javac>
</target>

<target name="compile-test">
<mkdir dir="build-test"/>
<javac srcdir="test" destdir="build-test" includeJavaRuntime="yes">
<classpath refid="test-classpath"/>
</javac>
</target>

<target name="clean">
<delete dir="build"/>
<delete dir="build-test"/>
</target>

<target name="test" depends="compile, compile-test">
<junit printsummary="yes" haltonfailure="no">
<classpath refid="test-classpath"/>
<formatter type="plain" usefile="false"/>
<batchtest fork="yes">
<fileset dir="test">
<include name="**/*Test*.java"/>
</fileset>
</batchtest>
</junit>
</target>

</project>
6 changes: 6 additions & 0 deletions build-common.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
<import file="dependencies.xml"/>

<property name="core-lib" location="${dependencies.basedir}/Core/WPISuite/WebContent/WEB-INF/lib"/>
<property name="junit-jar" location="${dependencies.basedir}/junit-4.8.2.jar"/>

<target name="clean" description="Deletes files created during the build">
<echo message="${ant.project.name} - build-common.clean - not implemented"/>
Expand All @@ -16,6 +17,11 @@
<echo message="${ant.project.name} - build-common.dist - not implemented"/>
</target>

<target name="test" depends="compile" description="Runs tests">
<echo message="${ant.project.name} - build-common.test - no tests"/>
</target>


<target name="clean.dependencies"
description="Deletes files created during the build (includes dependencies)">
<antcall target="depend.${ant.project.name}">
Expand Down
6 changes: 6 additions & 0 deletions build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,10 @@
<param name="dependency.target" value="dist"/>
</antcall>
</target>

<target name="test" description="Runs tests">
<antcall target="depend.all">
<param name="dependency.target" value="test"/>
</antcall>
</target>
</project>
Binary file added junit-4.8.2.jar
Binary file not shown.

0 comments on commit b353bf5

Please sign in to comment.