Commit b06641ed authored by Francois-Rene Rideau's avatar Francois-Rene Rideau

Add test for source-file-type override.

parent 3c44e1e0
......@@ -3452,8 +3452,7 @@ you may omit the above @code{type} slot definition and instead define:
"cl")
@end lisp
Then make your system use this subclass in preference to the standard
one:
Then make your system use this subclass in preference to the standard one:
@lisp
(defsystem my-cl-system
......@@ -3463,8 +3462,8 @@ one:
@end lisp
We assume that these definitions are loaded into a package that uses
@code{ASDF}.
@code{ASDF} --- which will be the case by default
if your @file{.asd} file doesn't specify an @code{in-package} statement.
@node TODO list, Inspiration, FAQ, Top
......
......@@ -7,4 +7,4 @@
(in-package :cl-user) ; BAD BAD BAD
(asdf:defsystem test-package
:components ((:module "foo" :components ((:file "bar") (:file "baz")))))
\ No newline at end of file
:components ((:module "foo" :components ((:file "bar") (:file "baz")))))
;; Should work with both ASDF 1 and ASDF 2.
(defclass cl-source-file-1 (cl-source-file)
())
(defmethod source-file-type ((f cl-source-file-1) (m module))
(declare (ignorable f m))
"cl")
(defsystem test-source-file-type-1
:default-component-class cl-source-file-1
:serial t
:components ((:cl-source-file "file1") ; for the package
(:file "test-tmp")))
;; Works only in ASDF 2
(defclass cl-source-file-2 (cl-source-file)
((type :initform "cl")))
(defsystem test-source-file-type-2
:depends-on (:test-source-file-type-1)
:default-component-class cl-source-file-2
:components ((:file "test-tmp")))
;;; -*- Lisp -*-
(load "script-support.lisp")
(load-asdf)
(quit-on-error
(setf asdf:*central-registry* '(*default-pathname-defaults*))
(asdf:load-system 'test-source-file-type-1 :verbose t)
(let ((sym (read-from-string "test-package::*test-tmp-cl*")))
(assert (symbol-value sym))
(set sym nil)
(asdf:load-system 'test-source-file-type-2 :verbose t)
(assert (symbol-value sym))))
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment