From 20beba34f535c2965af524ebe160db6c74ebb522 Mon Sep 17 00:00:00 2001
From: Francois-Rene Rideau <tunes@google.com>
Date: Tue, 8 Jan 2013 08:19:34 -0500
Subject: [PATCH] Fix test-encodings.script.

Add its forgotten source file test/lambda.lisp. Oops.
Skip one of its tests that mysteriously breaks on ECL_bytecodes.
---
 test/lambda.lisp           |  3 +++
 test/script-support.lisp   |  3 ++-
 test/test-encodings.script | 18 ++++++++++--------
 3 files changed, 15 insertions(+), 9 deletions(-)
 create mode 100644 test/lambda.lisp

diff --git a/test/lambda.lisp b/test/lambda.lisp
new file mode 100644
index 00000000..8e1ee1ea
--- /dev/null
+++ b/test/lambda.lisp
@@ -0,0 +1,3 @@
+;; -*- coding: latin-2 -*-
+(in-package :asdf-test)
+(setf *lambda-string* "λ")
diff --git a/test/script-support.lisp b/test/script-support.lisp
index 419a2e32..42b01326 100644
--- a/test/script-support.lisp
+++ b/test/script-support.lisp
@@ -16,7 +16,8 @@
 (declaim (optimize (speed 2) (safety 3) #-(or allegro gcl) (debug 3)))
 (proclaim '(optimize (speed 2) (safety 3) #-(or allegro gcl) (debug 3)))
 
-;;(format t "Evaluating asdf/test/script-support~%")
+;; NB: can't print anything because of forward-ref test.
+;; (DBG "Evaluating asdf/test/script-support") 
 
 ;; We can't use asdf::merge-pathnames* because ASDF isn't loaded yet.
 ;; We still want to work despite and host/device funkiness.
diff --git a/test/test-encodings.script b/test/test-encodings.script
index 02e6939b..cd975c10 100644
--- a/test/test-encodings.script
+++ b/test/test-encodings.script
@@ -21,20 +21,21 @@
                #+sbcl sb-impl::*default-external-format*
                #-(or clozure sbcl) (error "can't determine default external-format")))))
 
-(defun reset-lambda ()
-  (setf *lambda-string* nil)
-  (asdf::delete-file-if-exists (asdf::compile-file-pathname* "lambda.lisp")))
-
 (defmacro with-test ((encoding &key (op 'asdf:load-source-op) (path "lambda")) defsystem &body body)
   (let ((sys (second defsystem)))
     `(progn
        (format t "~&Test ~A: should be ~A~%" ',sys ',encoding)
-       (reset-lambda)
+       (setf *lambda-string* nil)
        ,defsystem
-       (assert-equal (asdf:component-encoding (asdf:find-component ',sys ',path)) ',encoding)
-       ,@(when op `((asdf:operate ',op ',(second defsystem))))
+       (let ((c (asdf:find-component ',sys ',path)))
+         (assert-equal (asdf:component-encoding c) ',encoding)
+         (loop :for o :in (asdf:output-files (asdf::make-operation 'asdf:compile-op) c)
+               :do (asdf::delete-file-if-exists o)))
+       ,@(when op
+           `((asdf:operate ',op ',(second defsystem))))
        ,@body
-       (eval `(assert-equal (string-char-codes ,*lambda-string*) (expected-char-codes ',',encoding))))))
+       (eval `(assert-equal (string-char-codes ,*lambda-string*)
+                            (expected-char-codes ',',encoding))))))
 
 (quit-on-error
 
@@ -87,6 +88,7 @@
     (defsystem :test-system-encoding-l1
       :encoding :latin-1
       :components ((:file "lambda"))))
+  #-ecl-bytecmp
   (with-test (:latin-1 :op asdf:load-op)
     (defsystem :test-system-encoding-l1-load-op
       :encoding :latin-1
-- 
GitLab