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

Mark Evenson mevenson at common-lisp.net
Tue Jan 27 18:29:03 UTC 2009


Author: mevenson
Date: Tue Jan 27 18:29:01 2009
New Revision: 11596

Log:
Invocation of ASDF tests from Lisp via instructions at top of 'abcl.asd' works.

Optimized 'build.xml' run time for typical (repeated) usage scenarios:
   o  downloading of 'junit.jar' based on presence on filesystem.  
   o  rebuilding of 'abcl.jar' based on explicit check via Ant

Removed automatic execution of ABCL-TESTS based on load.

Ant 'abcl.test' target not working in all situations.  Needs further
debugging.  Workaround: use the Lisp-based ASDF test entry point for now.

ANSI-TESTS-COMPILED ANSI-TESTS-INTERPRETED need a sibling directory
containing the GCL ANSI tests from
<svn://common-lisp.net/project/ansi-test/svn/trunk/ansi-tests>.  They
complain semi-intellibly if not found.




Removed:
   trunk/abcl/scripts/ansi-tests-compiled.lisp
   trunk/abcl/scripts/ansi-tests-interpreted.lisp
Modified:
   trunk/abcl/abcl.asd
   trunk/abcl/build.xml
   trunk/abcl/test/lisp/abcl/compiler-tests.lisp
   trunk/abcl/test/lisp/abcl/condition-tests.lisp
   trunk/abcl/test/lisp/abcl/file-system-tests.lisp
   trunk/abcl/test/lisp/abcl/java-tests.lisp
   trunk/abcl/test/lisp/abcl/math-tests.lisp
   trunk/abcl/test/lisp/abcl/misc-tests.lisp
   trunk/abcl/test/lisp/abcl/pathname-tests.lisp
   trunk/abcl/test/lisp/ansi/package.lisp

Modified: trunk/abcl/abcl.asd
==============================================================================
--- trunk/abcl/abcl.asd	(original)
+++ trunk/abcl/abcl.asd	Tue Jan 27 18:29:01 2009
@@ -1,6 +1,15 @@
 ;;; -*- Mode: LISP; Syntax: COMMON-LISP -*-
 ;;; $Id$
 
