|
5 | 5 |
|
6 | 6 | <!-- set global properties for this build --> |
7 | 7 | <property name="src" location="src"/> |
| 8 | + <property name="test" location="test"/> |
8 | 9 | <property name="build" location="build"/> |
9 | 10 | <property name="dist" location="dist"/> |
10 | 11 |
|
|
58 | 59 | <jar jarfile="${dist}/java-algorithms-implementation-${DSTAMP}.jar" basedir="${build}"/> |
59 | 60 | </target> |
60 | 61 |
|
61 | | - <target name="run_tests" depends="dist"> |
| 62 | + <target name="build_tests" depends="dist" description="build the source"> |
| 63 | + <!-- Compile the java testing code from ${test} into ${build} --> |
| 64 | + <javac includeantruntime="false" srcdir="${test}" destdir="${build}"> |
| 65 | + <compilerarg value="-Xlint:unchecked"/> |
| 66 | + <classpath refid="class.path" /> |
| 67 | + </javac> |
| 68 | + </target> |
| 69 | + |
| 70 | + <target name="tests_jar" depends="build_tests" description="generate the tests jar"> |
| 71 | + <!-- Put everything in ${build} into the java-algorithms-implementation-tests-${DSTAMP}.jar file --> |
| 72 | + <jar jarfile="${dist}/java-algorithms-implementation-tests-${DSTAMP}.jar" basedir="${build}"/> |
| 73 | + </target> |
| 74 | + |
| 75 | + <target name="run_tests" depends="tests_jar"> |
62 | 76 | <junit printsummary="on" haltonfailure="yes"> |
63 | 77 | <jvmarg value="-server"/> |
64 | 78 | <classpath> |
65 | 79 | <path refid="test.class.path" /> |
66 | 80 | </classpath> |
67 | 81 | <formatter type="brief" usefile="false" /> |
68 | 82 | <batchtest> |
69 | | - <fileset dir="${src}" includes="**/test/*.java" excludes="**/test/AllTests.java" /> |
| 83 | + <fileset dir="${test}" includes="**/test/*.java" excludes="**/test/AllTests.java" /> |
70 | 84 | </batchtest> |
71 | 85 | </junit> |
72 | 86 | </target> |
73 | 87 |
|
74 | | - <target name="data_structures" depends="dist" > |
| 88 | + <target name="data_structures" depends="tests_jar" > |
75 | 89 | <java classname="com.jwetherell.algorithms.data_structures.timing.DataStructuresTiming"> |
76 | 90 | <classpath> |
77 | 91 | <path refid="test.class.path" /> |
78 | 92 | </classpath> |
79 | 93 | </java> |
80 | 94 | </target> |
81 | 95 |
|
82 | | - <target name="mathematics" depends="dist" > |
| 96 | + <target name="mathematics" depends="tests_jar" > |
83 | 97 | <java classname="com.jwetherell.algorithms.mathematics.timing.MathematicsTiming"> |
84 | 98 | <classpath> |
85 | 99 | <path refid="test.class.path" /> |
86 | 100 | </classpath> |
87 | 101 | </java> |
88 | 102 | </target> |
89 | 103 |
|
90 | | - <target name="numbers" depends="dist" > |
| 104 | + <target name="numbers" depends="tests_jar" > |
91 | 105 | <java classname="com.jwetherell.algorithms.numbers.timing.NumbersTiming"> |
92 | 106 | <classpath> |
93 | 107 | <path refid="test.class.path" /> |
94 | 108 | </classpath> |
95 | 109 | </java> |
96 | 110 | </target> |
97 | 111 |
|
98 | | - <target name="search" depends="dist" > |
| 112 | + <target name="search" depends="tests_jar" > |
99 | 113 | <java classname="com.jwetherell.algorithms.search.timing.SearchTiming"> |
100 | 114 | <classpath> |
101 | 115 | <path refid="test.class.path" /> |
102 | 116 | </classpath> |
103 | 117 | </java> |
104 | 118 | </target> |
105 | 119 |
|
106 | | - <target name="sequences" depends="dist" > |
| 120 | + <target name="sequences" depends="tests_jar" > |
107 | 121 | <java classname="com.jwetherell.algorithms.sequence.timing.SequencesTiming"> |
108 | 122 | <classpath> |
109 | 123 | <path refid="test.class.path" /> |
110 | 124 | </classpath> |
111 | 125 | </java> |
112 | 126 | </target> |
113 | 127 |
|
114 | | - <target name="sorts" depends="dist" > |
| 128 | + <target name="sorts" depends="tests_jar" > |
115 | 129 | <java classname="com.jwetherell.algorithms.sorts.timing.SortsTiming"> |
116 | 130 | <classpath> |
117 | 131 | <path refid="test.class.path" /> |
118 | 132 | </classpath> |
119 | 133 | </java> |
120 | 134 | </target> |
121 | 135 |
|
122 | | - <target name="strings" depends="dist" > |
| 136 | + <target name="strings" depends="tests_jar" > |
123 | 137 | <java classname="com.jwetherell.algorithms.strings.timing.StringsTiming"> |
124 | 138 | <classpath> |
125 | 139 | <path refid="test.class.path" /> |
|
0 commit comments