Fix a typo.
[sbcl.git] / contrib / sb-introspect / xref-test.lisp
blob6063e4d68105c44b4f0c7de8b8cda5dc346417aa
1 ;;;; This software is part of the SBCL system. See the README file for
2 ;;;; more information.
3 ;;;;
4 ;;;; This software is derived from the CMU CL system, which was
5 ;;;; written at Carnegie Mellon University and released into the
6 ;;;; public domain. The software is in the public domain and is
7 ;;;; provided with absolutely no warranty. See the COPYING and CREDITS
8 ;;;; files for more information.
10 (in-package :sb-introspect-test/xref)
12 (defmacro define-xref-test (name form result)
13 `(deftest ,name
14 (sort (mapcar #'first ,form) #'string< :key #'princ-to-string)
15 ,(sort (copy-list result) #'string< :key #'princ-to-string)))
17 (define-xref-test who-calls.1
18 (who-calls 'foo)
19 nil)
20 (define-xref-test who-calls.2
21 (who-calls 'bar)
22 (xref/1 xref/3))
24 (define-xref-test who-calls.3
25 (who-calls 'xref/1)
26 (xref/2))
28 (define-xref-test who-calls.4
29 (who-calls 'xref/2)
30 (xref/5
31 xref/6
32 xref/8
33 xref/8
34 xref/12
35 (sb-pcl::fast-method xref/10 (t t t t t t t t fixnum))
36 (sb-pcl::fast-method xref/11 (fixnum))))
38 (define-xref-test who-calls.5
39 (who-calls 'xref/3)
40 (inline/1 (sb-pcl::fast-method xref/11 (float))))
42 (define-xref-test who-calls.6
43 (who-calls 'xref/4)
44 nil)
46 (define-xref-test who-calls.7
47 (who-calls 'xref/5)
48 nil)
50 (define-xref-test who-calls.8
51 (who-calls 'xref/6)
52 (xref/7))
54 (define-xref-test who-calls.9
55 (who-calls 'xref/7)
56 nil)
58 (define-xref-test who-calls.10
59 (who-calls 'xref/8)
60 nil)
62 (define-xref-test who-calls.11
63 (who-calls 'xref/10)
64 nil)
65 (define-xref-test who-calls.12
66 (who-calls 'xref/11)
67 nil)
69 (define-xref-test who-calls.13
70 (who-calls 'inline/1)
71 (xref/12))
73 (define-xref-test who-calls.14
74 (who-calls 'xref/12)
75 (macro/1))
77 (define-xref-test who-calls.15
78 (who-calls 'inline/3)
79 (inline/3-user/1
80 inline/3-user/2
81 inline/3-user/3
82 inline/3-user/4))
84 (define-xref-test who-calls.16
85 (who-calls 'inline/4)
86 (inline/4-user))
88 (define-xref-test who-calls.17
89 (who-calls 'called-by-traced-fun)
90 (traced-fun))
93 (define-xref-test who-macroexpands.1
94 (who-macroexpands 'macro/1)
95 (macro-use/1
96 macro-use/2
97 macro-use/3
98 macro-use/4
99 inline/2))
102 (define-xref-test who-binds.1
103 (who-binds '*a*)
104 (xref/2))
107 (define-xref-test who-sets.1
108 (who-sets '*a*)
109 (xref/2 xref/13))
112 (define-xref-test who-references.1
113 (who-references '*a*)
114 (xref/1 xref/2 xref/4 inline/1 xref/14))
116 (define-xref-test who-references.2
117 (who-references '+z+)
118 (inline/1))
121 (define-xref-test who-calls.struct-slot.1
122 (who-calls 'struct-slot)
123 (source-user))
125 (define-xref-test who-calls.cmacro.1
126 (who-calls 'cmacro)
127 (source-user))
130 (define-xref-test who-specializes-directly.1
131 (who-specializes-directly 'a-class)
132 ((method a-gf-1)
133 (method a-gf-2)))
135 (define-xref-test who-specializes-directly.2
136 (who-specializes-directly 'a-structure)
137 ((method a-gf-1)
138 (method a-gf-2)))
140 (define-xref-test who-specializes-generally.1
141 (who-specializes-generally 'a-class)
142 ((method a-gf-1)
143 (method a-gf-2)
144 (method a-gf-3)))
146 (define-xref-test who-specializes-generally.2
147 (who-specializes-generally 'a-structure)
148 ((method a-gf-1)
149 (method a-gf-2)
150 (method a-gf-3)))