Skip to content

Commit 320648e

Browse files
committed
tests now run at each build
1 parent 4076baa commit 320648e

File tree

2 files changed

+58
-8
lines changed

2 files changed

+58
-8
lines changed

app/build.xml

+58-8
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0"?>
22
<project name="Arduino PDE" default="build">
3-
3+
44
<target name="clean" description="Clean the build directories">
55
<delete dir="bin" />
66
<delete file="pde.jar" />
@@ -24,11 +24,11 @@
2424
<property name="java_home" value="${env.JAVA_HOME}" />
2525

2626
<condition property="linux"><os family="unix" /></condition>
27-
<fail if="linux" unless="java_home"
27+
<fail if="linux" unless="java_home"
2828
message="The JAVA_HOME variable must be set to the location of a full JDK. For instance, on Ubuntu Linux, this might be /usr/lib/jvm/java-6-sun." />
2929

3030
<condition property="windows"><os family="windows" /></condition>
31-
<fail if="windows" unless="java_home"
31+
<fail if="windows" unless="java_home"
3232
message="The JAVA_HOME variable must be set to the location of a full JDK. For instance, on Windows, this might be c:\jdk1.6.0_18." />
3333

3434
<!--
@@ -38,18 +38,68 @@
3838
<fail />
3939
-->
4040
<javac source="1.5" target="1.5"
41-
srcdir="src"
42-
destdir="bin"
41+
srcdir="src"
42+
destdir="bin"
4343
encoding="UTF-8"
4444
includeAntRuntime="false"
4545
debug="true"
46-
classpath="../core/core.jar; ${env.JAVA_HOME}/lib/tools.jar; lib/ant.jar; lib/ant-launcher.jar; lib/apple.jar; lib/ecj.jar; lib/jna.jar; lib/RXTXcomm.jar" />
46+
classpath="../core/core.jar; ${env.JAVA_HOME}/lib/tools.jar; lib/apple.jar; lib/ecj.jar; lib/jna.jar; lib/RXTXcomm.jar" />
4747
<copy todir="bin" overwrite="true" verbose="true">
4848
<fileset dir="src" includes="**/*.properties" />
4949
</copy>
5050
</target>
51-
52-
<target name="build" depends="compile" description="Build PDE">
51+
52+
<target name="test" description="Runs the test">
53+
<mkdir dir="test-bin"/>
54+
55+
<javac source="1.5" target="1.5"
56+
srcdir="test"
57+
destdir="test-bin"
58+
encoding="UTF-8"
59+
includeAntRuntime="false"
60+
debug="true">
61+
<classpath>
62+
<pathelement location="bin"/>
63+
<pathelement location="../core/core.jar"/>
64+
<pathelement location="${env.JAVA_HOME}/lib/tools.jar"/>
65+
<pathelement location="lib/apple.jar"/>
66+
<pathelement location="lib/ecj.jar"/>
67+
<pathelement location="lib/jna.jar"/>
68+
<pathelement location="lib/RXTXcomm.jar"/>
69+
<pathelement location="test-lib/junit-4.11.jar"/>
70+
</classpath>
71+
</javac>
72+
73+
<copy todir="test-bin" overwrite="true" verbose="true">
74+
<fileset dir="test" includes="**/*.zip" />
75+
<fileset dir="test" includes="**/*.txt" />
76+
</copy>
77+
78+
<junit printsummary="yes" haltonfailure="yes">
79+
<classpath>
80+
<pathelement location="bin"/>
81+
<pathelement location="test-bin"/>
82+
<pathelement location="../core/core.jar"/>
83+
<pathelement location="${env.JAVA_HOME}/lib/tools.jar"/>
84+
<pathelement location="lib/apple.jar"/>
85+
<pathelement location="lib/ecj.jar"/>
86+
<pathelement location="lib/jna.jar"/>
87+
<pathelement location="lib/RXTXcomm.jar"/>
88+
<pathelement location="test-lib/junit-4.11.jar"/>
89+
</classpath>
90+
91+
<formatter type="plain"/>
92+
93+
<batchtest fork="yes" todir="test-bin">
94+
<fileset dir="test">
95+
<include name="**/*Test.java"/>
96+
</fileset>
97+
</batchtest>
98+
</junit>
99+
100+
</target>
101+
102+
<target name="build" depends="compile,test" description="Build PDE">
53103
<jar basedir="bin" destfile="pde.jar" />
54104
</target>
55105
</project>

app/test-lib/junit-4.11.jar

282 KB
Binary file not shown.

0 commit comments

Comments
 (0)