[armedbear-cvs] r11530 - in trunk/abcl: . scripts test/lisp test/lisp/ansi test/lisp/cl-bench

Mark Evenson mevenson at common-lisp.net
Sat Jan 3 18:16:11 UTC 2009


Author: mevenson
Date: Sat Jan  3 18:16:10 2009
New Revision: 11530

Log:
'abcl.test' now invokes both Java and Lisp based tests.

First stab at a collected test infrastructure for ABCL using ASDF packaging.

Currently, only the GCL ANSI-TEST suite really works: create a sibling
directory to the 'abcl' top-level directory called 'ansi-tests' to get
them to run automagically.  



Added:
   trunk/abcl/abcl.asd
   trunk/abcl/scripts/ansi-tests-compiled.lisp   (contents, props changed)
   trunk/abcl/scripts/ansi-tests-interpreted.lisp   (contents, props changed)
   trunk/abcl/test/lisp/
   trunk/abcl/test/lisp/ansi/
   trunk/abcl/test/lisp/ansi/package.lisp   (contents, props changed)
   trunk/abcl/test/lisp/cl-bench/
   trunk/abcl/test/lisp/cl-bench.asd
Removed:
   trunk/abcl/scripts/update-version
Modified:
   trunk/abcl/build.xml

Added: trunk/abcl/abcl.asd
==============================================================================
--- (empty file)
+++ trunk/abcl/abcl.asd	Sat Jan  3 18:16:10 2009
@@ -0,0 +1,39 @@
+;;; -*- Mode: LISP; Syntax: COMMON-LISP -*-
+;;; $Id$
+
+(require 'asdf)
+(defpackage :abcl-asdf
+  (:use :cl :asdf))
+(in-package :abcl-asdf)
+
+(defsystem :abcl
+  :documentation "Wrapper for all ABCL ASDF definitions."
+  :version "0.2.0")
+
+(defmethod perform :after ((o load-op) (c (eql (find-system 'abcl))))
+  (asdf:oos 'asdf:load-op :test-abcl))
+
+(defsystem :test-abcl
+  :documentation "A collection of test suites for ABCL." 
+  :version "0.3"
+  :components
+     ((:module ansi-tests :pathname "test/lisp/ansi/"
+	       :documentation "GCL ANSI test suite"
+	       :components
+	      ((:file "package")))))
+
+(defmethod perform ((o test-op) (c (eql (find-system 'abcl))))
+  "Invoke tests with:  (asdf:oos 'asdf:test-op :test-abcl)."
+  (funcall (intern (symbol-name 'run-ansi-tests) 
+		   :abcl.tests.ansi-tests)))
+
+;;; Works for: abcl, sbcl, clisp
+(defsystem :build-abcl 
+  :documentation "Build ABCL from a Lisp."
+  :components 
+	   ((:module build :pathname ""  :components
+		     ((:file "build-abcl") 
+		      (:file "customizations" :depends-on ("build-abcl"))))))
+
+
+

Modified: trunk/abcl/build.xml
==============================================================================
--- trunk/abcl/build.xml	(original)
+++ trunk/abcl/build.xml	Sat Jan  3 18:16:10 2009
@@ -82,7 +82,7 @@
 
       <!-- Set from commandline via -D or in 'build.properties' -->
       <property name="build.version" value="abcl.svn"/>
-      <echo>Build-Version: ${build.version}</echo>
+      <echo>Implementation-Source: ${version.src}</echo>
     </target>
 
     <target name="abcl.stamp.hostname">
@@ -421,6 +421,7 @@
     <target name="abcl.test.pre-compile">
       <mkdir dir="${abcl.ext.dir}"/>
       <get src="http://downloads.sourceforge.net/junit/junit-4.5.jar?modtime=1218209625"
+	   usetimestamp="true"
 	  dest="${junit-4.5.path}"/>
     </target>
 	
@@ -439,6 +440,8 @@
       <path refid="abcl.test.compile.classpath"/>
       <pathelement location="${abcl.test.classes.dir}"/>
     </path>
+
+    <target name="abcl.test" depends="abcl.test.java,abcl.test.lisp"/>
 	
     <target name="abcl.test.java" depends="abcl.test.compile">
       <java fork="true"
@@ -448,6 +451,30 @@
       </java>
     </target>
 
+    <target name="abcl.test.lisp" depends="abcl.test.lisp.asdf"/>
+
+    <target name="abcl.test.lisp.asdf" depends="abcl.jar">
+    </target>
+
+    <target name="abcl.test.ansi.interpreted">
+      <java fork="true"
+	    classpathref="abcl.classpath.dist"
+	    classname="org.armedbear.lisp.Main">
+	<arg value="--noinit"/>
+	<arg value="--load scripts/ansi-tests-interpreted.lisp "/>
+      </java>
+    </target>
+
+    <target name="abcl.test.ansi.interpreted">
+      <java fork="true"
+	    classpathref="abcl.classpath.dist"
+	    classname="org.armedbear.lisp.Main">
+	<arg value="--noinit"/>
+	<arg value="--load scripts/ansi-tests-compiled.lisp "/>
+      </java>
+    </target>
+
+
     <import file="netbeans-build.xml" optional="true"/> 
 <!--    <import file="j-build.xml" optional="true"/>  -->
     <import file="not.org-build.xml" optional="true"/> 

Added: trunk/abcl/scripts/ansi-tests-compiled.lisp
==============================================================================
--- (empty file)
+++ trunk/abcl/scripts/ansi-tests-compiled.lisp	Sat Jan  3 18:16:10 2009
@@ -0,0 +1,4 @@
+(require 'asdf)
+(asdf:oos 'asdf:load-op :abcl)
+(abcl.tests.ansi-tests:run :compile-tests t)
+(ext:exit)
\ No newline at end of file

Added: trunk/abcl/scripts/ansi-tests-interpreted.lisp
==============================================================================
--- (empty file)
+++ trunk/abcl/scripts/ansi-tests-interpreted.lisp	Sat Jan  3 18:16:10 2009
@@ -0,0 +1,4 @@
+(require 'asdf)
+(asdf:oos 'asdf:load-op :abcl)
+(asdf:oos 'asdf:test-op :abcl :force t)
+(ext:exit)
\ No newline at end of file

Added: trunk/abcl/test/lisp/ansi/package.lisp
==============================================================================
--- (empty file)
+++ trunk/abcl/test/lisp/ansi/package.lisp	Sat Jan  3 18:16:10 2009
@@ -0,0 +1,47 @@
+(defpackage :abcl.tests.ansi-tests
+  (:use :cl :asdf)
+  (:nicknames "ansi-tests" "abcl-ansi-tests")
+  (:export :run))
+
+(in-package :abcl.tests.ansi-tests)
+
+(defparameter *ansi-tests-master-source-location*
+  "<svn://common-lisp.net/project/ansi-test/svn/trunk/ansi-tests>")  
+
+(defparameter *ansi-tests-directory*
+  (merge-pathnames
+   #p"../ansi-tests/"
+   (asdf:component-pathname (asdf:find-system :abcl))))
+
+(defun run (&optional (compile-tests nil)) 
+  "Run the ANSI-TESTS suite, found in *ANSI-TESTS-DIRECTORY*.
+Possibly running the compiled version of the tests if COMPILE-TESTS is non-NIL."
+  (let ((original-pathname-defaults *default-pathname-defaults*)
+	(ansi-tests-directory *ansi-tests-directory*)
+	(boot-file (if compile-tests "compileit.lsp" "doit.lsp")))
+    (handler-case 
+	(progn
+	  (setf  *default-pathname-defaults*
+		 (merge-pathnames ansi-tests-directory 
+				  *default-pathname-defaults*))
+	  (warn 
+	   (format nil "Speculative invocation of '~A' in ~A follows."
+		   boot-file
+		   ansi-tests-directory))
+;; XXX -- what to invoke on win32?
+;;	  (run-shell-command "make clean" :directory ansi-tests-directory)
+	  (time (load boot-file)))
+      (file-error (e)
+		(error 
+		 (format nil
+			 "Failed to find the GCL ANSI tests in '~A'.
+Because ~A.
+To resolve, please locally obtain ~A, 
+and set the value of *ANSI-TESTS-DIRECTORY* to that location."
+		 ansi-tests-directory e 
+		 *ansi-tests-master-source-location*))))
+    (setf *default-pathname-defaults*
+	  original-pathname-defaults)))
+		   
+	     
+

Added: trunk/abcl/test/lisp/cl-bench.asd
==============================================================================
--- (empty file)
+++ trunk/abcl/test/lisp/cl-bench.asd	Sat Jan  3 18:16:10 2009
@@ -0,0 +1,28 @@
+(defpackage :cl-bench-asdf 
+  (:use :cl :asdf))
+
+(in-package :cl-bench-asdf)
+
+(defsystem :cl-bench
+  :documentation "http://www.chez.com/emarsden/downloads/cl-bench.tar.gz"
+  :version "20081231a"
+  :components 
+  ((:module cl-bench-source :pathname "" :components
+	    ((:file "defpackage")
+	     (:file "do-compilation-script")
+	     (:file "do-execute-script")
+	     (:file "do-interpret-script")
+	     (:file "generate")
+	     (:file "graph-report")
+	     (:file "pdf-report")
+	     (:file "report")
+	     (:file "support")
+	     (:file "tests")))))
+
+(defmethod perform ((o test-op) (c (eql (find-system 'cl-bench))))
+  "Invoke tests with:  (asdf:operate 'asdf:test-op :cl-bench)."
+  (asdf:oos 'asdf:load-op :cl-bench)
+  (load "sysdep/setup-ablisp.lisp")
+;  (load "do-compilation-script.lisp")
+  (load "do-execute-script"))
+




More information about the armedbear-cvs mailing list