3 ;;;; This software is part of the SBCL system. See the README file for
6 ;;;; This software is derived from the CMU CL system, which was
7 ;;;; written at Carnegie Mellon University and released into the
8 ;;;; public domain. The software is in the public domain and is
9 ;;;; provided with absolutely no warranty. See the COPYING and CREDITS
10 ;;;; files for more information.
12 (defpackage #:sb-introspect-system (:use :cl :asdf :uiop))
13 (in-package #:sb-introspect-system)
15 (defsystem :sb-introspect
16 :components ((:file "introspect"))
17 #+sb-building-contrib :pathname
18 #+sb-building-contrib #p"SYS:CONTRIB;SB-INTROSPECT;"
19 :perform (load-op :after (o c) (provide 'sb-introspect))
20 :perform (test-op (o c) (test-system :sb-introspect/tests)))
22 (defclass plist-file (cl-source-file)
25 :initarg :source-plist
26 :reader plist-file-source-plist)))
28 (defmethod perform ((op compile-op) (com plist-file))
29 (with-compilation-unit (:source-plist (plist-file-source-plist com))
32 (defmethod perform ((op load-op) (com plist-file))
33 (with-compilation-unit (:source-plist (plist-file-source-plist com))
36 (defclass source-only-file (cl-source-file)
39 (defmethod perform ((op compile-op) (com source-only-file)))
40 (defmethod perform ((op load-op) (com source-only-file)))
41 (defmethod output-files ((op compile-op) (com source-only-file))
43 (defmethod component-depends-on ((op load-op) (com source-only-file))
44 `((load-source-op ,com) ,@(call-next-method)))
46 (defsystem :sb-introspect/tests
47 :depends-on (:sb-introspect :sb-rt)
48 #+sb-building-contrib :pathname
49 #+sb-building-contrib #p"SYS:CONTRIB;SB-INTROSPECT;"
50 :components ((:file "xref-test-data")
51 (:file "xref-test" :depends-on ("xref-test-data"))
52 (:plist-file "test" :source-plist (:test-outer "OUT") :operation-done-p (compile-op (o c) nil))
53 (:source-only-file "load-test")
54 (:file "test-driver" :depends-on ("test" "load-test")))
57 ;; N.b. At least DEFINITION-SOURCE-PLIST.1 assumes that CWD is the
58 ;; contrib/sb-introspect directory which is true for when this is
59 ;; implicitly run via make-target-contribs.sh -- but not when this
60 ;; is executed manually.
61 (let ((*default-pathname-defaults* (translate-logical-pathname (system-source-directory c))))
62 (multiple-value-bind (soft strict pending) (symbol-call :sb-rt :do-tests)
63 (declare (ignorable pending))
67 ;; We create TEST-PASSED from a shell script if tests passed. But
68 ;; since the shell script only `touch'es it, we can actually create
69 ;; it ahead of time -- as long as we're certain that tests truly
70 ;; passed, hence the check for SOFT.
72 (with-open-file (s #p"SYS:CONTRIB;SB-INTROSPECT;TEST-PASSED"
74 (dolist (pend pending)
75 (format s "Expected failure: ~A~%" pend))))
76 (warn "ignoring expected failures in test-op"))
78 (error "test-op failed with unexpected failures"))))))