test-module-pathnames.script 2.32 KB
Newer Older
1
;;; -*- Lisp -*-
2
(load "script-support.lisp")
3
(load-asdf)
4

5
(quit-on-error
6
 (setf asdf:*central-registry* '(*default-pathname-defaults*))
7
 (trace asdf:perform)
8
9
10
11
12
13
14
15
16
17
 (asdf:load-system 'test-module-pathnames)
 (flet ((submodule (module name)
          (find name (asdf:module-components module)
                :key #'asdf:component-name :test #'equal))
        (pathname-foo (x)
          (list (pathname-directory x) (pathname-name x) (pathname-type x))))
   (let* ((system (asdf:find-system "test-module-pathnames"))
          (level1 (submodule system "sources/level1"))
          (static (submodule level1 "level2/static.file"))
          (test-tmp (submodule level1 "test-tmp.cl")))
18
19
20
     (assert (member (pathname-foo (asdf:component-relative-pathname test-tmp))
                     '(((:relative) "test-tmp" "cl")
                       (nil "test-tmp" "cl")) :test 'equal)
21
             () "Didn't get the name of test-tmp.cl right")
22
23
24
     (assert (equal
              (pathname-foo (asdf:component-relative-pathname static))
              '((:relative "level2") "static" "file"))
25
26
27
28
29
             () "Didn't get the name of static.file right")))
 (assert (find-package :test-package)
         () "package test-package not found")
 (assert (find-symbol (symbol-name '*file-tmp*) :test-package)
         () "symbol `*file-tmp*` not found")
30
 (assert (symbol-value (find-symbol (symbol-name '*file-tmp*) :test-package))
31
         () "symbol `*file-tmp*` has wrong value")
32
33

#| ; must be adapted to ABL
34
35
 (assert (probe-file (merge-pathnames
                      (make-pathname
36
37
38
39
                       :name "file1"
                       :type (pathname-type (compile-file-pathname "x"))
                       :directory '(:relative "sources" "level1"))))
         nil "compiled file not found")
40
|#
41
42

 (assert (find-symbol (symbol-name '*file-tmp2*) :test-package) nil
43
         "symbol `*file-tmp2*` not found")
44
 (assert (symbol-value (find-symbol (symbol-name '*file-tmp2*) :test-package))
45
         nil "symbol `*file-tmp2*` has wrong value")
46
47
48

#| ; must be adapted to ABL

49
50
 (assert (probe-file (merge-pathnames
                      (make-pathname
51
52
53
54
                       :name "file2"
                       :type (pathname-type (compile-file-pathname "x"))
                       :directory '(:relative "sources" "level1" "level2"))))
         nil "compiled file not found")
55
56
57
|#

)