[armedbear-cvs] r12338 - in trunk/abcl: . test/lisp/ansi

Mark Evenson mevenson at common-lisp.net
Wed Jan 6 15:52:20 UTC 2010


Author: mevenson
Date: Wed Jan  6 10:52:13 2010
New Revision: 12338

Log:
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.


Removed:
   trunk/abcl/test/lisp/ansi/ansi-tests-compiled.lisp
   trunk/abcl/test/lisp/ansi/ansi-tests-interpreted.lisp
Modified:
   trunk/abcl/abcl.asd
   trunk/abcl/build.xml

Modified: trunk/abcl/abcl.asd
==============================================================================
--- trunk/abcl/abcl.asd	(original)
+++ trunk/abcl/abcl.asd	Wed Jan  6 10:52:13 2010
@@ -7,79 +7,84 @@
 (in-package :abcl-asdf)
 
 ;;; Wrapper for all ABCL ASDF definitions.
-(defsystem :abcl :version "0.4.0")
+(defsystem :abcl :version "0.5.0")
 
 (defmethod perform :after ((o load-op) (c (eql (find-system :abcl))))
-  ;;; Additional test suite loads would go here.
-  (operate 'load-op :test-abcl :force t))
-
-(defmethod perform ((o test-op) (c (eql (find-system :abcl))))
-  ;;; Additional test suite invocations would go here.
-  (operate 'test-op :ansi-compiled :force t))
-
-;;; A collection of test suites for ABCL.
-(defsystem :test-abcl
-  :version "0.3.1"
-  :depends-on (:ansi-compiled #+nil :abcl-tests))
-
-(defmethod perform :after ((o load-op) (c (eql (find-system :abcl))))
-  (operate 'load-op :cl-bench :force t)
+  (operate 'load-op :abcl-tests :force t)
   (operate 'load-op :abcl-test-lisp :force t)
+  (operate 'load-op :cl-bench :force t)
   (operate 'load-op :ansi-compiled :force t)
   (operate 'load-op :ansi-interpreted :force t))
 
-#+nil
-(defmethod perform :before ((o load-op) (c t))
-  (warn "ASDF load-op class is ~A" c))
-
-(defsystem :ansi-test :version "1.0" :components
-     ;;; GCL ANSI test suite.
-     ((:module ansi-tests :pathname "test/lisp/ansi/" :components
-	       ((:file "package")))))
-
-(defsystem :ansi-interpreted :version "1.0" :depends-on (ansi-test))
-(defmethod perform ((o test-op) (c (eql (find-system :ansi-interpreted))))
-   "Invoke tests with:  (asdf:oos 'asdf:test-op :ansi-interpreted :force t)."
-  (funcall (intern (symbol-name 'run) :abcl.test.ansi)
-	   :compile-tests nil))
-(defmethod perform :before ((o test-op) (c (eql (find-system
-                                                 :ansi-interpreted))))
-  (operate 'load-op :ansi-interpreted :force t))
+;;;  Run via (asdf:operate 'asdf:test-op :abcl :force t)
+(defmethod perform ((o test-op) (c (eql (find-system :abcl))))
+  (operate 'test-op :abcl-tests :force t))
 
-(defsystem :ansi-compiled :version "1.0" :depends-on (ansi-test))
-(defmethod perform ((o test-op) (c (eql (find-system :ansi-compiled))))
-  "Invoke tests with:  (asdf:oos 'asdf:test-op :abcl-compiled :force t)."
-  (funcall (intern (symbol-name 'run) :abcl.test.ansi)
-	   :compile-tests t))
-(defmethod perform :before ((o test-op) (c (eql (find-system
-                                                 :ansi-compiled))))
-  (operate 'load-op :ansi-compiled :force t))
+;;; A collection of test suites for ABCL.
+(defsystem :abcl-tests
+  :version "2.0"
+  :depends-on (:abcl-test-lisp 
+               :ansi-compiled :ansi-interpreted
+               :cl-bench))
+
+(defmethod perfom :before ((o test-op (c (eql find-system :abcl-tests))))
+  (operate 'load-op :abcl-test-lisp)
+  (operate 'load-op :ansi-compiled)
+  (operate 'load-op :cl-bench))
+
+;;;  Run via (asdf:operate 'asdf:test-op :abcl-tests :force t)
+(defmethod perform ((o test-op) (c (eql (find-system :abcl-tests))))
+  ;; Additional test suite invocations would go here.
+  (operate 'test-op :abcl-test-lisp) 
+  (operate 'test-op :ansi-compiled)
+  (operate 'test-op :cl-bench))
 
+;;; Test ABCL with the Lisp unit tests collected in "test/lisp/abcl"
 (defsystem :abcl-test-lisp :version "1.1" :components
 	   ((:module abcl-rt :pathname "test/lisp/abcl/" :serial t :components
 		     ((:file "rt-package") (:file "rt")))
 	    (:module package  :depends-on (abcl-rt)
 		     :pathname "test/lisp/abcl/" :components
 		     ((:file "package")))))
-
 (defmethod perform :before ((o test-op) (c (eql (find-system
                                                  :abcl-test-lisp))))
   (operate 'load-op :abcl-test-lisp :force t))
-
 (defmethod perform ((o test-op) (c (eql (find-system 'abcl-test-lisp))))
    "Invoke tests with (asdf:oos 'asdf:test-op :abcl-test-lisp)."
    (funcall (intern (symbol-name 'run) :abcl-test)))
 
+;;; Test ABCL with the interpreted ANSI tests
+(defsystem :ansi-interpreted :version "1.0.1" 
+           :components
+           ((:module ansi-tests :pathname "test/lisp/ansi/" :components
+	       ((:file "package")))))
+(defmethod perform :before ((o test-op) (c (eql (find-system :ansi-interpreted))))
+  (operate 'load-op :ansi-interpreted))
+(defmethod perform ((o test-op) (c (eql (find-system :ansi-interpreted))))
+  (funcall (intern (symbol-name 'run) :abcl.test.ansi)
+	   :compile-tests nil))
+
+;;; Test ABCL with the compiled ANSI tests
+(defsystem :ansi-compiled :version "1.0.1" 
+           :components
+           ((:module ansi-tests :pathname "test/lisp/ansi/" :components
+	       ((:file "package")))))
+(defmethod perform :before ((o test-op) (c (eql (find-system :ansi-compiled))))
+  (operate 'load-op :ansi-compiled))
+(defmethod perform ((o test-op) (c (eql (find-system :ansi-compiled))))
+  (funcall (intern (symbol-name 'run) :abcl.test.ansi)
+	   :compile-tests t))
+
+
+;;; Test ABCL with CL-BENCH 
 (defsystem :cl-bench :components
            ((:module cl-bench-package :pathname "../cl-bench/"
                     :components ((:file "defpackage")))
             (:module cl-bench-wrapper :pathname "test/lisp/cl-bench/" 
                      :depends-on (cl-bench-package) :components
                      ((:file "wrapper")))))
-
 (defmethod perform :before ((o test-op) (c (eql (find-system :cl-bench))))
   (operate 'load-op :cl-bench :force t))
-
 (defmethod perform ((o test-op) (c (eql (find-system :cl-bench))))
   (funcall (intern (symbol-name 'run) :abcl.test.cl-bench)))
  

Modified: trunk/abcl/build.xml
==============================================================================
--- trunk/abcl/build.xml	(original)
+++ trunk/abcl/build.xml	Wed Jan  6 10:52:13 2010
@@ -4,7 +4,30 @@
     <description>Compiling, testing, and packaging Armed Bear Common Lisp</description>
 
     <target name="abcl" depends="abcl.wrapper"/>
+	
+    <target name="help">
+      <echo>
+Main Ant targets:
+
+ abcl.wrapper 
+   -- [default] create executable wrapper for ABCL.
+ abcl.compile  
+   -- compile ABCL to ${build.classes.dir}.
+ abcl.jar      
+   -- create packaged ${abcl.jar.path}.
+ abcl.source.zip abcl.source.tar
+   -- create source distributions in ${dist.dir}.
+ abcl.clean 
+   -- remove ABCL intermediate files
+      </echo>
 
+      <echo>
+For help on the automatic tests available, use the Ant target 'help.test'.
+      </echo>
+    </target>
+
+    <!-- Behavior of the build system can be customized via setting
+         properties in the 'build.properties' file. -->
     <property file="build.properties"/>
 
     <property name="build.dir" 
@@ -19,23 +42,14 @@
 	      value="${dist.dir}/abcl.jar"/>
     <property name="abcl.ext.dir"
 	      value="${basedir}/ext"/>
-	
-    <target name="help">
-      <echo>Main Ant targets:
- abcl.compile  
-   -- compile ABCL to ${build.classes.dir}.
- abcl.jar      
-   -- create packaged ${abcl.jar.path}.
- abcl.wrapper  
-   -- create executable wrapper for ABCL.
- abcl.source.zip abcl.source.tar
-   -- create source distributions in ${dist.dir}.
- abcl.test.java
-   -- Run junit tests under ${abcl.test.src.dir}.
- abcl.clean 
-   -- remove ABCL intermediate files</echo>
-      <echo>Corresponding targets for J have been removed.</echo>
-    </target>
+
+    <fail message="Please build using Ant 1.7.1 or higher.">
+        <condition>
+            <not>
+                <antversion atleast="1.7.1"/>
+            </not>
+        </condition>
+    </fail>
 
     <!-- Checks if JSR-223 support is available - thanks to Mark Evenson -->
     <available property="abcl.jsr-223.p"
@@ -104,8 +118,6 @@
       <property name="abcl.test.log.file"
 		value="abcl-test-${build.stamp}.log"/>
 
-      <!--- antversion fails in ant 1.7.1 <antversion property="ant.version" 
-	                                              atleast="1.7"/> -->
       <property name="java.path"
 		value="${java.home}/bin/java"/>
 
@@ -426,12 +438,11 @@
       <include name="build-abcl.lisp"/>
       <include name="customizations.lisp.in"/>
 
-      <include name="test-abcl.asd"/>
-      <include name="build-abcl.asd"/>
     </patternset>
 
-    <patternset id="abcl.source.misc"
-		description="Additional includes in the source distribution relative to source root">
+    <patternset 
+        id="abcl.source.misc"
+        description="Additional includes in the source distribution relative to source root">
       <include name="org/armedbear/lisp/LICENSE"/>
       <include name="manifest-abcl"/>
       <include name="META-INF/services/javax.script.ScriptEngineFactory"/>
@@ -558,6 +569,35 @@
       </zip>
     </target>
 
+    <target name="help.test">
+      <echo>
+The following Ant targets run various test suites:
+  
+  abcl.test
+    --  Run all available tests.
+  abcl.test.java
+    --  Run the ABCL junit Java tests under ${basedir}/test/src
+  abcl.test.lisp
+    --  Run the 'test.ansi.compiled', 'test.abcl', 'test.cl-bench' targets
+  test.ansi.compiled
+    --  Run the compiled version of the ANSI test suite
+  test.abcl
+    --  Run the Lisp RT tests collected in ${basedir}/test/lisp/abcl
+  test.cl-bench 
+    --  Run the cl-bench test suite.
+
+The ANSI tests require that the [ansi-tests][1] be manually installed in 
+${basedir}/../ansi-tests.
+
+[1]: svn://common-lisp.net/project/ansi-test/svn/trunk/ansi-tests
+
+The CL-BENCH test require that [cl-bench][2] be maunally installed in
+${basedir}/../cl-bench
+
+[2]: http://www.chez.com/emarsden/downloads/cl-bench.tar.gz
+      </echo>
+    </target>
+
     <property name="abcl.test.classes.dir"
 	      value="${build.dir}/classes-test"/>
 
@@ -581,7 +621,8 @@
     <target name="abcl.test.pre-compile" depends="abcl.ext"/>
 
     <target name="abcl.ext.p">
-      <!--XXX generalize over enumeration of all contributions to abcl.ext -->
+      <!--XXX generalize over enumeration of all contributions to
+           abcl.ext if we get more of them.  -->
       <available file="${junit-4.5.path}" property="abcl.ext.p"/>
     </target>
     <target name="abcl.ext" depends="abcl.ext.p" unless="abcl.ext.p">
@@ -621,7 +662,7 @@
     </target>
 
     <target name="abcl.test.lisp" 
-	    depends="test.ansi.compiled,test.abcl"/>
+	    depends="test.ansi.compiled,test.abcl,test.cl-bench"/>
 
     <target name="test.ansi.interpreted" depends="abcl.jar">
       <echo>Recording test output in ${abcl.test.log.file}.</echo>
@@ -630,8 +671,10 @@
 	    classpathref="abcl.classpath.dist"
 	    classname="org.armedbear.lisp.Main">
  	<arg value="--noinit"/> 
-	<arg value="--load"/>
-	<arg line="${basedir}/test/lisp/ansi/ansi-tests-interpreted.lisp"/>
+	<arg value="--eval"/><arg value="(require (quote asdf))"/>
+	<arg value="--eval"/><arg value="(asdf:operate (quote asdf:load-op) :abcl)"/>
+	<arg value="--eval"/><arg value="(asdf:operate (quote asdf:test-op) :ansi-interpreted)"/>
+        <arg value="--eval"/><arg value="(ext:exit)"/>
       </java>
       <record name="${abcl.test.log.file}" emacsmode="true" action="stop"/>
       <echo>Finished recording test output in ${abcl.test.log.file}.</echo>
@@ -644,8 +687,10 @@
 	    classpathref="abcl.classpath.dist"
 	    classname="org.armedbear.lisp.Main">
 	<arg value="--noinit"/> 
-	<arg value="--load"/>
- 	<arg line="${basedir}/test/lisp/ansi/ansi-tests-compiled.lisp "/> 
+	<arg value="--eval"/><arg value="(require (quote asdf))"/>
+	<arg value="--eval"/><arg value="(asdf:operate (quote asdf:load-op) :abcl)"/>
+	<arg value="--eval"/><arg value="(asdf:operate (quote asdf:test-op) :ansi-compiled)"/>
+        <arg value="--eval"/><arg value="(ext:exit)"/>
       </java>
       <record name="${abcl.test.log.file}" emacsmode="true" action="stop"/>
       <echo>Finished recording test output in ${abcl.test.log.file}.</echo>
@@ -658,8 +703,10 @@
 	    classpathref="abcl.classpath.dist"
 	    classname="org.armedbear.lisp.Main">
 	<arg value="--noinit"/> 
-	<arg value="--load"/>
- 	<arg line="${basedir}/test/lisp/abcl/abcl-test.lisp"/>
+	<arg value="--eval"/><arg value="(require (quote asdf))"/>
+	<arg value="--eval"/><arg value="(asdf:operate (quote asdf:load-op) :abcl)"/>
+	<arg value="--eval"/><arg value="(asdf:operate (quote asdf:test-op) :abcl-test-lisp)"/>
+        <arg value="--eval"/><arg value="(ext:exit)"/>
       </java>
       <record name="${abcl.test.log.file}" emacsmode="true" action="stop"/>
       <echo>Finished recording test output in ${abcl.test.log.file}.</echo>
@@ -675,6 +722,7 @@
 	<arg value="--eval"/><arg value="(require (quote asdf))"/>
 	<arg value="--eval"/><arg value="(asdf:operate (quote asdf:load-op) :abcl)"/>
 	<arg value="--eval"/><arg value="(asdf:operate (quote asdf:test-op) :cl-bench)"/>
+        <arg value="--eval"/><arg value="(ext:exit)"/>
       </java>
       <record name="${abcl.test.log.file}" emacsmode="true" action="stop"/>
       <echo>Finished recording test output in ${abcl.test.log.file}.</echo>
@@ -686,3 +734,6 @@
     <import file="not.org-build.xml" optional="true"/> 
 </project>
 
+
+
+




More information about the armedbear-cvs mailing list