New contrib: SB-GMP
[sbcl.git] / contrib / sb-gmp / sb-gmp.asd
1 (defpackage #:sb-gmp-system (:use #:asdf #:cl))
2
3 (in-package #:sb-gmp-system)
4
5 (defsystem sb-gmp
6   :name "SB-GMP"
7   :version "0.1"
8   :description "bignum calculations for SBCL using the GMP library"
9   :serial t
10   :components ((:module sb-gmp
11                 :pathname ""
12                 :components ((:file "gmp")))))
13
14 (defsystem sb-gmp-tests
15   :depends-on (sb-rt sb-gmp)
16   :components ((:file "tests")))
17
18 (defmethod perform :after ((o load-op) (c (eql (find-system :sb-gmp))))
19   (provide 'sb-gmp))
20
21 (defmethod perform ((o test-op) (c (eql (find-system :sb-gmp))))
22   (operate 'load-op 'sb-gmp)
23   (cond ((member :sb-gmp *features*)
24          (operate 'load-op 'sb-gmp-tests)
25          (operate 'test-op 'sb-gmp-tests))
26         (t
27          (warn "unable to test sb-gmp: libgmp unavailable"))))
28
29 (defmethod perform ((o test-op) (c (eql (find-system :sb-gmp-tests))))
30   (multiple-value-bind (soft strict pending)
31       (funcall (intern "DO-TESTS" (find-package "SB-RT")))
32     (declare (ignorable pending))
33     (fresh-line)
34     (unless strict
35       (warn "ignoring expected failures in sb-gmp-tests"))
36     (unless soft
37       (error "sb-gmp-tests failed with unexpected failures"))))