source: trunk/abcl/test/lisp/abcl/load.lisp @ 12141

Last change on this file since 12141 was 12141, checked in by Mark Evenson, 12 years ago

Added support for loading Lisp from JAR files.

Pathnames passed to LOAD may now specify loading from within JAR files
by using the 'jar:file:' uri schema:

(load "jar:file:///PATH/TO.jar!/foo")

would attempt to load Lisp "associated" with 'foo' in a JAR file
located '/PATH/TO.jar'. "Associated with" means that the the
following entries in the JAR are looked for:

1) 'foo._' (the initial FASL from compiling 'foo.lisp)
2) 'foo.abcl' (the packed FASL)
3) 'foo.lisp'

Associated tests have been included but currently only work under UNIX
due to the need to package up the FASLs for testing.

File size: 1.4 KB
Line 
1(in-package #:abcl.test.lisp)
2
3#-:unix (error "Load test setup currently needs UNIX shell script support.")
4
5(defun load-init ()
6  (let* ((*default-pathname-defaults* *this-directory*)
7         (asdf::*verbose-out* *standard-output*)
8         (package-command (format nil "sh ~A" (merge-pathnames "package-load.sh"))))
9    (compile-file "foo.lisp")
10    (compile-file "bar.lisp")
11    (compile-file "eek.lisp")
12    (asdf:run-shell-command package-command)))
13
14(load-init)
15
16(deftest load.1
17    (let ((*default-pathname-defaults* *this-directory*))
18      (load "foo"))
19  t)
20
21(deftest load.2
22    (let ((*default-pathname-defaults* *this-directory*))
23      (load "foo.lisp"))
24  t)
25
26(deftest load.3
27    (let ((*default-pathname-defaults* *this-directory*))
28      (load "foo.abcl"))
29  t)
30
31(deftest load.4
32    (let ((*default-pathname-defaults* *this-directory*))
33      (load "jar:file:baz.jar!/foo"))
34  t)
35
36(deftest load.6
37    (let ((*default-pathname-defaults* *this-directory*))
38      (load "jar:file:baz.jar!/bar"))
39  t)
40
41(deftest load.7
42    (let ((*default-pathname-defaults* *this-directory*))
43      (load "jar:file:baz.jar!/bar.abcl"))
44  t)
45
46(deftest load.8
47    (let ((*default-pathname-defaults* *this-directory*))
48      (load "jar:file:baz.jar!/eek"))
49  t)
50
51(deftest load.9
52    (let ((*default-pathname-defaults* *this-directory*))
53      (load "jar:file:baz.jar!/eek.lisp"))
54  t)
55
56
57
58
59
60 
Note: See TracBrowser for help on using the repository browser.