/
packages.lisp
191 lines (171 loc) · 5.13 KB
/
packages.lisp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
(in-package #:common-lisp-user)
(eval-when (:compile-toplevel :load-toplevel :execute)
(unless (find-package '#:lift)
(defpackage #:lift
(:use #:common-lisp #:com.metabang.trivial-timeout)
(:import-from
#+allegro #:mop
#+clisp #:clos
#+lispworks #:clos
#+(or mcl ccl) #:ccl
#+cmu #:clos-mop
#+sbcl #:sb-mop
#+scl #:clos
#:class-direct-subclasses
#:class-direct-superclasses
#:class-precedence-list)
(:export
#:generate-log-entry
#:testsuite-log-data
#:*log-tag*
#:*log-path*
#:*log-detail-hooks*
#:*log-header-hooks*
#:*log-footer-hooks*
#:report-hooks-for
#:add-report-hook-for
#:with-profile-report
#:describe-test-result
#:make-test-result
#:count-repetitions
#:while-counting-repetitions
#:while-counting-events
#:while-counting-repetitions*
#:while-counting-events*
#:with-timeout
#:did-event
#:testsuite-ambiguous
#:testsuite-not-defined)
(:export
#:test-mixin
#:log-results-mixin
#:test-result
#:result-uuid
#:testsuite-p
#:*test-result*
#:*current-test*
#:last-test-status
#:suite-tested-p
#:failures
#:expected-failures
#:errors
#:expected-errors
#:skipped-test-cases
#:skipped-testsuites
#:ensure-cases
#:ensure-random-cases
#:deftestsuite
#:addtest
#:remove-test
#:run-test
#:run-tests
#:addbenchmark
#:defmeasure
#:undefmeasure
#:measure-space
#:measure-seconds
#:while-measuring
#:measure-time
#:measure-conses
#:with-profile-report
#:write-profile-information
#:profiling-threshold*
;; Variables
#:*test-ignore-warnings?*
#:*test-break-on-errors?*
#:*test-break-on-failures?*
#:*test-print-length*
#:*test-print-level*
#:*test-print-when-defined?*
#:*test-evaluate-when-defined?*
#:*test-describe-if-not-successful?*
#:*test-maximum-time*
#:*test-print-testsuite-names*
#:*test-print-test-case-names*
#:*test-maximum-error-count*
#:*test-maximum-failure-count*
#:*lift-dribble-pathname*
#:*lift-report-pathname*
#:*current-asdf-system-name*
#:*test-scratchpad*
#:*test-notepad*
#:*lift-equality-test*
#:*lift-debug-output*
#:*test-show-expected-p*
#:*test-show-details-p*
#:*test-show-code-p*
;; Other
#:ensure
#:ensure-null
#:ensure-same
#:ensure-different
#:ensure-condition
#:ensure-warning
#:ensure-error
#:ensure-no-warning
#:ensure-member
#:ensure-some
#:ensure-every
;; test protocol
#:do-test
;;?? Not yet
;; with-test
#:list-tests
#:print-tests
#:map-testsuites
#:testsuites
#:testsuite-tests
#:suite
#:find-testsuite
#:find-test-case
#:ensure-random-cases-failure
#:random-instance-for-suite
#:defrandom-instance
#:ensure-random-cases
#:ensure-random-cases+
#:random-element
#:random-number
#:an-integer
#:a-double-float
#:a-single-float
#:a-symbol
#:lift-result
#:lift-property
#:liftpropos
#:handle-config-preference
#:start-periodic-profiling
#:stop-periodic-profiling
#:periodic-profilers
#:setup-test
)
(:export
#:timeout-error))))
(unless (and (find-package :asdf)
(find-symbol (symbol-name 'system-relative-pathname) :asdf)
(fboundp (find-symbol
(symbol-name 'system-relative-pathname) :asdf)))
(warn "LIFT uses asdf:system-relative-pathname which your version of ASDF
doesn't seem to include. LIFT will define these for now but you may want to consider updating to the most recent version of ASDF (see http://www.cliki.net/asdf for details).")
(intern (symbol-name 'system-source-file) :asdf)
(intern (symbol-name 'system-source-directory) :asdf)
(intern (symbol-name 'system-relative-pathname) :asdf)
(export 'asdf::system-relative-pathname :asdf)
(defun asdf::system-source-file (system-name)
(let ((system (asdf:find-system system-name)))
(make-pathname
:type "asd"
:name (asdf:component-name system)
:defaults (asdf:component-relative-pathname system))))
(defun asdf::system-source-directory (system-name)
(make-pathname :name nil
:type nil
:defaults (asdf::system-source-file system-name)))
(defun asdf::system-relative-pathname (system pathname &key name type)
(let ((directory (pathname-directory pathname)))
(when (eq (car directory) :absolute)
(setf (car directory) :relative))
(merge-pathnames
(make-pathname :name (or name (pathname-name pathname))
:type (or type (pathname-type pathname))
:directory directory)
(asdf::system-source-directory system)))))