test-inline-methods.script 828 Bytes
Newer Older
1 2 3
;;; -*- Lisp -*-

(defparameter *a* 0)
4 5 6

(def-test-system :foo
  :components
7 8 9
  ((:file "file1"
    :perform (load-op :before (o c)
                      (incf *a*)
10
                      (format t "Method run before ~A - *a* = ~S~%~%" (action-description o c) *a*)))
11 12 13
   (:file "file2" :depends-on ("file1")
    :perform (load-op (o c)
                      (incf *a*)
14
                      (format t "Method run for ~A - *a* = ~S~%" (action-description o c) *a*)
15
                      (call-next-method)))))
16

17 18 19
;;; Note: not calling load-system, because on ECL that could end up being a load-fasl-op,
;;; and at most the file1 load-op happen, whereas the file2 .o is linked and never loaded
;;; (the linked fasl, on the other hand, will be loaded, but won't trigger the inline method).
20
(operate 'load-op :foo)
21

22
(assert-equal *a* 2)