Skip to content

Commit f198ddc

Browse files
committed
Added timing tests to test target
1 parent 9343be1 commit f198ddc

File tree

2 files changed

+69
-12
lines changed

2 files changed

+69
-12
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
/bin/
22
/build/
3+
/dist/

build.xml

+68-12
Original file line numberDiff line numberDiff line change
@@ -40,26 +40,82 @@
4040
</target>
4141

4242
<target name="dist" depends="build" description="generate the distribution">
43-
<!-- Create the distribution directory -->
44-
4543
<!-- Put everything in ${build} into the java-algorithms-implementation-${DSTAMP}.jar file -->
4644
<jar jarfile="${dist}/java-algorithms-implementation-${DSTAMP}.jar" basedir="${build}"/>
4745
</target>
4846

4947
<target name="run_tests" depends="dist">
50-
<junit printsummary="on" haltonfailure="yes">
51-
<classpath>
52-
<path refid="test.class.path" />
53-
<!-- pathelement location="${build}"/ -->
54-
</classpath>
55-
<formatter type="brief" usefile="false" />
56-
<batchtest>
57-
<fileset dir="${src}" includes="**/test/*.java" excludes="**/test/AllTests.java" />
58-
</batchtest>
48+
<junit fork="true" printsummary="on" haltonfailure="yes">
49+
<jvmarg value="-server"/>
50+
<classpath>
51+
<path refid="test.class.path" />
52+
</classpath>
53+
<formatter type="brief" usefile="false" />
54+
<batchtest>
55+
<fileset dir="${src}" includes="**/test/*.java" excludes="**/test/AllTests.java" />
56+
</batchtest>
5957
</junit>
6058
</target>
6159

62-
<target name="test" depends="run_tests" />
60+
<target name="data_structures" depends="dist" >
61+
<java classname="com.jwetherell.algorithms.data_structures.timing.DataStructuresTiming">
62+
<classpath>
63+
<path refid="test.class.path" />
64+
</classpath>
65+
</java>
66+
</target>
67+
68+
<target name="mathematics" depends="dist" >
69+
<java classname="com.jwetherell.algorithms.mathematics.timing.MathematicsTiming">
70+
<classpath>
71+
<path refid="test.class.path" />
72+
</classpath>
73+
</java>
74+
</target>
75+
76+
<target name="numbers" depends="dist" >
77+
<java classname="com.jwetherell.algorithms.numbers.timing.NumbersTiming">
78+
<classpath>
79+
<path refid="test.class.path" />
80+
</classpath>
81+
</java>
82+
</target>
83+
84+
<target name="search" depends="dist" >
85+
<java classname="com.jwetherell.algorithms.search.timing.SearchTiming">
86+
<classpath>
87+
<path refid="test.class.path" />
88+
</classpath>
89+
</java>
90+
</target>
91+
92+
<target name="sequences" depends="dist" >
93+
<java classname="com.jwetherell.algorithms.sequence.timing.SequencesTiming">
94+
<classpath>
95+
<path refid="test.class.path" />
96+
</classpath>
97+
</java>
98+
</target>
99+
100+
<target name="sorts" depends="dist" >
101+
<java classname="com.jwetherell.algorithms.sorts.timing.SortsTiming">
102+
<classpath>
103+
<path refid="test.class.path" />
104+
</classpath>
105+
</java>
106+
</target>
107+
108+
<target name="strings" depends="dist" >
109+
<java classname="com.jwetherell.algorithms.strings.timing.StringsTiming">
110+
<classpath>
111+
<path refid="test.class.path" />
112+
</classpath>
113+
</java>
114+
</target>
115+
116+
<target name="all_timing" depends="mathematics, numbers, search, sequences, strings, sorts, data_structures" />
117+
118+
<target name="test" depends="run_tests, all_timing" />
63119

64120
<target name="clean" description="clean up">
65121
<!-- Delete the ${build} and ${dist} directory trees -->

0 commit comments

Comments
 (0)