File: build.xml

package info (click to toggle)
backport-util-concurrent 2.2%2Bdfsg-1
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k, lenny
  • size: 4,684 kB
  • ctags: 7,005
  • sloc: java: 51,261; xml: 405; makefile: 50; perl: 27
file content (352 lines) | stat: -rw-r--r-- 16,190 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
<?xml version="1.0" encoding="UTF-8"?>
<project name="backport-util-concurrent" default="dist">

    <!-- where to build the distribution -->
    <condition property="buc.dist.dir" value="${dist.dir}">
      <isset property="dist.dir"/>
    </condition>
    <property name="buc.dist.dir" location="backport-util-concurrent-dist"/>

    <!-- see the comments on the "test" target -->
    <property name="tck.shortDelay" value="300"/>

    <property name="build.compiler.emacs" value="true"/>

    <import file="build-jbexport.xml"/>

    <target name="dist" depends="jbuild,copy.dist,javadoc"/>

    <target name="copy.dist">
        <copy file="backport-util-concurrent.jar" todir="${buc.dist.dir}/"/>
        <copy file="license.html" todir="${buc.dist.dir}"/>
        <copy file="README.html" todir="${buc.dist.dir}"/>
        <copy file="LEGAL" todir="${buc.dist.dir}"/>
        <copy todir="${buc.dist.dir}/src">
            <fileset dir="src" includes="**/*" excludes="**/CVS"/>
        </copy>
    </target>

    <target name="jbuild" depends="jdeps,make"/>

    <target depends="init" name="javacompile">
      <javac classpathref="project.class.path" debug="true"
             deprecation="true" destdir="${dest}" nowarn="false"
             source="1.4" target="1.4">
        <src path="src"/>
        <src path="test/tck/src"/>
        <src path="test/loops/src"/>
        <src path="test/serialization"/>
      </javac>
    </target>

    <target name="jdeps">
      <dependset>
        <srcfileset dir="src" includes="**/*"/>
        <srcfileset dir="test/tck/src" includes="**/*"/>
        <srcfileset dir="test/loops/src" includes="**/*"/>
        <srcfileset dir="." includes="*.xml"/>
        <targetfileset dir="classes" includes="**/*"/>
        <targetfileset dir="doc/api" includes="**/*"/>
      </dependset>
    </target>

    <target name="javadoc" depends="javadoc.uptodateCheck" unless="javadoc.uptodate">
      <javadoc source="1.4"
               destdir="doc/api"
               protected="true"
               packagenames="edu.emory.mathcs.*"
               sourcepath="src">
        <tag description="To Do:" name="todo" scope="all"/>
      </javadoc>
      <copy todir="${buc.dist.dir}/doc">
          <fileset dir="doc" includes="**/*"/>
      </copy>
    </target>

    <target name="javadoc.uptodateCheck">
      <uptodate property="javadoc.uptodate" targetfile="doc/api/index.html">
        <srcfiles dir="src" includes="**/*"/>
      </uptodate>
    </target>

    <target name="clean.dist" depends="clean"
            description="Deletes distribution and all generated files">
      <delete dir="${buc.dist.dir}"/>
      <delete dir="doc/api"/>
    </target>

    <target name="rebuild.dist" depends="clean.dist,dist"
            description="Rebuilds the distribution from scratch">
    </target>


   <!-- tests -->

    <!--

    Please note that the TCK unit tests have been written in a way so that
    they depend on certain race conditions (e.g. that a given thread completes
    within a given time frame etc.). In other words, failing unit test does
    NOT immediately imply that there is a bug in the backport - it may simply
    be the effect of a missed race, e.g. resulting from the background load
    interferring with the tests.

    To balance robustness with time-to-completion, the "tck.shortDelay" property
    can be used. The bigger its value, the more reliable the test suite
    becomes, but the time to completion increases proportionally. For these
    tests to be representative, you need to make sure that no other CPU- or
    IO-bound programs are running, and use sufficiently large value of the
    "tck.shortDelay" property (default is 300ms). Good value to start with is
    50ms, although it may be insufficient on machines below 1 GHz. On fast
    computers (3 GHz) you can get away with values of 10ms. However, if you
    observe failures, increase this value. Please report errors ONLY if the
    failures occur consistently (with constant probability) regardless of the
    value of the "tck.shortDelay" property, and with no background load.

     -->

    <target name="test" depends="jdeps,make"
            description="runs TCK unit tests on the backport">

        <java classname="JSR166TestCase">
            <classpath>
                <pathelement location="backport-util-concurrent-test.jar"/>
                <pathelement location="external/junit.jar"/>
            </classpath>
            <sysproperty key="tck.shortDelay" value="${tck.shortDelay}"/>
        </java>

