913f078db7f48bb41a7b0bec2e80aa114fa604a0
[sbcl.git] / contrib / sb-concurrency / sb-concurrency.asd
1 ;;;; -*-  Lisp -*-
2 ;;;;
3 ;;;; This software is part of the SBCL system. See the README file for
4 ;;;; more information.
5 ;;;;
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.
11
12 (in-package :cl-user)
13
14 (asdf:defsystem :sb-concurrency
15   :components ((:file "package")
16                (:file "frlock"   :depends-on ("package"))
17                (:file "queue"    :depends-on ("package"))
18                (:file "mailbox"  :depends-on ("package" "queue"))
19                (:file "gate"     :depends-on ("package"))))
20
21 (asdf:defsystem :sb-concurrency-tests
22   :depends-on (:sb-concurrency :sb-rt)
23   :components
24   ((:module tests
25     :components
26     ((:file "package")
27      (:file "test-utils"   :depends-on ("package"))
28      (:file "test-frlock"  :depends-on ("package" "test-utils"))
29      (:file "test-queue"   :depends-on ("package" "test-utils"))
30      (:file "test-mailbox" :depends-on ("package" "test-utils"))
31      (:file "test-gate"    :depends-on ("package" "test-utils"))))))
32
33 (defmethod asdf:perform :after ((o asdf:load-op)
34                                 (c (eql (asdf:find-system :sb-concurrency))))
35   (provide 'sb-concurrency))
36
37 (defmethod asdf:perform ((o asdf:test-op)
38                          (c (eql (asdf:find-system :sb-concurrency))))
39   (asdf:oos 'asdf:load-op :sb-concurrency-tests)
40   (asdf:oos 'asdf:test-op :sb-concurrency-tests))
41
42 (defmethod asdf:perform ((o asdf:test-op)
43                          (c (eql (asdf:find-system :sb-concurrency-tests))))
44   (multiple-value-bind (soft strict pending)
45       (funcall (intern "DO-TESTS" (find-package "SB-RT")))
46     (fresh-line)
47     (unless strict
48       #+sb-testing-contrib
49       ;; We create TEST-PASSED from a shell script if tests passed.  But
50       ;; since the shell script only `touch'es it, we can actually create
51       ;; it ahead of time -- as long as we're certain that tests truly
52       ;; passed, hence the check for SOFT.
53       (when soft
54         (with-open-file (s #p"SYS:CONTRIB;SB-CONCURRENCY;TEST-PASSED"
55                            :direction :output)
56           (dolist (pend pending)
57             (format s "Expected failure: ~A~%" pend))))
58       (warn "ignoring expected failures in test-op"))
59     (unless soft
60       (error "test-op failed with unexpected failures"))))