test-logical-pathname.script 2.45 KB
Newer Older
1
;;; -*- Lisp -*-
2

3 4 5
(defun wild (&rest keys)
  (apply 'make-pathname :defaults (wilden *asdf-directory*) keys))

6
(setf (logical-pathname-translations "ASDF")
7 8
      `(("**;*.asd.*" ,(wild :type "asd"))
        ("**;*.lisp.*" ,(wild :type "lisp"))
9
        ("**;*.*.*" ,(resolve-location
10
                      `(,*asdf-directory* "build/fasls" :implementation "logical-host-asdf")
11
                      :wilden t))))
12

13
(setf asdf/session:*asdf-session* nil)
14

Francois-Rene Rideau's avatar
Francois-Rene Rideau committed
15 16
(DBG :logical
     (logical-pathname-translations "ASDF")
Francois-Rene Rideau's avatar
Francois-Rene Rideau committed
17
     (translate-logical-pathname "ASDF:test;test-logical-pathname.asd")
18 19 20
     (truename "ASDF:test;test-logical-pathname.asd")
     (translate-logical-pathname "ASDF:test;test-logical-pathname.lisp")
     (translate-logical-pathname "ASDF:test;test-logical-pathname.fasl"))
Francois-Rene Rideau's avatar
Francois-Rene Rideau committed
21

22
#+(or gcl xcl) (leave-test "This implementation doesn't do Logical pathnames well enough" 0)
23 24

(DBG "Test logical pathnames in central registry")
25
(clear-system :test-logical-pathname)
26
(setf *central-registry* '(#p"ASDF:test;"))
27
(assert (logical-pathname-p (first *central-registry*)))
28
(initialize-source-registry '(:source-registry :ignore-inherited-configuration))
29
(DBG "loading" (load-system :test-logical-pathname :force t))
30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49

(DBG "Test logical pathnames in source-registry, non-recursive")
(clear-system :test-logical-pathname)
(setf *central-registry* '())
(initialize-source-registry
 '(:source-registry (:directory #p"ASDF:test;") :ignore-inherited-configuration))
(load-system :test-logical-pathname :force t :verbose t)

(DBG "Test logical pathnames in source-registry, recursive")
(clear-system :test-logical-pathname)
(setf *central-registry* '())
(initialize-source-registry
 ;; Bug: Allegro Express 8.2 and 9.0 incorrectly read #p"ASDF:" as relative.
 ;; other bug: around 2.26.xx (before the nil-pathname cleanup, though),
 ;; CLISP borks badly if the path below is #p"ASDF:"
 ;; and it tries to load ASDF itself from a logical-pathname.
 '(:source-registry (:tree #p"ASDF:test;")
   :ignore-inherited-configuration))
(load-system :test-logical-pathname :force t)

50
#+abcl (leave-test "ABCL translates logical pathnames in *LOAD-PATHNAME*" 0)
51 52 53
#+clisp
(unless (version<= "2.50" (first (split-string (lisp-implementation-version) :separator "-+ ")))
  (leave-test "CLISP 2.49 translates logical pathnames in *LOAD-PATHNAME*" 0))
54 55 56 57

(defparameter sys (find-system :test-logical-pathname))
(assert (logical-pathname-p (component-pathname sys)))
(assert (logical-pathname-p (system-source-file sys)))
Francois-Rene Rideau's avatar
Francois-Rene Rideau committed
58 59

(DBG "Done")