<!--        <junit printsummary="true" showoutput="true">
            <classpath>
                <pathelement location="external/junit.jar"/>
                <pathelement location="classes/"/>
            </classpath>

            <test name="JSR166TestCase" haltonfailure="no" fork="true"/>
        </junit>
-->
    </target>

    <target name="test.loops"
            depends="test.loops.locks, test.loops.producer-consumer, test.loops.executors,
                     test.loops.concurrentQueues, test.loops.deques, test.loops.other1,
                     test.loops.mapChecks, test.loops.setChecks, test.loops.mapLoops,
                     test.loops.stringMapLoops, test.loops.mapWordLoops,
                     test.loops.collectionLoops, test.loops.collectionWordLoops,
                     test.loops.lists, test.loops.other2, test.loops.rljbars,
                     test.loops.unboundedQueueFill,test.loops.iterators"/>


    <target name="test.loops.init" depends="init,jdeps,make">
        <property name="max.trials" value="8"/>
    </target>

    <target name="test.loops.locks" depends="test.loops.init">
        <runloop class="CASLoops" args="4"/>
        <runloop.maxtrials class="SimpleReentrantLockLoops"/>
        <runloop.maxtrials class="SimpleSemaphoreLoops"/>
        <runloop.maxtrials class="SimpleLockLoops"/>
        <runloop.maxtrials class="SimpleWriteLockLoops"/>
        <runloop.maxtrials class="SimpleTimedLockLoops"/>
        <runloop.maxtrials class="SimpleSpinLockLoops"/>
        <runloop.maxtrials class="TimeoutLockLoops"/>
        <runloop.maxtrials class="CheckedLockLoops"/>
        <runloop.maxtrials class="UncheckedLockLoops"/>
        <runloop.maxtrials class="CancelledLockLoops"/>
        <runloop.maxtrials class="LockOncePerThreadLoops"/>
    </target>

    <target name="test.loops.producer-consumer" depends="test.loops.init">
        <runloop.maxtrials class="ProducerConsumerLoops"/>
        <runloop.maxtrials class="MultipleProducersSingleConsumerLoops"/>
        <runloop.maxtrials class="SingleProducerMultipleConsumerLoops"/>
        <runloop.maxtrials class="CancelledProducerConsumerLoops"/>
        <runloop.maxtrials class="TimeoutProducerConsumerLoops"/>
    </target>

    <target name="test.loops.executors" depends="test.loops.init">
        <runloop.maxtrials class="ExecutorCompletionServiceLoops"/>
        <runloop.maxtrials class="CachedThreadPoolLoops"/>
    </target>

    <target name="test.loops.concurrentQueues" depends="test.loops.init">
        <runloop class="ConcurrentQueueLoops"
                 args="edu.emory.mathcs.backport.java.util.concurrent.ConcurrentLinkedQueue ${max.trials}"/>
        <runloop class="ConcurrentQueueLoops"
                 args="SynchronizedLinkedListQueue ${max.trials}"/>
        <runloop class="ConcurrentDequeLoops"
                 args="edu.emory.mathcs.backport.java.util.concurrent.LinkedBlockingDeque ${max.trials}"/>
    </target>

    <target name="test.loops.deques" depends="test.loops.init">
        <runloop class="DequeBash"
                 args="edu.emory.mathcs.backport.java.util.ArrayDeque ${max.trials}"/>
        <runloop class="DequeBash"
                 args="edu.emory.mathcs.backport.java.util.LinkedList ${max.trials}"/>
        <runloop class="DequeBash"
                 args="edu.emory.mathcs.backport.java.util.concurrent.LinkedBlockingDeque ${max.trials}"/>
    </target>

    <target name="test.loops.other1" depends="test.loops.init">
        <runloop.maxtrials class="ExchangeLoops"/>
        <runloop.maxtrials class="TimeoutExchangerLoops"/>
        <runloop.maxtrials class="TSPExchangerTest"/>
        <runloop.maxtrials class="CancelledFutureLoops"/>
    </target>

    <target name="test.loops.mapChecks" depends="test.loops.init">
        <runloop class="MapCheck"
                 args="edu.emory.mathcs.backport.java.util.concurrent.ConcurrentHashMap ${max.trials}"/>
        <runloop class="IntMapCheck"
                 args="edu.emory.mathcs.backport.java.util.concurrent.ConcurrentHashMap ${max.trials}"/>
        <runloop class="IntMapCheck"
                 args="edu.emory.mathcs.backport.java.util.concurrent.ConcurrentSkipListMap ${max.trials}"/>
        <runloop class="NavigableMapCheck" args="edu.emory.mathcs.backport.java.util.TreeMap ${max.trials}"/>
        <runloop class="NavigableMapCheck"
                 args="edu.emory.mathcs.backport.java.util.concurrent.ConcurrentSkipListMap ${max.trials}"/>
    </target>

    <target name="test.loops.setChecks" depends="test.loops.init">
        <runloop class="NavigableSetCheck"
                 args="edu.emory.mathcs.backport.java.util.TreeSet ${max.trials}"/>
        <runloop class="SetBash"
                 args="edu.emory.mathcs.backport.java.util.concurrent.ConcurrentSkipListSet ${max.trials} 100"/>
        <runloop class="SetBash"
                 args="edu.emory.mathcs.backport.java.util.concurrent.ConcurrentHashSet ${max.trials} 100"/>
        <runloop class="NavigableSetCheck"
                 args="edu.emory.mathcs.backport.java.util.concurrent.ConcurrentSkipListSet ${max.trials}"/>
    </target>

    <target name="test.loops.mapLoops" depends="test.loops.init">
        <runloop class="MapLoops"
                 args="edu.emory.mathcs.backport.java.util.concurrent.ConcurrentHashMap ${max.trials}"/>
        <runloop class="MapLoops"
                  args="edu.emory.mathcs.backport.java.util.concurrent.ConcurrentSkipListMap ${max.trials}"/>
        <runloop class="MapLoops" args="RWMap ${max.trials}"/>
    </target>

    <target name="test.loops.stringMapLoops" depends="test.loops.init">
        <runloop class="StringMapLoops"
                 args="edu.emory.mathcs.backport.java.util.concurrent.ConcurrentHashMap ${max.trials}"/>
        <runloop class="StringMapLoops"
                  args="edu.emory.mathcs.backport.java.util.concurrent.ConcurrentSkipListMap ${max.trials}"/>
        <runloop class="StringMapLoops" args="RWMap ${max.trials}"/>
    </target>

    <target name="test.loops.mapWordLoops" depends="test.loops.init">
        <runloop class="MapWordLoops"
                 args="edu.emory.mathcs.backport.java.util.concurrent.ConcurrentHashMap ${max.trials}"/>
        <runloop class="MapWordLoops"
                 args="edu.emory.mathcs.backport.java.util.TreeMap ${max.trials}"/>
        <runloop class="MapWordLoops" args="RWMap ${max.trials}"/>
        <runloop class="MapWordLoops"
                 args="edu.emory.mathcs.backport.java.util.concurrent.ConcurrentSkipListMap ${max.trials}"/>
    </target>

    <target name="test.loops.collectionLoops" depends="test.loops.init">
        <runloop class="CollectionLoops"
                 args="RWCollection"/>
        <runloop class="CollectionLoops"
                 args="SCollection"/>
        <runloop class="CollectionLoops"
                 args="SynchronizedCollection"/>
    </target>

    <target name="test.loops.collectionWordLoops" depends="test.loops.init">
        <runloop class="CollectionWordLoops"
                 args="edu.emory.mathcs.backport.java.util.concurrent.ConcurrentSkipListSet"/>
        <runloop class="CollectionWordLoops"
                 args="edu.emory.mathcs.backport.java.util.concurrent.ConcurrentLinkedQueue"/>
        <runloop class="CollectionWordLoops"
                 args="edu.emory.mathcs.backport.java.util.concurrent.CopyOnWriteArrayList"/>
        <runloop class="CollectionWordLoops"
                 args="edu.emory.mathcs.backport.java.util.ArrayDeque"/>
    </target>

    <target name="test.loops.lists" depends="test.loops.init">
        <runloop class="ListBash"
                 args="edu.emory.mathcs.backport.java.util.concurrent.CopyOnWriteArrayList 100 100"/>
        <runloop class="ListBash"
                 args="edu.emory.mathcs.backport.java.util.LinkedList 100 100"/>
    </target>

    <target name="test.loops.other2" depends="test.loops.init">
        <runloop class="TimeUnitLoops"/>
        <runloop class="ReadHoldingWriteLock"/>
        <runloop class="Finals"/>
        <runloop class="FinalLongTest"/>
    </target>

    <target name="test.loops.rljbars" depends="test.loops.init">
        <runloop class="RLJBar"/>
        <runloop class="RLJBar" args="-b"/>
        <runloop class="RLIBar" args="-np ${max.trials}"/>
        <runloop class="RLIBar" args="-batch 10 -np ${max.trials}"/>
    </target>

    <target name="test.loops.unboundedQueueFill" depends="test.loops.init">
        <runloop class="UnboundedQueueFillEmptyLoops"
                 args="edu.emory.mathcs.backport.java.util.ArrayDeque"/>
        <runloop class="UnboundedQueueFillEmptyLoops"
                 args="edu.emory.mathcs.backport.java.util.PriorityQueue"/>
        <runloop class="UnboundedQueueFillEmptyLoops"
                 args="edu.emory.mathcs.backport.java.util.concurrent.PriorityBlockingQueue"/>
        <runloop class="UnboundedQueueFillEmptyLoops"
                 args="edu.emory.mathcs.backport.java.util.LinkedList"/>
        <runloop class="UnboundedQueueFillEmptyLoops"
                 args="edu.emory.mathcs.backport.java.util.concurrent.ConcurrentLinkedQueue"/>
        <runloop class="UnboundedQueueFillEmptyLoops"
                 args="edu.emory.mathcs.backport.java.util.concurrent.LinkedBlockingQueue"/>
        <runloop class="UnboundedQueueFillEmptyLoops"
                 args="edu.emory.mathcs.backport.java.util.concurrent.LinkedBlockingDeque"/>
    </target>

    <target name="test.loops.iterators" depends="test.loops.init">
        <runloop class="IteratorLoops"
                 args="java.util.ArrayList"/>
        <runloop class="IteratorLoops"
                 args="java.util.Vector"/>
        <runloop class="IteratorLoops"
                 args="edu.emory.mathcs.backport.java.util.concurrent.CopyOnWriteArrayList"/>
        <runloop class="IteratorLoops"
                 args="edu.emory.mathcs.backport.java.util.LinkedList"/>
        <runloop class="IteratorLoops"
                 args="edu.emory.mathcs.backport.java.util.concurrent.ConcurrentLinkedQueue"/>
        <runloop class="IteratorLoops"
                 args="edu.emory.mathcs.backport.java.util.concurrent.LinkedBlockingQueue"/>
        <runloop class="IteratorLoops"
                 args="edu.emory.mathcs.backport.java.util.ArrayDeque"/>
        <runloop class="IteratorLoops"
                 args="edu.emory.mathcs.backport.java.util.concurrent.LinkedBlockingDeque"/>
        <runloop class="IteratorLoops"
                 args="edu.emory.mathcs.backport.java.util.PriorityQueue"/>
        <runloop class="IteratorLoops"
                 args="edu.emory.mathcs.backport.java.util.concurrent.PriorityBlockingQueue"/>
        <runloop class="IteratorLoops"
                 args="edu.emory.mathcs.backport.java.util.TreeSet"/>
        <runloop class="IteratorLoops"
                 args="edu.emory.mathcs.backport.java.util.concurrent.ConcurrentSkipListSet"/>
        <runloop class="IteratorLoops"
                 args="java.util.HashSet"/>
        <runloop class="IteratorLoops"
                 args="ConcurrentHashSet"/>
    </target>


    <macrodef name="runloop">
      <attribute name="class"/>
      <attribute name="args" default=""/>
      <sequential>
        <echo message="@{class} @{args}"/>
        <java classpath="backport-util-concurrent-test.jar"
              classname="@{class}" fork="true" dir="test/loops/words">
          <arg line="@{args}"/>
        </java>
      </sequential>
    </macrodef>

    <presetdef name="runloop.maxtrials">
      <runloop args="${max.trials}"/>
    </presetdef>

</project>