1 ;;;; -*- Mode: LISP; Syntax: ANSI-Common-lisp; Base: 10; Package: BORDEAUX-THREADS-2/TEST -*-
2 ;;;; The above modeline is required for Genera. Do not change.
4 (in-package :bordeaux-threads-2
/test
)
6 (in-suite :bordeaux-threads-2
)
8 (test not-implemented.whole-function
9 (let ((*not-implemented
* (make-hash-table :test
#'equal
))
11 (feature :some-feature
))
12 (is-true (implemented-p op
))
13 (is-true (implemented-p op feature
))
14 (mark-not-implemented op
)
15 (is-false (implemented-p op
))
16 (is-false (implemented-p op feature
))))
18 (test not-implemented.one-feature
19 (let ((*not-implemented
* (make-hash-table :test
#'equal
))
22 (is-true (implemented-p op
))
23 (is-true (implemented-p op feature
))
24 (mark-not-implemented op feature
)
25 (is-true (implemented-p op
))
26 (is-false (implemented-p op
:feature
))))
32 (test make-thread.not-implemented
33 (if (implemented-p 'bt2
:make-thread
)
35 (signals not-implemented
(make-thread (lambda ())))))
37 (test join-thread.not-implemented
38 (if (implemented-p 'bt2
:join-thread
)
40 (signals not-implemented
(join-thread (make-thread (lambda ()))))))
42 (test current-thread.not-implemented
43 (if (implemented-p 'bt2
:current-thread
)
45 (signals not-implemented
(current-thread))))
47 (test thread-yield.not-implemented
48 (if (implemented-p 'bt2
:thread-yield
)
50 (signals not-implemented
(thread-yield))))
52 (test all-threads.not-implemented
53 (if (implemented-p 'bt2
:all-threads
)
55 (signals not-implemented
(all-threads))))
57 (test interrupt-thread.not-implemented
58 (if (implemented-p 'bt2
:interrupt-thread
)
60 (signals not-implemented
61 (let ((thread (make-thread (lambda () (sleep 5)))))
62 (interrupt-thread thread
(lambda ()))))))
64 (test destroy-thread.not-implemented
65 (if (implemented-p 'bt2
:destroy-thread
)
67 (signals not-implemented
68 (destroy-thread (make-thread (lambda ()))))))
70 (test thread-alive-p.not-implemented
71 (if (implemented-p 'bt2
:thread-alive-p
)
73 (signals not-implemented
74 (thread-alive-p (make-thread (lambda ()))))))
81 (test make-lock.not-implemented
82 (if (implemented-p 'bt2
:make-lock
)
84 (signals not-implemented
(make-lock))))
86 (test acquire-lock.not-implemented
87 (if (implemented-p 'bt2
:acquire-lock
)
89 (signals not-implemented
90 (acquire-lock (make-lock)))))
92 (test release-lock.not-implemented
93 (if (implemented-p 'bt2
:release-lock
)
95 (signals not-implemented
96 (let ((lock (make-lock)))
98 (release-lock lock
)))))
100 (test with-lock-held.not-implemented
101 (if (implemented-p 'bt2
:with-lock-held
)
103 (signals not-implemented
104 (let ((lock (make-lock)))
105 (with-lock-held (lock))))))
107 (test make-recursive-lock.not-implemented
108 (if (implemented-p 'bt2
:make-recursive-lock
)
110 (signals not-implemented
(make-recursive-lock))))
112 (test acquire-recursive-lock.not-implemented
113 (if (implemented-p 'bt2
:acquire-recursive-lock
)
115 (signals not-implemented
116 (acquire-recursive-lock (make-recursive-lock)))))
118 (test release-recursive-lock.not-implemented
119 (if (implemented-p 'bt2
:release-recursive-lock
)
121 (signals not-implemented
122 (let ((lock (make-recursive-lock)))
123 (acquire-recursive-lock lock
)
124 (release-recursive-lock lock
)))))
126 (test with-recursive-lock-held.not-implemented
127 (if (implemented-p 'bt2
:with-recursive-lock-held
)
129 (signals not-implemented
130 (let ((lock (make-recursive-lock)))
131 (with-recursive-lock-held (lock))))))
135 ;;; Condition variables