chiark / gitweb /
doc/sod.sty: Hack underscores in the labels generated by `describe'.
[sod] / src / sod-test.asd.in
1 ;;; -*-lisp-*-
2 ;;;
3 ;;; Tests for the Simple Object Design translator
4 ;;;
5 ;;; (c) 2009 Straylight/Edgeware
6 ;;;
7
8 ;;;----- Licensing notice ---------------------------------------------------
9 ;;;
10 ;;; This file is part of the Sensble Object Design, an object system for C.
11 ;;;
12 ;;; SOD is free software; you can redistribute it and/or modify
13 ;;; it under the terms of the GNU General Public License as published by
14 ;;; the Free Software Foundation; either version 2 of the License, or
15 ;;; (at your option) any later version.
16 ;;;
17 ;;; SOD is distributed in the hope that it will be useful,
18 ;;; but WITHOUT ANY WARRANTY; without even the implied warranty of
19 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
20 ;;; GNU General Public License for more details.
21 ;;;
22 ;;; You should have received a copy of the GNU General Public License
23 ;;; along with SOD; if not, write to the Free Software Foundation,
24 ;;; Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
25
26 (cl:defpackage #:sod-sysdef
27   (:use #:common-lisp #:asdf))
28
29 (cl:in-package #:sod-sysdef)
30
31 #|@-auto-@|# (load "auto.lisp")
32
33 ;;;--------------------------------------------------------------------------
34 ;;; Definition.
35
36 (defsystem sod-test
37
38   ;; Boring copyright stuff.
39   :version #:*sysdef-version*
40   :author "Mark Wooding"
41   :license "GNU General Public License, version 2 or later"
42   #|@-path-@|# :pathname "@srcdir@"
43
44   ;; Documentation.
45   :description "Tests for the Sensible Object Design translator."
46
47   :long-description
48   "This system provides unit tests for the Sod translator."
49
50   :depends-on ("sod" "xlunit")
51
52   :components
53   ((:file "test-base")
54
55    ;; Test the parser edifice.
56    (:module "parser" :depends-on ("test-base") :components
57     ((:file "parser-test")
58      (:file "scanner-charbuf-test")))
59
60    ;; The actual tests.
61    (:file "c-types-test" :depends-on ("test-base"))
62    (:file "codegen-test" :depends-on ("test-base"))
63    (:file "lexer-test" :depends-on ("test-base"))))
64
65 ;;;--------------------------------------------------------------------------
66 ;;; Testing.
67
68 (defmethod perform ((op test-op) (system (eql (find-system "sod-test"))))
69   (handler-bind (((or warning style-warning)
70                   (lambda (cond)
71                     (declare (ignore cond))
72                     (invoke-restart 'muffle-warning))))
73     (operate 'load-op system)
74     (let ((result (funcall (find-symbol "RUN-TESTS" "SOD-TEST"))))
75       (unless (funcall (find-symbol "WAS-SUCCESSFUL" "XLUNIT") result)
76         (error "Failed test")))))
77
78 ;;;----- That's all, folks --------------------------------------------------