+;;;; To run:
+;;;;   
+#|
+cmd$ abcl 
+CL-USER(1): (progn (require 'asdf) 
+                   (asdf:oos 'asdf:load-op :abcl) 
+                   (asdf:oos 'asdf:test-op :ansi-test-compiled :force t))
+|#
+
 (require 'asdf)
 (defpackage :abcl-asdf
   (:use :cl :asdf))
@@ -8,7 +17,7 @@
 
 ;;; Wrapper for all ABCL ASDF definitions.
 (defsystem :abcl
-  :version "0.2.0")
+  :version "0.3.0")
 
 (defmethod perform :after ((o load-op) (c (eql (find-system 'abcl))))
   ;;; Additional test suite loads would go here.
@@ -20,12 +29,13 @@
 
 ;;; A collection of test suites for ABCL.
 (defsystem :test-abcl
-
   :version "0.3"
-  :depends-on (:ansi-test-compiled :ansi-test-interpreted))
+  :depends-on (:ansi-test-compiled :abcl-tests))
 
-(defmethod perform :after ((o test-op) (c (eql (find-system 'test-abcl))))
-  (asdf:oos 'asdf:load-op :ansi-test-interpreted :force t)
+(defmethod perform :after ((o load-op) (c (eql (find-system 'test-abcl))))
+  #+nil (asdf:oos 'asdf:test-op :cl-bench :force t)
+  #+nil (asdf:oos 'asdf:test-op :abcl-tests :force t)
+  #+nil (asdf:oos 'asdf:test-op :ansi-test-interpreted :force t)
   (asdf:oos 'asdf:load-op :ansi-test-compiled :force t))
 
 (defsystem :ansi-test :version "0.1" :components
@@ -35,31 +45,34 @@
 (defsystem :ansi-test-interpreted :version "0,1" :depends-on (ansi-test))
 (defsystem :ansi-test-compiled :version "0.1" :depends-on (ansi-test))
 
-
 (defsystem :abcl-tests
-  :version "1.0"
-  :components
-    ((:module rt :serial t  :pathname "test/lisp/abcl/" :components
-	      ((:file "rt-package") (:file "rt") (:file "test-utilities")))
-     (:module tests :depends-on (rt)
-	      :pathname "test/lisp/abcl/" :components
-	      ((:file "compiler-tests") 
-	       (:file "condition-tests")
-	       (:file "file-system-tests") 
-#+nil	       (:file "math-tests")
-	       (:file "java-tests")
-	       (:file "misc-tests")
-	       (:file "pathname-tests")))))
-
-(defmethod perform ((o test-op) (c (eql (find-system 'abcl-tests))))
-  "Invoke tests with:  (asdf:operate 'asdf:test-op :abcl-tests)."
-  (funcall (intern (symbol-name 'do-tests) :test)))
-
+   :version "1.0"
+   :components
+     ((:module rt :serial t  :pathname "test/lisp/abcl/" :components
+ 	      ((:file "rt-package") (:file "rt") (:file "test-utilities")))
+      (:module tests :depends-on (rt)
+ 	      :pathname "test/lisp/abcl/" :components
+ 	      ((:file "compiler-tests") 
+ 	       (:file "condition-tests")
+ 	       (:file "file-system-tests") 
+ #+nil	       (:file "math-tests")
+ 	       (:file "java-tests")
+ 	       (:file "misc-tests")
+ 	       (:file "pathname-tests")))))
+ 
+ (defmethod perform ((o test-op) (c (eql (find-system 'abcl-tests))))
+   "Invoke tests with:  (asdf:oos 'asdf:test-op :abcl-tests :force t)."
+   ;;; FIXME needs ASDF:OOS to be invoked with :FORCE t
+   (funcall (intern (symbol-name 'do-tests) :test)))
+ 
 (defmethod perform ((o test-op) (c (eql (find-system 'ansi-test-interpreted))))
+   "Invoke tests with:  (asdf:oos 'asdf:test-op :abcl-tests :force t)."
+   ;;; FIXME needs ASDF:OOS to be invoked with :FORCE t
   (funcall (intern (symbol-name 'run) :abcl.tests.ansi-tests)
 	   :compile-tests nil))
 
 (defmethod perform ((o test-op) (c (eql (find-system 'ansi-test-compiled))))
+  "Invoke tests with:  (asdf:oos 'asdf:test-op :abcl-test-compiled :force t)."
   (funcall (intern (symbol-name 'run) :abcl.tests.ansi-tests)
 	   :compile-tests t))
 

Modified: trunk/abcl/build.xml
==============================================================================
--- trunk/abcl/build.xml	(original)
+++ trunk/abcl/build.xml	Tue Jan 27 18:29:01 2009
@@ -141,7 +141,11 @@
     <target name="abcl.jsr-223.notice"
 	    depends="abcl.init"
 	    unless="abcl.jsr-223.p">
-      <echo>Notice: JSR-223 support won't be built since it is not supported, neither natively by your JVM nor by libraries in the CLASSPATH.</echo>
+      <echo>
+	Notice: JSR-223 support won't be built since it is not
+	        supported, neither natively by your JVM nor by 
+		libraries in the CLASSPATH.
+      </echo>
     </target>
 
     <target name="abcl.compile.java" 
@@ -232,7 +236,16 @@
       <echo>abcl.hostname: ${abcl.hostname}</echo>
     </target>
 
-    <target name="abcl.jar" depends="abcl.stamp">
+    <target name="abcl.jar.uptodate" depends="abcl.compile">
+      <uptodate property="abcl.jar.uptodate.p" targetfile="${abcl.jar.path}">
+	<srcfiles dir="${build.classes.dir}">
+	  <patternset refid="abcl.objects"/>
+	</srcfiles>
+      </uptodate>
+    </target>
+
+    <target name="abcl.jar" depends="abcl.stamp,abcl.jar.uptodate"
+	    unless="abcl.jar.uptodate.p">
       <mkdir dir="${dist.dir}"/>
       <loadfile property="abcl.version"
 		  srcFile="${abcl.version.path}"/>
@@ -433,14 +446,22 @@
       <pathelement location="${build.classes.dir}"/>
     </path>
 
-    <target name="abcl.test.pre-compile">
+    <target name="abcl.test.pre-compile" depends="abcl.ext"/>
+
+    <target name="abcl.ext.p">
+      <!--XXX generalize over enumeration of all contributions to abcl.ext -->
+      <available file="${junit-4.5.path}" property="abcl.ext.p"/>
+    </target>
+    <target name="abcl.ext" depends="abcl.ext.p" unless="abcl.ext.p">
+
       <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}"/>
+	   dest="${junit-4.5.path}"/>
     </target>
 	
-    <target name="abcl.test.compile" depends="abcl.test.pre-compile,abcl.compile">
+    <target name="abcl.test.compile" 
+	    depends="abcl.test.pre-compile,abcl.compile">
       <mkdir dir="${abcl.test.classes.dir}"/>
       <javac destdir="${abcl.test.classes.dir}"
 	     classpathref="abcl.test.compile.classpath"
@@ -456,7 +477,8 @@
       <pathelement location="${abcl.test.classes.dir}"/>
     </path>
 
-    <target name="abcl.test" depends="abcl.test.java,abcl.test.lisp"/>
+    <target name="abcl.test" 
+	    depends="abcl.test.java,abcl.test.lisp"/>
 	
     <target name="abcl.test.java" depends="abcl.test.compile">
       <java fork="true"
@@ -466,9 +488,11 @@
       </java>
     </target>
 
-    <target name="abcl.test.lisp" depends="abcl.test.lisp.asdf"/>
+    <target name="abcl.test.lisp" 
+	    depends="abcl.test.lisp.asdf"/>
 
-    <target name="abcl.test.lisp.asdf" depends="abcl.jar,abcl.test.ansi.interpreted">
+    <target name="abcl.test.lisp.asdf" 
+	    depends="abcl.jar,abcl.test.ansi.compiled">
     </target>
 
     <target name="abcl.test.ansi.interpreted">
@@ -477,20 +501,27 @@
 	    classname="org.armedbear.lisp.Main">
  	<arg value="--noinit"/> 
 	<arg value="--load"/>
-	<arg line="${basedir}/scripts/ansi-tests-interpreted.lisp"/>
+	<arg line="${basedir}/test/lisp/ansi/ansi-tests-interpreted.lisp"/>
       </java>
     </target>
 
+    <property name="abcl.test.log.file"
+	      value="abcl.test.ansi.compiled.${version.src}"/>
+
     <target name="abcl.test.ansi.compiled">
+      <echo>Recording test output in ${abcl.test.log.file}.</echo>
+      <record name="${abcl.test.log.file}" emacsmode="true" action="start"/>
       <java fork="true" dir="${basedir}"
 	    classpathref="abcl.classpath.dist"
 	    classname="org.armedbear.lisp.Main">
 	<arg value="--noinit"/> 
 	<arg value="--load"/>
- 	<arg line="${basedir}/scripts/ansi-tests-compiled.lisp "/> 
+ 	<arg line="${basedir}/test/lisp/ansi/ansi-tests-compiled.lisp "/> 
       </java>
-    </target>
+      <record name="${abcl.test.log.file}" emacsmode="true" action="stop"/>
+      <echo>Finished ecording test output in ${abcl.test.log.file}.</echo>
 
+    </target>
 
     <import file="netbeans-build.xml" optional="true"/> 
 <!--    <import file="j-build.xml" optional="true"/>  -->

Modified: trunk/abcl/test/lisp/abcl/compiler-tests.lisp
==============================================================================
--- trunk/abcl/test/lisp/abcl/compiler-tests.lisp	(original)
+++ trunk/abcl/test/lisp/abcl/compiler-tests.lisp	Tue Jan 27 18:29:01 2009
@@ -431,4 +431,3 @@
   :args (#.most-positive-java-long #.most-negative-java-long)
   :results #.most-positive-java-long)
 
-(do-tests)

Modified: trunk/abcl/test/lisp/abcl/condition-tests.lisp
==============================================================================
--- trunk/abcl/test/lisp/abcl/condition-tests.lisp	(original)
+++ trunk/abcl/test/lisp/abcl/condition-tests.lisp	Tue Jan 27 18:29:01 2009
@@ -310,5 +310,3 @@
                              :format-arguments (list "The bear" "armed"))))
       (write-to-string c :escape nil)))
   "The bear is armed.")
-
-(do-tests)

Modified: trunk/abcl/test/lisp/abcl/file-system-tests.lisp
==============================================================================
--- trunk/abcl/test/lisp/abcl/file-system-tests.lisp	(original)
+++ trunk/abcl/test/lisp/abcl/file-system-tests.lisp	Tue Jan 27 18:29:01 2009
@@ -513,5 +513,3 @@
          (delete-directory directory-namestring))
        )))
   t t t t)
-
-(do-tests)

Modified: trunk/abcl/test/lisp/abcl/java-tests.lisp
==============================================================================
--- trunk/abcl/test/lisp/abcl/java-tests.lisp	(original)
+++ trunk/abcl/test/lisp/abcl/java-tests.lisp	Tue Jan 27 18:29:01 2009
@@ -433,7 +433,5 @@
        'illegal-argument-exception)))
   t)
 
-(do-tests)
-
 ;;#+allegro
 ;;(jlinker-end)

Modified: trunk/abcl/test/lisp/abcl/math-tests.lisp
==============================================================================
--- trunk/abcl/test/lisp/abcl/math-tests.lisp	(original)
+++ trunk/abcl/test/lisp/abcl/math-tests.lisp	Tue Jan 27 18:29:01 2009
@@ -463,5 +463,3 @@
   #-(or cmu sbcl)
   (signals-error (read-from-string "1.0f-1000") 'reader-error)
   t)
-
-(do-tests)

Modified: trunk/abcl/test/lisp/abcl/misc-tests.lisp
==============================================================================
--- trunk/abcl/test/lisp/abcl/misc-tests.lisp	(original)
+++ trunk/abcl/test/lisp/abcl/misc-tests.lisp	Tue Jan 27 18:29:01 2009
@@ -98,5 +98,3 @@
   (read-from-string "(1 2 #+nil #k(3 4))")
   (1 2)
   19)
-
-(do-tests)

Modified: trunk/abcl/test/lisp/abcl/pathname-tests.lisp
==============================================================================
--- trunk/abcl/test/lisp/abcl/pathname-tests.lisp	(original)
+++ trunk/abcl/test/lisp/abcl/pathname-tests.lisp	Tue Jan 27 18:29:01 2009
@@ -1654,5 +1654,3 @@
            #-windows "/foo"
            #+windows "\\foo")
   t)
-
-(do-tests)

Modified: trunk/abcl/test/lisp/ansi/package.lisp
==============================================================================
--- trunk/abcl/test/lisp/ansi/package.lisp	(original)
+++ trunk/abcl/test/lisp/ansi/package.lisp	Tue Jan 27 18:29:01 2009
@@ -16,21 +16,28 @@
 (defun run (&key (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*)
+  (let* ((original-pathname-defaults *default-pathname-defaults*)
 	(ansi-tests-directory *ansi-tests-directory*)
-	(boot-file (if compile-tests "compileit.lsp" "doit.lsp")))
+	(boot-file (if compile-tests "compileit.lsp" "doit.lsp"))
+	(message (format nil "Invocation of '~A' in ~A"
+			       boot-file ansi-tests-directory)))
     (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)))
+	  (format t "--->  ~A begins.~%" message)
+	  (format t "Invoking ABCL hosted on ~A ~A.~%" 
+		  (software-type) (software-version))
+	  (if (find :unix *features*)
+	      (run-shell-command "cd ~A; make clean" ansi-tests-directory)
+	      ;; XXX -- what to invoke on win32?  Please verify
+	      (run-shell-command 
+	       (format nil ("~A~%~A")
+		       (format nil "cd ~A" *ansi-tests-directory*)
+		       (format nil "erase *.cls *.abcl"))))
+	  (time (load boot-file))
+	  (format t "<--- ~A ends.~%" message))
       (file-error (e)
 		(error 
 		 (format nil




More information about the armedbear-cvs mailing list