oct.asd 4.07 KB
Newer Older
Raymond Toy's avatar
Raymond Toy committed
1
2
;;;; -*- Mode: lisp -*-
;;;;
3
;;;; Copyright (c) 2007, 2011 Raymond Toy
Raymond Toy's avatar
Raymond Toy committed
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
;;;;
;;;; Permission is hereby granted, free of charge, to any person
;;;; obtaining a copy of this software and associated documentation
;;;; files (the "Software"), to deal in the Software without
;;;; restriction, including without limitation the rights to use,
;;;; copy, modify, merge, publish, distribute, sublicense, and/or sell
;;;; copies of the Software, and to permit persons to whom the
;;;; Software is furnished to do so, subject to the following
;;;; conditions:
;;;;
;;;; The above copyright notice and this permission notice shall be
;;;; included in all copies or substantial portions of the Software.
;;;;
;;;; THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
;;;; EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
;;;; OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
;;;; NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
;;;; HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
;;;; WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
;;;; FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
;;;; OTHER DEALINGS IN THE SOFTWARE.

;;; This is the asdf definition for oct.  I don't normally use this,
;;; so it might be out of date.  Use at your own risk.

(defpackage #:oct-system
30
  (:use #:cl #:asdf))
Raymond Toy's avatar
Raymond Toy committed
31

32
33
(require :named-readtables)

Raymond Toy's avatar
Raymond Toy committed
34
35
36
37
38
(in-package #:oct-system)

(asdf:defsystem oct
  :description "A portable implementation of quad-double arithmetic.  See <http://www.common-lisp.net/project/oct>."
  :author "Raymond Toy"
Raymond Toy's avatar
Raymond Toy committed
39
  :maintainer "See <http://www.common-lisp.net/project/oct>"
Raymond Toy's avatar
Raymond Toy committed
40
  :licence "MIT"
Raymond Toy's avatar
Raymond Toy committed
41
  :version "2020.11.27"			; Just use the date
42
  :in-order-to ((test-op (test-op "oct/tests")))
43
  :depends-on (octi)
Raymond Toy's avatar
Raymond Toy committed
44
  :components
Raymond Toy's avatar
Raymond Toy committed
45
46
  ((:module "src"
    :components
Raymond Toy's avatar
Raymond Toy committed
47
    ((:file "oct-package")
48
49
     (:file "oct-class" :depends-on ("oct-package"))
     (:file "oct-const" :depends-on ("oct-class")
Raymond Toy's avatar
Raymond Toy committed
50
51
52
53
      :around-compile (lambda (thunk)
			;; Just byte-compile these on cmucl since these are just constants
			(let (#+nil (ext:*byte-compile-default* t))
			  (funcall thunk))))
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
     (:file "oct-methods"
      :depends-on ("oct-class"))
     (:file "oct-reader"
      :depends-on ("oct-methods"))
     (:file "oct-format"
      :depends-on ("oct-methods" "oct-reader"))
     (:file "oct-complex"
      :depends-on ("oct-methods" "oct-reader"))
     (:file "oct-elliptic"
      :depends-on ("oct-methods" "oct-reader"))
     (:file "oct-theta"
      :depends-on ("oct-methods" "oct-reader"))
     (:file "oct-gamma"
      :depends-on ("oct-complex" "oct-methods" "oct-reader"))
     (:file "oct-bessel"
      :depends-on ("oct-methods"))))))
70
71


Symbolics's avatar
Symbolics committed
72
73
; (defmethod perform ((op test-op) (c (eql (asdf:find-system :oct))))
;   (oos 'test-op 'rt:do-tests))
74

Symbolics's avatar
Symbolics committed
75
(asdf:defsystem oct/tests
76
  :depends-on (oct rt)
Raymond Toy's avatar
Raymond Toy committed
77
  :version "2013.11.26"			; Just use the date
78
  :components
Raymond Toy's avatar
Raymond Toy committed
79
80
81
82
83
84
  ((:module "rt"
    :components
    ((:file "rt-package")
     (:file "rt")))
   (:module "tests"
    :depends-on ("rt")
Raymond Toy's avatar
Raymond Toy committed
85
86
87
88
    :components
    ((:file "qd-extra")
     (:file "qd-test")
     (:file "rt-tests")))))
89

90
(defmethod perform ((op test-op) (c (eql (asdf:find-system :oct/tests))))
91
92
93
94
95
96
97
98
99
  ;; Set the initial random state when running tests so that we get
  ;; consistent test results between runs.  Currently only works with
  ;; cmucl.  
  ;;
  ;; TODO: Figure out how to initialize the random state to a known
  ;; value for other lisps.
  (let* ((*random-state*
	   #+cmucl
	   (kernel::make-random-object :state (kernel:init-random-state))
Raymond Toy's avatar
Raymond Toy committed
100
101
102
	   #+sbcl
	   (sb-kernel::%make-random-state (sb-kernel::init-random-state 3141592653))
	   #-(or cmucl sbcl)
103
104
105
106
107
108
	   (make-random-state nil)))
    (format t "Test random-state ~A~%" *random-state*)
    (let* ((rt-package (find-package "RT"))
	   (pass (funcall (intern "DO-TESTS" rt-package)))
	   (unexpected-failures (symbol-value (find-symbol "*UNEXPECTED-FAILURES*" rt-package)))
	   (unexpected-successes (symbol-value (find-symbol "*UNEXPECTED-SUCCESSES*" rt-package))))
Raymond Toy's avatar
Raymond Toy committed
109
110
      (or (not pass)
	  (and (null unexpected-failures) (null unexpected-successes))
111
	  (error "TEST-OP failed for OCT-TESTS")))))