From 7fe3c475ae0844c0652edad17c54bdf072047bad Mon Sep 17 00:00:00 2001 From: Juan Jose Garcia Ripoll Date: Wed, 9 May 2012 23:14:40 +0200 Subject: [PATCH] Better locate the ECL files in Mingw when testing --- src/tests/Makefile.in | 2 +- src/tests/config.lsp.in | 43 +++++++++++++++++++++++++++++++---------- 2 files changed, 34 insertions(+), 11 deletions(-) diff --git a/src/tests/Makefile.in b/src/tests/Makefile.in index ed14c087f..0690050c1 100755 --- a/src/tests/Makefile.in +++ b/src/tests/Makefile.in @@ -1,4 +1,4 @@ -ECL=ecl +ECL=ecl@EXEEXT@ all: output.ecl/ansi.log output.ecl/regressions.log diff --git a/src/tests/config.lsp.in b/src/tests/config.lsp.in index 371f90183..184b48922 100755 --- a/src/tests/config.lsp.in +++ b/src/tests/config.lsp.in @@ -14,7 +14,7 @@ (defvar *ecl-sources* (loop for *default-pathname-defaults* in - '(#p"@top_srcdir@/" #p"../../" #p"../../src/") + '(#p"@true_srcdir@/" #p"../../" #p"../../src/") when (probe-file "CHANGELOG") return *default-pathname-defaults*)) @@ -83,6 +83,19 @@ (defvar *cleanup-extensions* '("fasl" "fasb" "c" "h" "obj" "o" "a" "lib" "dll" "dylib" "data")) +(defun lisp-system-directory () + (loop with root = (si::get-library-pathname) + with lib-name = (format nil "../lib/ecl-~A/" (lisp-implementation-version)) + for base in (list root (merge-pathnames lib-name root)) + for p = (merge-pathnames "./LGPL" base) + when (probe-file p) + do (return base))) + +(setf (logical-pathname-translations "SYS") + (list (list #p"sys:**;*.*" + (merge-pathnames "**/*.*" + (lisp-system-directory))))) + (require :cmp) (require :ecl-curl) (require :deflate) @@ -223,15 +236,25 @@ (delete-everything (merge-pathnames "scratch/" *ansi-tests-sandbox*)) ;; Run with given image (ensure-directories-exist output) - (unwind-protect - (progn - (ext:chdir *ansi-tests-sandbox*) - (ext:run-program *test-image* - *test-image-args* - :input (merge-pathnames "doit.lsp" *ansi-tests-sandbox*) - :output output - :error :output)) - (ext:chdir *here*))) + (let* ((input (merge-pathnames "doit.lsp" *ansi-tests-sandbox*)) + (tmp (merge-pathnames "ecl-tmp-doit.lsp" *ansi-tests-sandbox*))) + (with-open-file (s tmp :direction :output + :if-exists :supersede + :if-does-not-exist :create) + (format s "(require :cmp)(pprint (ext:getcwd))(load ~S)#+ecl(quit)" + (namestring input))) + (unwind-protect + (progn + (ext:chdir *ansi-tests-sandbox*) + (ext:run-program *test-image* + *test-image-args* + :input tmp + :output output + :error :output + :wait t)) + (when (probe-file tmp) + (delete-file tmp)) + (ext:chdir *here*)))) (defun run-regressions-tests (&optional (output (merge-pathnames "regressions.log" *output-directory*)))