source: tags/0.18.1/abcl/build.xml

Last change on this file was 12338, checked in by Mark Evenson, 14 years ago

Reworked test infrastructure.

Use ASDF to invoke all tests from Ant.

Add working test for Ant version at least 1.7.1.

Changed structure of 'build.xml' slightly to emphasize 'help' target
by placing it first.

Include cl-bench tests in 'abcl.test.lisp' Ant target.

Added 'help.test' target for help invoking tests.

abcl.asd now works for invoking tests. ASDF systems with empty
component specifications must be invoked with the :force t option to
execute correctly.

  • Property svn:eol-style set to LF
File size: 25.7 KB
Line 
1<?xml version="1.0" encoding="UTF-8"?>
2<project xmlns="antlib:org.apache.tools.ant"
3   name="abcl-master" default="abcl.wrapper" basedir=".">
4    <description>Compiling, testing, and packaging Armed Bear Common Lisp</description>
5
6    <target name="abcl" depends="abcl.wrapper"/>
7 
8    <target name="help">
9      <echo>
10Main Ant targets:
11
12 abcl.wrapper
13   -- [default] create executable wrapper for ABCL.
14 abcl.compile 
15   -- compile ABCL to ${build.classes.dir}.
16 abcl.jar     
17   -- create packaged ${abcl.jar.path}.
18 abcl.source.zip abcl.source.tar
19   -- create source distributions in ${dist.dir}.
20 abcl.clean
21   -- remove ABCL intermediate files
22      </echo>
23
24      <echo>
25For help on the automatic tests available, use the Ant target 'help.test'.
26      </echo>
27    </target>
28
29    <!-- Behavior of the build system can be customized via setting
30         properties in the 'build.properties' file. -->
31    <property file="build.properties"/>
32
33    <property name="build.dir" 
34        value="${basedir}/build"/>
35    <property name="build.classes.dir" 
36        value="${build.dir}/classes"/>
37    <property name="src.dir" 
38        value="${basedir}/src"/>
39    <property name="dist.dir" 
40        value="${basedir}/dist"/>
41    <property name="abcl.jar.path"
42        value="${dist.dir}/abcl.jar"/>
43    <property name="abcl.ext.dir"
44        value="${basedir}/ext"/>
45
46    <fail message="Please build using Ant 1.7.1 or higher.">
47        <condition>
48            <not>
49                <antversion atleast="1.7.1"/>
50            </not>
51        </condition>
52    </fail>
53
54    <!-- Checks if JSR-223 support is available - thanks to Mark Evenson -->
55    <available property="abcl.jsr-223.p"
56         classname="javax.script.ScriptEngine"/>
57
58    <patternset id="abcl.source.java">
59      <include name="org/armedbear/lisp/*.java"/>
60      <include name="org/armedbear/lisp/util/*.java"/>
61      <include name="org/armedbear/lisp/java/**/*.java"/>
62      <include name="org/armedbear/lisp/scripting/*.java" if="abcl.jsr-223.p"/>
63      <include name="org/armedbear/lisp/scripting/util/*.java" if="abcl.jsr-223.p"/>
64      <include name="org/armedbear/Main.java"/>
65    </patternset>
66
67    <patternset id="abcl.source.lisp">
68      <include name="org/armedbear/lisp/*.lisp"/>
69      <include name="org/armedbear/lisp/java/**/*.lisp"/>
70      <include name="org/armedbear/lisp/tests/*.lisp"/>
71      <exclude name="org/armedbear/lisp/j.lisp"/>
72      <include name="org/armedbear/lisp/scripting/lisp/*.lisp" if="abcl.jsr-223.p"/>
73    </patternset>
74
75    <!-- Lisp files required at runtime -->
76    <patternset id="abcl.source.lisp.dist">
77      <include name="org/armedbear/lisp/boot.lisp"/>
78      <include name="org/armedbear/lisp/scripting/lisp/*.lisp" if="abcl.jsr-223.p"/>
79    </patternset>
80
81    <patternset id="abcl.objects">
82      <include name="org/armedbear/lisp/**/*.class"/>
83      <include name="org/armedbear/lisp/**/*.cls"/> 
84      <include name="org/armedbear/lisp/**/*.abcl"/>
85      <include name="org/armedbear/lisp/scripting/*.class" if="abcl.jsr-223.p"/>
86      <include name="org/armedbear/lisp/scripting/util/*.class" if="abcl.jsr-223.p"/>
87      <patternset refid="abcl.source.lisp.dist"/>
88    </patternset>
89   
90    <path id="abcl.classpath.dist">
91      <pathelement location="${abcl.jar.path}"/>
92    </path>
93   
94    <path id="abcl.classpath.build">
95      <pathelement location="${build.classes.dir}"/>
96    </path>
97
98    <target name="abcl.compile" depends="abcl.clean.maybe,abcl.compile.lisp">
99      <echo>Compiled ABCL with Java version: ${java.version}</echo>
100    </target>
101   
102    <target name="abcl.clean.maybe" unless="abcl.build.incremental">
103      <echo>Cleaning all intermediate compilation artifacts.</echo>
104      <echo>Setting 'abcl.build.incremental' enables incremental compilation.</echo>
105      <antcall target="abcl.clean"/>
106    </target>
107     
108
109    <target name="abcl.init">
110      <tstamp>
111  <format property="build" pattern="EEE MMM dd yyyy HH:mm:ss zzz"/>
112      </tstamp>
113
114      <tstamp>
115  <format property="build.stamp" pattern="yyyymmdd-HHmm"/>
116      </tstamp>
117
118      <property name="abcl.test.log.file"
119    value="abcl-test-${build.stamp}.log"/>
120
121      <property name="java.path"
122    value="${java.home}/bin/java"/>
123
124      <!-- Deprecated. Two main types of build environents: 'unix' or 'windows'. -->
125      <condition property="unix"> 
126  <or>
127    <os family="unix"/>
128    <os family="mac"/>
129  </or>
130      </condition>
131      <condition property="windows"> 
132  <os family="windows"/>
133      </condition>
134
135      <!-- Deprecated. -->
136      <available file="${src.dir}org/armedbear/lisp/Interpreter.java" 
137     property="abcl.lisp.p"/>
138
139      <echo>java.version: ${java.version}</echo>
140      <condition property="abcl.java.version.p">
141  <or>
142    <matches string="${java.version}" pattern="1\.5"/>
143    <matches string="${java.version}" pattern="1\.6\.0_1[0-9]"/>
144  </or> 
145      </condition>
146
147      <!-- Set from commandline via -D or in 'build.properties' -->
148      <property name="build.version" value="abcl.svn"/>
149      <echo>Implementation-Source: ${version.src}</echo>
150
151    </target>
152   
153    <target name="abcl.java.warning" 
154      depends="abcl.init"
155      unless="abcl.java.version.p">
156      <echo>WARNING: Use of Java version ${java.version} not recommended.</echo>
157    </target>
158 
159    <target name="abcl.jsr-223.notice"
160      depends="abcl.init"
161      unless="abcl.jsr-223.p">
162      <echo>
163  Notice: JSR-223 support won't be built since it is not
164          supported, neither natively by your JVM nor by
165    libraries in the CLASSPATH.
166      </echo>
167    </target>
168
169    <target name="abcl.compile.java" 
170      depends="abcl.init,abcl.java.warning,abcl.jsr-223.notice">
171      <mkdir dir="${build.dir}"/>
172      <mkdir dir="${build.classes.dir}"/>
173      <javac destdir="${build.classes.dir}"
174       debug="true"
175       target="1.5"
176       failonerror="true">
177  <src path="${src.dir}"/>
178  <patternset refid="abcl.source.java"/>
179      </javac>
180      <echo message="${build}" 
181      file="${build.classes.dir}/org/armedbear/lisp/build"/>
182    </target>
183
184    <target name="abcl.copy.lisp">
185      <copy todir="${build.classes.dir}" preservelastmodified="yes">
186  <fileset dir="${src.dir}">
187          <patternset refid="abcl.source.lisp.dist"/>
188  </fileset>
189      </copy>
190    </target>
191
192    <!-- Adjust the patternset for ABCL source to use the much faster
193         Ant 'uptodate' task to check if we need to compile the system
194         fasls.  Highly inter-dependent with the behavior specified in
195         'compile-system.lisp', i.e. files not listed in
196         there should NOT occur here. -->
197    <patternset id="abcl.source.lisp.fasls">
198      <patternset refid="abcl.source.lisp"/>
199      <exclude name="org/armedbear/lisp/scripting/**/*.lisp"/>
200      <exclude name="org/armedbear/lisp/boot.lisp"/>
201      <exclude name="org/armedbear/lisp/emacs.lisp"/>
202      <exclude name="org/armedbear/lisp/runtime-class.lisp"/>
203      <exclude name="org/armedbear/lisp/run-benchmarks.lisp"/>
204    </patternset>
205
206    <target name="abcl.fasls.uptodate">
207      <uptodate property="abcl.fasls.uptodate.p" value="true">
208  <srcfiles dir="${src.dir}">
209    <patternset refid="abcl.source.lisp.fasls"/>
210  </srcfiles>
211  <mapper type="glob" from="*.lisp" to="${build.classes.dir}/*.abcl"/>
212      </uptodate>
213    </target>
214
215    <path id="abcl.home.dir.path">
216        <path location="${src.dir}/org/armedbear/lisp/"/>
217    </path>         
218    <pathconvert property="abcl.home.dir" refid="abcl.home.dir.path"/>
219
220    <path id="abcl.lisp.output.path"
221          location="${build.classes.dir}/org/armedbear/lisp/"/>
222   
223    <target name="abcl.compile.lisp" 
224      depends="abcl.copy.lisp,abcl.compile.java,abcl.fasls.uptodate"
225      unless="abcl.fasls.uptodate.p">
226
227      <!-- The following shenanigans are necessary to get something
228           that ABCL under Windows can parse as a pathname with the
229           drive syntax not being interpreted as a Lisp package
230           namespace, and with backslash characters not starting
231           escape sequences.  -->
232      <tempfile property="abcl.compile.lisp.tmp" suffix=".lisp"/>
233
234      <echo file="${abcl.compile.lisp.tmp}">
235      (compile-system :zip nil :quit t
236          :output-path "${toString:abcl.lisp.output.path}${file.separator}")
237      </echo>
238
239      <tempfile property="abcl.compile.lisp.tmp.2"  suffix=".lisp"/>
240     
241      <copy file="${abcl.compile.lisp.tmp}"
242            tofile="${abcl.compile.lisp.tmp.2}">
243   <filterchain>
244      <replacestring from="\" to="/"/>
245   </filterchain>
246      </copy>
247
248      <java classpath="${build.classes.dir}"
249      fork="true"
250      failonerror="true"
251      classname="org.armedbear.lisp.Main">
252        <jvmarg value="-Dabcl.home=${abcl.home.dir}${file.separator}"/>
253  <arg value="--noinit"/>
254  <arg value="--load"/>
255  <arg value="${abcl.compile.lisp.tmp.2}"/>
256      </java>
257            <delete file="${abcl.compile.lisp.tmp}"/> 
258      <delete file="${abcl.compile.lisp.tmp.2}"/> 
259    </target>
260
261    <property name="abcl.build.path"
262        value="${build.classes.dir}/org/armedbear/lisp/build"/>
263    <target name="abcl.stamp" depends="abcl.compile,abcl.stamp.version,abcl.stamp.hostname">
264      <mkdir dir="${abcl.build.path}/.."/>
265      <echo message="${build}" file="${abcl.build.path}"/>   
266    </target>
267
268    <property name="abcl.home.dir"
269              value="${src.dir}/org/armedbear/lisp/"/>
270    <property name="abcl.version.path"
271        value="${build.classes.dir}/org/armedbear/lisp/version"/>
272    <target name="abcl.stamp.version" depends="abcl.compile">
273      <!-- Determine which ABCL version we have just built by parsing
274           the output of LISP-IMPLEMENTATION-VERSION. -->
275      <!-- TODO As an optimization, we could possibly compare the timestamp
276      of 'abcl.version.path' vs. org.armedbear.lisp.Version -->
277      <java fork="true"
278      classpath="${build.classes.dir}"
279      outputproperty="abcl.version"
280      classname="org.armedbear.lisp.Main"
281            logerror="yes"> <!-- Don't catch stderr output -->
282        <jvmarg value="-Dabcl.home=${abcl.home.dir}"/>
283  <arg value="--noinit"/>
284  <arg value="--noinform"/>
285  <arg value="--eval"/>
286  <arg value="(progn (format t (lisp-implementation-version)) (finish-output) (quit))"/>
287      </java>
288
289      <echo>Built ABCL version: ${abcl.version}</echo>
290      <mkdir dir="${abcl.version.path}/.."/>
291      <echo message="${abcl.version}" file="${abcl.version.path}"/> 
292    </target>
293
294    <target name="abcl.stamp.hostname" if="unix">
295      <exec executable="hostname" outputproperty="abcl.hostname"/>
296      <echo>abcl.hostname: ${abcl.hostname}</echo>
297    </target>
298
299    <target name="abcl.jar.uptodate" depends="abcl.compile">
300      <uptodate property="abcl.jar.uptodate.p" targetfile="${abcl.jar.path}">
301        <srcfiles dir="${build.classes.dir}">
302          <patternset refid="abcl.objects"/>
303        </srcfiles>
304      </uptodate>
305    </target>
306
307    <target name="abcl.jar" depends="abcl.stamp,abcl.jar.uptodate"
308      unless="abcl.jar.uptodate.p">
309      <mkdir dir="${dist.dir}"/>
310      <loadfile property="abcl.version"
311      srcFile="${abcl.version.path}"/>
312      <jar destfile="${abcl.jar.path}"
313     compress="true"
314     basedir="${build.classes.dir}">
315  <patternset refid="abcl.objects"/>
316  <manifest>
317    <attribute name="Main-Class" value="org.armedbear.lisp.Main"/>
318    <section name="org/armedbear/lisp">
319      <attribute name="Implementation-Title" 
320           value="ABCL"/>
321      <attribute name="Implementation-Version" 
322           value="${abcl.version}"/>
323      <attribute name="Implementation-Build" 
324           value="${build}"/>
325      <attribute name="Implementation-Source" 
326           value="${version.src}"/>
327    </section>
328  </manifest>
329  <metainf dir="${src.dir}/META-INF"> 
330    <exclude name="services/javax.script.ScriptEngineFactory"
331       unless="abcl.jsr-223.p"/>
332        </metainf>
333      </jar>
334    </target>
335   
336    <target name="abcl.wrapper" 
337      depends="abcl.jar,abcl.wrapper.unix,abcl.wrapper.windows">
338      <description>
339  Creates in-place exectuable shell wrapper in '${abcl.wrapper.file}'
340      </description>
341      <!-- Set from commandline or in 'build.properties' -->
342      <property name="additional.jars" value=""/>
343      <path id="abcl.runtime.classpath">
344  <pathelement location="${abcl.jar.path}"/>
345  <pathelement path="${additional.jars}"/>
346      </path>
347      <!-- set via '-Djava.options=JAVA_OPTIONS' or in 'build.properties -->
348      <property name="java.options" value=""/>
349
350      <copy file="${abcl.wrapper.in.file}" toFile="${abcl.wrapper.file}" overwrite="yes">
351  <filterset>
352    <filter token="JAVA" 
353      value="${java.path}"/>
354    <filter token="ABCL_JAVA_OPTIONS" 
355      value="${java.options}"/>
356    <filter token="ABCL_CLASSPATH"
357      value="${toString:abcl.runtime.classpath}"/>
358  </filterset>
359      </copy>
360      <chmod file="${abcl.wrapper.file}" perm="a+x"/>
361
362      <echo>Created executable ABCL wrapper in '${abcl.wrapper.file}'</echo>
363      <echo>N.B. This wrapper requires '${abcl.jar.path}' not be moved.</echo>
364    </target>
365
366    <target name="abcl.wrapper.unix" if="unix">
367      <property name="abcl.wrapper.file" value="abcl"/>
368      <property name="abcl.wrapper.in.file" value="abcl.in"/>
369    </target>
370
371    <target name="abcl.wrapper.windows" if="windows">
372      <property name="abcl.wrapper.file" value="abcl.bat"/>
373      <property name="abcl.wrapper.in.file" value="abcl.bat.in"/>
374    </target>
375
376    <target name="abcl.debug.jpda" depends="abcl.jar">
377      <description>Invoke ABCL with JPDA listener on port 6789</description>
378      <java fork="true"
379      classpathref="abcl.classpath.dist"
380      classname="org.armedbear.lisp.Main">
381  <jvmarg 
382      value="-agentlib:jdwp=transport=dt_socket,address=6789,server=y"/>
383      </java>
384      <echo>JPDA listening on localhost:6789</echo>
385    </target>
386
387    <target name="abcl.run" depends="abcl.jar">
388      <java fork="true"
389      classpathref="abcl.classpath.dist"
390      classname="org.armedbear.lisp.Main">
391      </java>
392    </target>
393
394    <target name="abcl.clean">
395      <delete dir="${build.dir}"/>
396      <delete file="${abcl.jar.path}"/>
397      <delete file="abcl"/>
398      <delete file="abcl.bat"/>
399    </target>
400
401    <target name="abcl.dist" depends="abcl.jar">
402      <copy file="${abcl.jar.path}"
403      toFile="${dist.dir}/abcl-${abcl.version}.jar"/>
404    </target>
405
406    <target name="abcl.distclean" depends="abcl.clean">
407      <delete dir="${dist.dir}"/>
408      <delete file="abcl"/>
409      <delete file="abcl.bat"/>
410    </target>
411
412    <target name="TAGS">
413      <apply executable="etags" parallel="true" verbose="true">
414  <arg value="--regex=|[ \t]+//[ \t]+###[ \t]+\([^ \t]+\)|\1|"/>
415  <fileset dir="${src.dir}">
416    <patternset refid="abcl.source.java"/>
417    <patternset refid="abcl.source.lisp"/>
418  </fileset>
419      </apply>
420    </target>
421
422    <patternset id="abcl.dist.misc"
423    description="Additional includes in the source distributions relative to basedir">
424      <include name="build.xml"/>
425      <include name="build.properties.in"/>
426      <include name="COPYING"/>
427      <include name="README"/>
428      <include name="CHANGES"/>
429      <include name="abcl.in"/>
430      <include name="abcl.bat.in"/>
431     
432      <!-- The remainder of these files are used by the Lisp hosted
433           build in 'build-abcl.lisp' but not used by Ant, so include
434           them in the source distribution. -->
435      <include name="make-jar.in"/>
436      <include name="make-jar.bat.in"/>
437
438      <include name="build-abcl.lisp"/>
439      <include name="customizations.lisp.in"/>
440
441    </patternset>
442
443    <patternset 
444        id="abcl.source.misc"
445        description="Additional includes in the source distribution relative to source root">
446      <include name="org/armedbear/lisp/LICENSE"/>
447      <include name="manifest-abcl"/>
448      <include name="META-INF/services/javax.script.ScriptEngineFactory"/>
449    </patternset>
450
451    <target name="abcl.source.prepare" depends="abcl.stamp.version">
452      <property name="abcl.build.src.dir"
453    value="${build.dir}/abcl-src-${abcl.version}"/>
454      <mkdir dir="${abcl.build.src.dir}/src"/>
455      <copy todir="${abcl.build.src.dir}/src"
456            preservelastmodified="true">
457        <fileset dir="${src.dir}"
458                 id="abcl.source.src">
459            <patternset refid="abcl.source.java"/>
460            <patternset refid="abcl.source.lisp"/>
461            <patternset refid="abcl.source.misc"/>
462        </fileset>
463      </copy>
464      <copy todir="${abcl.build.src.dir}"
465            preservelastmodified="true">
466        <fileset dir="${basedir}">
467            <patternset refid="abcl.dist.misc"/>
468        </fileset>
469      </copy>
470    </target>
471
472    <!--  Files in source distribution that always get LF EOL (aka
473         'unix') -->   
474    <patternset id="abcl.dist.lf">
475      <include name="abcl.in"/>
476    </patternset>
477
478    <!--  Files in source distribution that always get CRLF EOL (aka
479         'dos') -->   
480    <patternset id="abcl.dist.crlf">
481      <include name="abcl.bat.in"/>
482    </patternset>
483
484    <target name="abcl.source.tar" depends="abcl.source.prepare">
485      <fixcrlf srcdir="${abcl.build.src.dir}"
486               preservelastmodified="true"
487               eol="lf">
488      </fixcrlf>
489
490      <fixcrlf srcdir="${abcl.build.src.dir}"
491               preservelastmodified="true"
492               eol="crlf">
493          <patternset refid="abcl.dist.crlf"/>
494      </fixcrlf>
495
496      <fixcrlf srcdir="${abcl.build.src.dir}"
497               preservelastmodified="true"
498               eol="lf">
499          <patternset refid="abcl.dist.lf"/>
500      </fixcrlf>
501
502      <mkdir dir="${dist.dir}"/>
503      <tar destfile="${dist.dir}/abcl-src-${abcl.version}.tar.gz"
504     compression="gzip">
505  <tarfileset dir="${build.dir}">
506    <include name="abcl-src-${abcl.version}/**"/>
507  </tarfileset>
508      </tar>
509    </target>
510
511    <target name="abcl.source.zip" depends="abcl.source.prepare">
512      <fixcrlf srcdir="${abcl.build.src.dir}"
513               preservelastmodified="true"
514               eol="crlf">
515      </fixcrlf>
516
517      <fixcrlf srcdir="${abcl.build.src.dir}"
518               preservelastmodified="true"
519               eol="crlf">
520          <patternset refid="abcl.dist.crlf"/>
521      </fixcrlf>
522
523      <fixcrlf srcdir="${abcl.build.src.dir}"
524               preservelastmodified="true"
525               eol="lf">
526          <patternset refid="abcl.dist.lf"/>
527      </fixcrlf>
528
529      <mkdir dir="${dist.dir}"/>
530      <zip destfile="${dist.dir}/abcl-src-${abcl.version}.zip"
531     compress="true">
532  <zipfileset dir="${abcl.build.src.dir}" prefix="abcl-src-${abcl.version}"/>
533      </zip>
534    </target>
535   
536    <target name="abcl.binary.prepare" depends="abcl.jar,abcl.stamp.version">
537      <property name="abcl.build.binary.dir"
538                value="${build.dir}/abcl-bin-${abcl.version}"/>
539      <mkdir dir="${abcl.build.binary.dir}"/>
540      <copy todir="${abcl.build.binary.dir}"
541            preservelastmodified="true">
542        <fileset dir="${basedir}/dist">
543          <patternset>
544            <include name="abcl.jar"/>
545          </patternset>
546        </fileset>
547        <fileset dir="${basedir}">
548          <patternset>
549            <include name="README"/>
550            <include name="CHANGES"/>
551          </patternset>
552        </fileset>
553      </copy>
554    </target>
555
556    <target name="abcl.binary.tar" depends="abcl.binary.prepare">
557      <tar destfile="${dist.dir}/abcl-bin-${abcl.version}.tar.gz"
558           compression="gzip">
559        <tarfileset dir="${build.dir}">
560          <include name="abcl-bin-${abcl.version}/**"/>
561          </tarfileset>
562      </tar>
563    </target>
564
565    <target name="abcl.binary.zip" depends="abcl.binary.prepare">
566      <zip destfile="${dist.dir}/abcl-bin-${abcl.version}.zip"
567           compress="true">
568        <zipfileset dir="${abcl.build.binary.dir}" prefix="abcl-bin-${abcl.version}"/>
569      </zip>
570    </target>
571
572    <target name="help.test">
573      <echo>
574The following Ant targets run various test suites:
575 
576  abcl.test
577    --  Run all available tests.
578  abcl.test.java
579    --  Run the ABCL junit Java tests under ${basedir}/test/src
580  abcl.test.lisp
581    --  Run the 'test.ansi.compiled', 'test.abcl', 'test.cl-bench' targets
582  test.ansi.compiled
583    --  Run the compiled version of the ANSI test suite
584  test.abcl
585    --  Run the Lisp RT tests collected in ${basedir}/test/lisp/abcl
586  test.cl-bench
587    --  Run the cl-bench test suite.
588
589The ANSI tests require that the [ansi-tests][1] be manually installed in
590${basedir}/../ansi-tests.
591
592[1]: svn://common-lisp.net/project/ansi-test/svn/trunk/ansi-tests
593
594The CL-BENCH test require that [cl-bench][2] be maunally installed in
595${basedir}/../cl-bench
596
597[2]: http://www.chez.com/emarsden/downloads/cl-bench.tar.gz
598      </echo>
599    </target>
600
601    <property name="abcl.test.classes.dir"
602        value="${build.dir}/classes-test"/>
603
604    <property name="abcl.test.src.dir"
605        value="${basedir}/test/src"/>
606
607    <patternset id="abcl.test.source.java">
608      <!-- For now, we list tests explicitly, because we have to
609           enumerate them later to the JUnit test runner. -->
610      <include name="org/armedbear/lisp/FastStringBufferTest.java"/>
611    </patternset>
612
613    <property name="junit-4.5.path"
614        value="${abcl.ext.dir}/junit-4.5.jar"/>
615
616    <path id="abcl.test.compile.classpath">
617      <pathelement location="${junit-4.5.path}"/>
618      <pathelement location="${build.classes.dir}"/>
619    </path>
620
621    <target name="abcl.test.pre-compile" depends="abcl.ext"/>
622
623    <target name="abcl.ext.p">
624      <!--XXX generalize over enumeration of all contributions to
625           abcl.ext if we get more of them.  -->
626      <available file="${junit-4.5.path}" property="abcl.ext.p"/>
627    </target>
628    <target name="abcl.ext" depends="abcl.ext.p" unless="abcl.ext.p">
629
630      <mkdir dir="${abcl.ext.dir}"/>
631      <get src="http://downloads.sourceforge.net/junit/junit-4.5.jar?modtime=1218209625"
632     usetimestamp="true"
633     dest="${junit-4.5.path}"/>
634    </target>
635 
636    <target name="abcl.test.compile" 
637      depends="abcl.test.pre-compile,abcl.compile">
638      <mkdir dir="${abcl.test.classes.dir}"/>
639      <javac destdir="${abcl.test.classes.dir}"
640       classpathref="abcl.test.compile.classpath"
641       debug="true"
642       target="1.5">
643  <src path="${abcl.test.src.dir}"/>
644  <patternset refid="abcl.test.source.java"/>
645      </javac>
646    </target>
647
648    <path id="abcl.test.run.classpath">
649      <path refid="abcl.test.compile.classpath"/>
650      <pathelement location="${abcl.test.classes.dir}"/>
651    </path>
652
653    <target name="abcl.test" 
654      depends="abcl.test.java,abcl.test.lisp"/>
655 
656    <target name="abcl.test.java" depends="abcl.test.compile">
657      <java fork="true"
658      classpathref="abcl.test.run.classpath"
659      classname="org.junit.runner.JUnitCore">
660  <arg value="org.armedbear.lisp.FastStringBufferTest"/>
661      </java>
662    </target>
663
664    <target name="abcl.test.lisp" 
665      depends="test.ansi.compiled,test.abcl,test.cl-bench"/>
666
667    <target name="test.ansi.interpreted" depends="abcl.jar">
668      <echo>Recording test output in ${abcl.test.log.file}.</echo>
669      <record name="${abcl.test.log.file}" emacsmode="true" action="start" append="yes"/>
670      <java fork="true" dir="${basedir}"
671      classpathref="abcl.classpath.dist"
672      classname="org.armedbear.lisp.Main">
673  <arg value="--noinit"/> 
674  <arg value="--eval"/><arg value="(require (quote asdf))"/>
675  <arg value="--eval"/><arg value="(asdf:operate (quote asdf:load-op) :abcl)"/>
676  <arg value="--eval"/><arg value="(asdf:operate (quote asdf:test-op) :ansi-interpreted)"/>
677        <arg value="--eval"/><arg value="(ext:exit)"/>
678      </java>
679      <record name="${abcl.test.log.file}" emacsmode="true" action="stop"/>
680      <echo>Finished recording test output in ${abcl.test.log.file}.</echo>
681    </target>
682
683    <target name="test.ansi.compiled" depends="abcl.jar">
684      <echo>Recording test output in ${abcl.test.log.file}.</echo>
685      <record name="${abcl.test.log.file}" emacsmode="true" action="start" append="yes"/>
686      <java fork="true" dir="${basedir}"
687      classpathref="abcl.classpath.dist"
688      classname="org.armedbear.lisp.Main">
689  <arg value="--noinit"/> 
690  <arg value="--eval"/><arg value="(require (quote asdf))"/>
691  <arg value="--eval"/><arg value="(asdf:operate (quote asdf:load-op) :abcl)"/>
692  <arg value="--eval"/><arg value="(asdf:operate (quote asdf:test-op) :ansi-compiled)"/>
693        <arg value="--eval"/><arg value="(ext:exit)"/>
694      </java>
695      <record name="${abcl.test.log.file}" emacsmode="true" action="stop"/>
696      <echo>Finished recording test output in ${abcl.test.log.file}.</echo>
697    </target>
698
699    <target name="test.abcl" depends="abcl.jar">
700      <echo>Recording test output in ${abcl.test.log.file}.</echo>
701      <record name="${abcl.test.log.file}" emacsmode="true" action="start" append="yes"/>
702      <java fork="true" dir="${basedir}"
703      classpathref="abcl.classpath.dist"
704      classname="org.armedbear.lisp.Main">
705  <arg value="--noinit"/> 
706  <arg value="--eval"/><arg value="(require (quote asdf))"/>
707  <arg value="--eval"/><arg value="(asdf:operate (quote asdf:load-op) :abcl)"/>
708  <arg value="--eval"/><arg value="(asdf:operate (quote asdf:test-op) :abcl-test-lisp)"/>
709        <arg value="--eval"/><arg value="(ext:exit)"/>
710      </java>
711      <record name="${abcl.test.log.file}" emacsmode="true" action="stop"/>
712      <echo>Finished recording test output in ${abcl.test.log.file}.</echo>
713    </target>
714
715    <target name="test.cl-bench" depends="abcl.jar">
716      <echo>Recording test output in ${abcl.test.log.file}.</echo>
717      <record name="${abcl.test.log.file}" emacsmode="true" action="start" append="yes"/>
718      <java fork="true" dir="${basedir}"
719      classpathref="abcl.classpath.dist"
720      classname="org.armedbear.lisp.Main">
721  <arg value="--noinit"/> 
722  <arg value="--eval"/><arg value="(require (quote asdf))"/>
723  <arg value="--eval"/><arg value="(asdf:operate (quote asdf:load-op) :abcl)"/>
724  <arg value="--eval"/><arg value="(asdf:operate (quote asdf:test-op) :cl-bench)"/>
725        <arg value="--eval"/><arg value="(ext:exit)"/>
726      </java>
727      <record name="${abcl.test.log.file}" emacsmode="true" action="stop"/>
728      <echo>Finished recording test output in ${abcl.test.log.file}.</echo>
729    </target>
730
731
732    <import file="netbeans-build.xml" optional="true"/> 
733<!--    <import file="j-build.xml" optional="true"/>  -->
734    <import file="not.org-build.xml" optional="true"/> 
735</project>
736
737
738
739
Note: See TracBrowser for help on using the repository browser.