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

3
(setf (logical-pathname-translations "ASDF")
4
5
6
7
8
      #+(or allegro clisp)
      `(("**;*.*.*" ,(asdf::wilden *asdf-directory*)))
      #-(or allegro clisp)
      `(("**;*.asd.*" ,(make-pathname :type "asd" :defaults (asdf::wilden *asdf-directory*)))
        ("**;*.lisp.*" ,(make-pathname :type "lisp" :defaults (asdf::wilden *asdf-directory*)))
9
        ("**;*.*.*" ,(resolve-location
10
                      `(,*asdf-directory* "build/fasls" :implementation "logical-host-asdf")
11
                      :wilden t))))
12

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

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
18
     (translate-logical-pathname "ASDF:test;test-logical-pathname.asd")
     (truename "ASDF:test;test-logical-pathname.asd"))
Francois-Rene Rideau's avatar
Francois-Rene Rideau committed
19

20
#+(or gcl xcl) (leave-test "This implementation doesn't do Logical pathnames well enough" 0)
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50

(DBG "Test logical pathnames in central registry")
(setf *central-registry* '(#p"ASDF:test;"))
(initialize-source-registry '(:source-registry :ignore-inherited-configuration))
(DBG "loading" (oos 'load-op :test-logical-pathname :force t))

(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)

#+(or clisp abcl) (leave-test "CLISP and ABCL translate logical pathnames in *LOAD-PATHNAME*" 0)

(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
51
52

(DBG "Done")