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

Add test for source-file-type override.

parent 3c44e1e0
Loading
Loading
Loading
Loading
+3 −4
Original line number Diff line number Diff line
@@ -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
+13 −0
Original line number Diff line number Diff line
;; 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")))
+8 −0
Original line number Diff line number Diff line
;; 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")))
+12 −0
Original line number Diff line number Diff line
;;; -*- 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))))
+1 −1

File changed.

Contains only whitespace changes.