Changeset 12338


Ignore:
Timestamp:
01/06/10 15:52:13 (12 years ago)
Author:
Mark Evenson
Message:

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.

Location:
trunk/abcl
Files:
2 deleted
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/abcl/abcl.asd

    r12337 r12338  
    88
    99;;; Wrapper for all ABCL ASDF definitions.
    10 (defsystem :abcl :version "0.4.0")
     10(defsystem :abcl :version "0.5.0")
    1111
    1212(defmethod perform :after ((o load-op) (c (eql (find-system :abcl))))
    13   ;;; Additional test suite loads would go here.
    14   (operate 'load-op :test-abcl :force t))
    15 
    16 (defmethod perform ((o test-op) (c (eql (find-system :abcl))))
    17   ;;; Additional test suite invocations would go here.
    18   (operate 'test-op :ansi-compiled :force t))
    19 
    20 ;;; A collection of test suites for ABCL.
    21 (defsystem :test-abcl
    22   :version "0.3.1"
    23   :depends-on (:ansi-compiled #+nil :abcl-tests))
    24 
    25 (defmethod perform :after ((o load-op) (c (eql (find-system :abcl))))
     13  (operate 'load-op :abcl-tests :force t)
     14  (operate 'load-op :abcl-test-lisp :force t)
    2615  (operate 'load-op :cl-bench :force t)
    27   (operate 'load-op :abcl-test-lisp :force t)
    2816  (operate 'load-op :ansi-compiled :force t)
    2917  (operate 'load-op :ansi-interpreted :force t))
    3018
    31 #+nil
    32 (defmethod perform :before ((o load-op) (c t))
    33   (warn "ASDF load-op class is ~A" c))
     19;;;  Run via (asdf:operate 'asdf:test-op :abcl :force t)
     20(defmethod perform ((o test-op) (c (eql (find-system :abcl))))
     21  (operate 'test-op :abcl-tests :force t))
    3422
    35 (defsystem :ansi-test :version "1.0" :components
    36      ;;; GCL ANSI test suite.
    37      ((:module ansi-tests :pathname "test/lisp/ansi/" :components
    38          ((:file "package")))))
     23;;; A collection of test suites for ABCL.
     24(defsystem :abcl-tests
     25  :version "2.0"
     26  :depends-on (:abcl-test-lisp
     27               :ansi-compiled :ansi-interpreted
     28               :cl-bench))
    3929
    40 (defsystem :ansi-interpreted :version "1.0" :depends-on (ansi-test))
    41 (defmethod perform ((o test-op) (c (eql (find-system :ansi-interpreted))))
    42    "Invoke tests with:  (asdf:oos 'asdf:test-op :ansi-interpreted :force t)."
    43   (funcall (intern (symbol-name 'run) :abcl.test.ansi)
    44      :compile-tests nil))
    45 (defmethod perform :before ((o test-op) (c (eql (find-system
    46                                                  :ansi-interpreted))))
    47   (operate 'load-op :ansi-interpreted :force t))
     30(defmethod perfom :before ((o test-op (c (eql find-system :abcl-tests))))
     31  (operate 'load-op :abcl-test-lisp)
     32  (operate 'load-op :ansi-compiled)
     33  (operate 'load-op :cl-bench))
    4834
    49 (defsystem :ansi-compiled :version "1.0" :depends-on (ansi-test))
    50 (defmethod perform ((o test-op) (c (eql (find-system :ansi-compiled))))
    51   "Invoke tests with:  (asdf:oos 'asdf:test-op :abcl-compiled :force t)."
    52   (funcall (intern (symbol-name 'run) :abcl.test.ansi)
    53      :compile-tests t))
    54 (defmethod perform :before ((o test-op) (c (eql (find-system
    55                                                  :ansi-compiled))))
    56   (operate 'load-op :ansi-compiled :force t))
     35;;;  Run via (asdf:operate 'asdf:test-op :abcl-tests :force t)
     36(defmethod perform ((o test-op) (c (eql (find-system :abcl-tests))))
     37  ;; Additional test suite invocations would go here.
     38  (operate 'test-op :abcl-test-lisp)
     39  (operate 'test-op :ansi-compiled)
     40  (operate 'test-op :cl-bench))
    5741
     42;;; Test ABCL with the Lisp unit tests collected in "test/lisp/abcl"
    5843(defsystem :abcl-test-lisp :version "1.1" :components
    5944     ((:module abcl-rt :pathname "test/lisp/abcl/" :serial t :components
     
    6247         :pathname "test/lisp/abcl/" :components
    6348         ((:file "package")))))
    64 
    6549(defmethod perform :before ((o test-op) (c (eql (find-system
    6650                                                 :abcl-test-lisp))))
    6751  (operate 'load-op :abcl-test-lisp :force t))
    68 
    6952(defmethod perform ((o test-op) (c (eql (find-system 'abcl-test-lisp))))
    7053   "Invoke tests with (asdf:oos 'asdf:test-op :abcl-test-lisp)."
    7154   (funcall (intern (symbol-name 'run) :abcl-test)))
    7255
     56;;; Test ABCL with the interpreted ANSI tests
     57(defsystem :ansi-interpreted :version "1.0.1"
     58           :components
     59           ((:module ansi-tests :pathname "test/lisp/ansi/" :components
     60         ((:file "package")))))
     61(defmethod perform :before ((o test-op) (c (eql (find-system :ansi-interpreted))))
     62  (operate 'load-op :ansi-interpreted))
     63(defmethod perform ((o test-op) (c (eql (find-system :ansi-interpreted))))
     64  (funcall (intern (symbol-name 'run) :abcl.test.ansi)
     65     :compile-tests nil))
     66
     67;;; Test ABCL with the compiled ANSI tests
     68(defsystem :ansi-compiled :version "1.0.1"
     69           :components
     70           ((:module ansi-tests :pathname "test/lisp/ansi/" :components
     71         ((:file "package")))))
     72(defmethod perform :before ((o test-op) (c (eql (find-system :ansi-compiled))))
     73  (operate 'load-op :ansi-compiled))
     74(defmethod perform ((o test-op) (c (eql (find-system :ansi-compiled))))
     75  (funcall (intern (symbol-name 'run) :abcl.test.ansi)
     76     :compile-tests t))
     77
     78
     79;;; Test ABCL with CL-BENCH
    7380(defsystem :cl-bench :components
    7481           ((:module cl-bench-package :pathname "../cl-bench/"
     
    7784                     :depends-on (cl-bench-package) :components
    7885                     ((:file "wrapper")))))
    79 
    8086(defmethod perform :before ((o test-op) (c (eql (find-system :cl-bench))))
    8187  (operate 'load-op :cl-bench :force t))
    82 
    8388(defmethod perform ((o test-op) (c (eql (find-system :cl-bench))))
    8489  (funcall (intern (symbol-name 'run) :abcl.test.cl-bench)))
  • trunk/abcl/build.xml

    r12335 r12338  
    55
    66    <target name="abcl" depends="abcl.wrapper"/>
    7 
     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. -->
    831    <property file="build.properties"/>
    932
     
    2043    <property name="abcl.ext.dir"
    2144        value="${basedir}/ext"/>
    22  
    23     <target name="help">
    24       <echo>Main Ant targets:
    25  abcl.compile 
    26    -- compile ABCL to ${build.classes.dir}.
    27  abcl.jar     
    28    -- create packaged ${abcl.jar.path}.
    29  abcl.wrapper 
    30    -- create executable wrapper for ABCL.
    31  abcl.source.zip abcl.source.tar
    32    -- create source distributions in ${dist.dir}.
    33  abcl.test.java
    34    -- Run junit tests under ${abcl.test.src.dir}.
    35  abcl.clean
    36    -- remove ABCL intermediate files</echo>
    37       <echo>Corresponding targets for J have been removed.</echo>
    38     </target>
     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>
    3953
    4054    <!-- Checks if JSR-223 support is available - thanks to Mark Evenson -->
     
    105119    value="abcl-test-${build.stamp}.log"/>
    106120
    107       <!--- antversion fails in ant 1.7.1 <antversion property="ant.version"
    108                                                 atleast="1.7"/> -->
    109121      <property name="java.path"
    110122    value="${java.home}/bin/java"/>
     
    427439      <include name="customizations.lisp.in"/>
    428440
    429       <include name="test-abcl.asd"/>
    430       <include name="build-abcl.asd"/>
    431     </patternset>
    432 
    433     <patternset id="abcl.source.misc"
    434     description="Additional includes in the source distribution relative to source root">
     441    </patternset>
     442
     443    <patternset
     444        id="abcl.source.misc"
     445        description="Additional includes in the source distribution relative to source root">
    435446      <include name="org/armedbear/lisp/LICENSE"/>
    436447      <include name="manifest-abcl"/>
     
    559570    </target>
    560571
     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
    561601    <property name="abcl.test.classes.dir"
    562602        value="${build.dir}/classes-test"/>
     
    582622
    583623    <target name="abcl.ext.p">
    584       <!--XXX generalize over enumeration of all contributions to abcl.ext -->
     624      <!--XXX generalize over enumeration of all contributions to
     625           abcl.ext if we get more of them.  -->
    585626      <available file="${junit-4.5.path}" property="abcl.ext.p"/>
    586627    </target>
     
    622663
    623664    <target name="abcl.test.lisp"
    624       depends="test.ansi.compiled,test.abcl"/>
     665      depends="test.ansi.compiled,test.abcl,test.cl-bench"/>
    625666
    626667    <target name="test.ansi.interpreted" depends="abcl.jar">
     
    631672      classname="org.armedbear.lisp.Main">
    632673  <arg value="--noinit"/>
    633   <arg value="--load"/>
    634   <arg line="${basedir}/test/lisp/ansi/ansi-tests-interpreted.lisp"/>
     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)"/>
    635678      </java>
    636679      <record name="${abcl.test.log.file}" emacsmode="true" action="stop"/>
     
    645688      classname="org.armedbear.lisp.Main">
    646689  <arg value="--noinit"/>
    647   <arg value="--load"/>
    648   <arg line="${basedir}/test/lisp/ansi/ansi-tests-compiled.lisp "/>
     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)"/>
    649694      </java>
    650695      <record name="${abcl.test.log.file}" emacsmode="true" action="stop"/>
     
    659704      classname="org.armedbear.lisp.Main">
    660705  <arg value="--noinit"/>
    661   <arg value="--load"/>
    662   <arg line="${basedir}/test/lisp/abcl/abcl-test.lisp"/>
     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)"/>
    663710      </java>
    664711      <record name="${abcl.test.log.file}" emacsmode="true" action="stop"/>
     
    676723  <arg value="--eval"/><arg value="(asdf:operate (quote asdf:load-op) :abcl)"/>
    677724  <arg value="--eval"/><arg value="(asdf:operate (quote asdf:test-op) :cl-bench)"/>
     725        <arg value="--eval"/><arg value="(ext:exit)"/>
    678726      </java>
    679727      <record name="${abcl.test.log.file}" emacsmode="true" action="stop"/>
     
    687735</project>
    688736
     737
     738
     739
Note: See TracChangeset for help on using the changeset viewer.