From f16e4b787e7708882e0201526629faaf5eea7215 Mon Sep 17 00:00:00 2001 From: "Robert P. Goldman" Date: Mon, 9 May 2022 09:35:14 -0500 Subject: [PATCH 01/12] Modify tests for ABCL 1.9 release. Update for tests that can now be expected to pass instead of failing. --- test/test-bundle.script | 4 ++++ test/test-run-program-unix.script | 23 ++++++++++++++++------- 2 files changed, 20 insertions(+), 7 deletions(-) diff --git a/test/test-bundle.script b/test/test-bundle.script index 8111f48f..8086b1dc 100644 --- a/test/test-bundle.script +++ b/test/test-bundle.script @@ -13,6 +13,10 @@ #+(and os-macosx ecl) (leave-test "Bundle test doesn't work on Mac on this lisp." 0) +;;; FIXME: Do we really need to keep the following two around? +;;; Now that we are almost at 1.9, I'd like to remove this as noise. +;;; [2022/05/09:rpg] + #+abcl (when (and (member :abcl *features*) (os-macosx-p) diff --git a/test/test-run-program-unix.script b/test/test-run-program-unix.script index 953373aa..d5f14685 100644 --- a/test/test-run-program-unix.script +++ b/test/test-run-program-unix.script @@ -3,6 +3,7 @@ (chdir *test-directory*) +;;; FIXME: Another check for very old ABCL version. #+abcl (unless (version-satisfies (second (split-string (implementation-identifier) :separator '(#\-))) @@ -215,6 +216,10 @@ :implemented)) (error 'unexpected-test-success :test-designator ,test-designator)))) +#+abcl +(when (asdf:version-satisfies (lisp-implementation-version) "1.8") + (push :old-abcl *features*)) + ;;; The actual tests @@ -242,16 +247,20 @@ (define-test "launch-program :output t" - (expected-unimplemented ((:lispworks :abcl) :test-designator "launch-program :output t") - (launch-program (list "echo" "echoing output") - :output t))) + (expected-unimplemented ((:lispworks :old-abcl) :test-designator "launch-program :output t") + (progn + (launch-program (list "echo" "echoing output") + :output t) + t))) (define-test "launch-program :error-output t" - (expected-unimplemented ((:lispworks :abcl) :test-designator "launch-program :error-output t") - (uiop:wait-process - (launch-program (format nil "./exiter.sh 0 ~a" output-string) - :error-output t)))) + (expected-unimplemented ((:lispworks :old-abcl) :test-designator "launch-program :error-output t") + (progn + (uiop:wait-process + (launch-program (format nil "./exiter.sh 0 ~a" output-string) + :error-output t)) + t))) (define-test ":output (file e.)" -- GitLab From bbc532dabbb4b6a9c0b2a29903bd76a31a29a717 Mon Sep 17 00:00:00 2001 From: "Robert P. Goldman" Date: Wed, 11 May 2022 09:00:35 -0500 Subject: [PATCH 02/12] Update to reflect ABCL unicode support. --- uiop/common-lisp.lisp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/uiop/common-lisp.lisp b/uiop/common-lisp.lisp index 86f4d7e4..c76cb472 100644 --- a/uiop/common-lisp.lisp +++ b/uiop/common-lisp.lisp @@ -29,12 +29,13 @@ ;;;; Early meta-level tweaks -#+(or allegro clasp clisp clozure cmucl ecl lispworks mezzano mkcl sbcl) +#+(or allegro clasp clisp clozure cmucl ecl lispworks mezzano mkcl sbcl abcl) (eval-when (:load-toplevel :compile-toplevel :execute) (when (and #+allegro (member :ics *features*) #+(or clasp clisp cmucl ecl lispworks mkcl) (member :unicode *features*) #+clozure (member :openmcl-unicode-strings *features*) - #+sbcl (member :sb-unicode *features*)) + #+sbcl (member :sb-unicode *features*) + #+abcl t) ;; Check for unicode at runtime, so that a hypothetical FASL compiled with unicode ;; but loaded in a non-unicode setting (e.g. on Allegro) won't tell a lie. (pushnew :asdf-unicode *features*))) -- GitLab From 024f1e0a9621b062b585320253534880d604c6df Mon Sep 17 00:00:00 2001 From: "Robert P. Goldman" Date: Wed, 11 May 2022 10:40:24 -0500 Subject: [PATCH 03/12] Fix WITH-EXPECTED-FAILURE in test-encodings. --- test/test-encodings.script | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/test/test-encodings.script b/test/test-encodings.script index 04f39ee4..fc05a7d7 100644 --- a/test/test-encodings.script +++ b/test/test-encodings.script @@ -6,6 +6,8 @@ (defparameter *lambda-string* nil) +(DBG "ASDF-UNICODE = " (member :asdf-unicode *features*)) + (defun string-char-codes (s) (loop :for c :across s :collect (char-code c))) @@ -117,8 +119,7 @@ (def-test-system :test-system-encoding-l1 :encoding :latin-1 :components ((:file "lambda")))) -#-ecl-bytecmp -(with-expected-failure () +(with-expected-failure (:ecl-bytecmp) (with-encoding-test (:latin-1 :op load-op) (def-test-system :test-system-encoding-l1-load-op :encoding :latin-1 -- GitLab From 6f00586926666c24f13cda6e7efbb99a4019e52c Mon Sep 17 00:00:00 2001 From: "Robert P. Goldman" Date: Thu, 12 May 2022 17:10:38 -0500 Subject: [PATCH 04/12] Fix WITH-EXPECTED-FAILURE. --- test/test-encodings.script | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/test/test-encodings.script b/test/test-encodings.script index fc05a7d7..db3421c3 100644 --- a/test/test-encodings.script +++ b/test/test-encodings.script @@ -6,8 +6,6 @@ (defparameter *lambda-string* nil) -(DBG "ASDF-UNICODE = " (member :asdf-unicode *features*)) - (defun string-char-codes (s) (loop :for c :across s :collect (char-code c))) @@ -119,7 +117,7 @@ (def-test-system :test-system-encoding-l1 :encoding :latin-1 :components ((:file "lambda")))) -(with-expected-failure (:ecl-bytecmp) +(with-expected-failure ((and (featurep :ecl-bytecmp) :ecl-bytecmp)) (with-encoding-test (:latin-1 :op load-op) (def-test-system :test-system-encoding-l1-load-op :encoding :latin-1 -- GitLab From 0fc2cdc01b8482b520ae5bd9970346e997c85964 Mon Sep 17 00:00:00 2001 From: "Robert P. Goldman" Date: Thu, 12 May 2022 22:07:20 -0500 Subject: [PATCH 05/12] Add temporary new test file. This pulls out the test that is failing on ABCL into its own file where ... it does not fail. --- test/single-test-encodings.script | 72 +++++++++++++++++++++++++++++++ 1 file changed, 72 insertions(+) create mode 100644 test/single-test-encodings.script diff --git a/test/single-test-encodings.script b/test/single-test-encodings.script new file mode 100644 index 00000000..0550cb1e --- /dev/null +++ b/test/single-test-encodings.script @@ -0,0 +1,72 @@ +;;; -*- Lisp -*- +(in-package :asdf-test) + +(when (member :clisp *features*) + (quit 0)) + +(defparameter *lambda-string* nil) + +(defun string-char-codes (s) + (loop :for c :across s :collect (char-code c))) + +(defun expected-char-codes (x) + #-asdf-unicode '(#xCE #xBB) + #+asdf-unicode + (ecase x + (:utf-8 '(955)) + ((:latin1 :latin-1) '(206 187)) + ((:latin2 :latin-2) '(206 357)) + ((:latin3 :latin-3) '(206 287)) + (:koi8-r '(1085 9577)) + (:default (expected-char-codes + #+clozure ccl:*default-external-format* + #+sbcl sb-impl::*default-external-format* + #-(or clozure sbcl) (error "can't determine default external-format"))))) + +(defmacro with-encoding-test ((encoding &key (op 'load-source-op) (path "lambda")) def-test-system &body body) + (let ((sys (second def-test-system))) + `(with-asdf-session (:override t) + (format t "~&Test ~A: should be ~A~%" ',sys ',encoding) + (setf *lambda-string* nil) + ,def-test-system + (let ((c (find-component ',sys ',path))) + ;; mlisp has an issue of :LATIN-2 vs :latin-2. Smooth things with string-equal. + (assert-compare (string-equal (component-encoding c) ',encoding)) + (loop :for o :in (output-files 'compile-op c) + :do (delete-file-if-exists o))) + ,@(when op + `((operate ',op ',(second def-test-system) :force t))) + ,@body + (eval `(assert-equal (string-char-codes ,*lambda-string*) + (expected-char-codes ',',encoding)))))) + +#-asdf-unicode +(leave-test "No Unicode support to test on this lisp implementation" 0) + +#+abcl +(let* ((version (lisp-implementation-version)) + (version-nums (subseq version 0 (position-if-not (lambda (x) (find x "0123456789.")) version)))) + (when (version< version-nums "1.1.2") + (leave-test "Your old ABCL is known to fail this test script, so skipping it." 0))) + +;; Try to load asdf-encodings +(setf *central-registry* + (list *asdf-directory* ;; be sure that *OUR* asdf is first of any possible ASDF + *uiop-directory* ;; be sure that ouir uiop is there, too. + ;; try finding asdf-encodings it right next to asdf. + (subpathname *asdf-directory* "ext/asdf-encodings/"))) +(unless (find-system :asdf-encodings nil) + ;; try harder by enabling the user's source-registry + (initialize-source-registry "")) +(unless (find-system :asdf-encodings nil) + (leave-test "Couldn't find ASDF-ENCODINGS. Skipping the rest the test." 0)) + +(load-system "asdf-encodings") + +;; Disable any user source registry. +(initialize-source-registry `(:source-registry :ignore-inherited-configuration)) +(with-expected-failure ((and (featurep :ecl-bytecmp) :ecl-bytecmp)) + (with-encoding-test (:latin-1 :op load-op) + (def-test-system :test-system-encoding-l1-load-op + :encoding :latin-1 + :components ((:file "lambda"))))) -- GitLab From 7d40db68ee12cf20b7b7c012cb09ad7ec79cd197 Mon Sep 17 00:00:00 2001 From: Robert Goldman Date: Wed, 27 Jul 2022 16:20:53 +0000 Subject: [PATCH 06/12] Restore test-bundle on ABCL. --- test/test-bundle.script | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/test/test-bundle.script b/test/test-bundle.script index 8086b1dc..1442acb0 100644 --- a/test/test-bundle.script +++ b/test/test-bundle.script @@ -13,17 +13,6 @@ #+(and os-macosx ecl) (leave-test "Bundle test doesn't work on Mac on this lisp." 0) -;;; FIXME: Do we really need to keep the following two around? -;;; Now that we are almost at 1.9, I'd like to remove this as noise. -;;; [2022/05/09:rpg] - -#+abcl -(when (and (member :abcl *features*) - (os-macosx-p) - ;; bundles don't work on pre-1.3.0 - (second (third (sys::arglist 'directory)))) - (leave-test "Bundle test doesn't work on Mac on this version of ABCL." 0)) - #+(or (and ecl ecl-bytecmp) gcl) (leave-test "bundles not on this implementation" 0) -- GitLab From e3b9a68f14060153d5ea852c6d188b0927a8eddf Mon Sep 17 00:00:00 2001 From: "Robert P. Goldman" Date: Thu, 28 Jul 2022 16:33:47 -0500 Subject: [PATCH 07/12] Attempt to fix test-encodings on older ABCL. It appears that possibly the load-op might be loading a version of the test file (lambda.lisp) that was compiled earlier, with a different setting of the encoding. --- test/test-encodings.script | 1 + 1 file changed, 1 insertion(+) diff --git a/test/test-encodings.script b/test/test-encodings.script index db3421c3..fb8cd472 100644 --- a/test/test-encodings.script +++ b/test/test-encodings.script @@ -117,6 +117,7 @@ (def-test-system :test-system-encoding-l1 :encoding :latin-1 :components ((:file "lambda")))) +(delete-file-if-exists (first (output-files (make-operation 'compile-op) (find-component (find-system "test-system-encoding-l1") "lambda")))) (with-expected-failure ((and (featurep :ecl-bytecmp) :ecl-bytecmp)) (with-encoding-test (:latin-1 :op load-op) (def-test-system :test-system-encoding-l1-load-op -- GitLab From dd4453d0a24dcbbdaee8d405174ae8f3e894b5ae Mon Sep 17 00:00:00 2001 From: "Robert P. Goldman" Date: Mon, 1 Aug 2022 11:32:01 -0500 Subject: [PATCH 08/12] Avoid expected ABCL failures. --- test/test-encodings.script | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/test/test-encodings.script b/test/test-encodings.script index fb8cd472..5e2fa137 100644 --- a/test/test-encodings.script +++ b/test/test-encodings.script @@ -117,8 +117,19 @@ (def-test-system :test-system-encoding-l1 :encoding :latin-1 :components ((:file "lambda")))) -(delete-file-if-exists (first (output-files (make-operation 'compile-op) (find-component (find-system "test-system-encoding-l1") "lambda")))) -(with-expected-failure ((and (featurep :ecl-bytecmp) :ecl-bytecmp)) +(let ((file (first (output-files (make-operation 'compile-op) (find-component (find-system "test-system-encoding-l1") "lambda"))))) + (DBG (format nil "Checking for previously-compiled file ~a.~a" (pathname-name file) (pathname-type file))) + (if (file-exists-p file) + (progn + (delete-file file) + (DBG "Deleted file.") + (assert (not (file-exists-p file)))) + (DBG "No such file."))) +(defun permissive-parse-version (string) + (uiop:parse-version (subseq string 0 (position #\- string)) #'error)) +(with-expected-failure ((or (and (featurep :ecl-bytecmp) :ecl-bytecmp) + (and (featurep :abcl) + (uiop:version< (permissive-parse-version (uiop:lisp-version-string)) "1.9")))) (with-encoding-test (:latin-1 :op load-op) (def-test-system :test-system-encoding-l1-load-op :encoding :latin-1 -- GitLab From 024ea68071f7628ce56f923941f233af0db0ed52 Mon Sep 17 00:00:00 2001 From: "Robert P. Goldman" Date: Mon, 1 Aug 2022 13:09:15 -0500 Subject: [PATCH 09/12] Fix ASDF version check. --- test/test-encodings.script | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/test/test-encodings.script b/test/test-encodings.script index 5e2fa137..f0050d34 100644 --- a/test/test-encodings.script +++ b/test/test-encodings.script @@ -127,9 +127,11 @@ (DBG "No such file."))) (defun permissive-parse-version (string) (uiop:parse-version (subseq string 0 (position #\- string)) #'error)) -(with-expected-failure ((or (and (featurep :ecl-bytecmp) :ecl-bytecmp) - (and (featurep :abcl) - (uiop:version< (permissive-parse-version (uiop:lisp-version-string)) "1.9")))) +(with-expected-failure ((or (and (featurep :ecl-bytecmp) :ecl-bytecmp "ECL Byte compiler does not handle LATIN-1") + (and (featurep :abcl) + (equalp (subseq (permissive-parse-version (uiop:lisp-version-string)) 0 2) + '(1 8)) + "ABCL version 1.8 does not properly handle latin-1 in the compiler"))) (with-encoding-test (:latin-1 :op load-op) (def-test-system :test-system-encoding-l1-load-op :encoding :latin-1 -- GitLab From 3fee7eea2dd6763405f172aa5301496f06c145f6 Mon Sep 17 00:00:00 2001 From: "Robert P. Goldman" Date: Mon, 1 Aug 2022 20:15:59 -0500 Subject: [PATCH 10/12] Remove debugging file. --- test/single-test-encodings.script | 72 ------------------------------- 1 file changed, 72 deletions(-) delete mode 100644 test/single-test-encodings.script diff --git a/test/single-test-encodings.script b/test/single-test-encodings.script deleted file mode 100644 index 0550cb1e..00000000 --- a/test/single-test-encodings.script +++ /dev/null @@ -1,72 +0,0 @@ -;;; -*- Lisp -*- -(in-package :asdf-test) - -(when (member :clisp *features*) - (quit 0)) - -(defparameter *lambda-string* nil) - -(defun string-char-codes (s) - (loop :for c :across s :collect (char-code c))) - -(defun expected-char-codes (x) - #-asdf-unicode '(#xCE #xBB) - #+asdf-unicode - (ecase x - (:utf-8 '(955)) - ((:latin1 :latin-1) '(206 187)) - ((:latin2 :latin-2) '(206 357)) - ((:latin3 :latin-3) '(206 287)) - (:koi8-r '(1085 9577)) - (:default (expected-char-codes - #+clozure ccl:*default-external-format* - #+sbcl sb-impl::*default-external-format* - #-(or clozure sbcl) (error "can't determine default external-format"))))) - -(defmacro with-encoding-test ((encoding &key (op 'load-source-op) (path "lambda")) def-test-system &body body) - (let ((sys (second def-test-system))) - `(with-asdf-session (:override t) - (format t "~&Test ~A: should be ~A~%" ',sys ',encoding) - (setf *lambda-string* nil) - ,def-test-system - (let ((c (find-component ',sys ',path))) - ;; mlisp has an issue of :LATIN-2 vs :latin-2. Smooth things with string-equal. - (assert-compare (string-equal (component-encoding c) ',encoding)) - (loop :for o :in (output-files 'compile-op c) - :do (delete-file-if-exists o))) - ,@(when op - `((operate ',op ',(second def-test-system) :force t))) - ,@body - (eval `(assert-equal (string-char-codes ,*lambda-string*) - (expected-char-codes ',',encoding)))))) - -#-asdf-unicode -(leave-test "No Unicode support to test on this lisp implementation" 0) - -#+abcl -(let* ((version (lisp-implementation-version)) - (version-nums (subseq version 0 (position-if-not (lambda (x) (find x "0123456789.")) version)))) - (when (version< version-nums "1.1.2") - (leave-test "Your old ABCL is known to fail this test script, so skipping it." 0))) - -;; Try to load asdf-encodings -(setf *central-registry* - (list *asdf-directory* ;; be sure that *OUR* asdf is first of any possible ASDF - *uiop-directory* ;; be sure that ouir uiop is there, too. - ;; try finding asdf-encodings it right next to asdf. - (subpathname *asdf-directory* "ext/asdf-encodings/"))) -(unless (find-system :asdf-encodings nil) - ;; try harder by enabling the user's source-registry - (initialize-source-registry "")) -(unless (find-system :asdf-encodings nil) - (leave-test "Couldn't find ASDF-ENCODINGS. Skipping the rest the test." 0)) - -(load-system "asdf-encodings") - -;; Disable any user source registry. -(initialize-source-registry `(:source-registry :ignore-inherited-configuration)) -(with-expected-failure ((and (featurep :ecl-bytecmp) :ecl-bytecmp)) - (with-encoding-test (:latin-1 :op load-op) - (def-test-system :test-system-encoding-l1-load-op - :encoding :latin-1 - :components ((:file "lambda"))))) -- GitLab From 09fc642cf295098a0ee7696c19fd14f87bf3bf75 Mon Sep 17 00:00:00 2001 From: "Robert P. Goldman" Date: Mon, 1 Aug 2022 20:22:55 -0500 Subject: [PATCH 11/12] Remove check for very old ABCLs. --- test/test-run-program-unix.script | 8 -------- 1 file changed, 8 deletions(-) diff --git a/test/test-run-program-unix.script b/test/test-run-program-unix.script index d5f14685..b3281caf 100644 --- a/test/test-run-program-unix.script +++ b/test/test-run-program-unix.script @@ -3,14 +3,6 @@ (chdir *test-directory*) -;;; FIXME: Another check for very old ABCL version. -#+abcl -(unless (version-satisfies - (second (split-string (implementation-identifier) :separator '(#\-))) - "1.4") - (leave-test - "This test is not meant to be run on versions of ABCL that predate 1.4" 0)) - #+clasp (unless (find-symbol* '#:run-program :ext nil) (leave-test "This clasp does not have a run-program function" 0)) -- GitLab From 7853536504df75db350aebba2e2f022df9095db4 Mon Sep 17 00:00:00 2001 From: "Robert P. Goldman" Date: Mon, 1 Aug 2022 20:46:43 -0500 Subject: [PATCH 12/12] Fix ABCL version check. --- test/test-run-program-unix.script | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/test/test-run-program-unix.script b/test/test-run-program-unix.script index b3281caf..0b327e29 100644 --- a/test/test-run-program-unix.script +++ b/test/test-run-program-unix.script @@ -209,8 +209,11 @@ (error 'unexpected-test-success :test-designator ,test-designator)))) #+abcl -(when (asdf:version-satisfies (lisp-implementation-version) "1.8") - (push :old-abcl *features*)) +(let* ((raw-version (uiop:lisp-version-string)) + (version + (subseq raw-version 0 (position #\- raw-version)))) + (when (not (asdf:version-satisfies version "1.8")) + (push :old-abcl *features*))) ;;; The actual tests -- GitLab