chiark / gitweb /
38b5095ee8395f430edff8ead47057bd076e0358
[sod] / src / sod-test.asd
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-test-sysdef
27   (:use #:common-lisp #:asdf))
28
29 (cl:in-package #:sod-test-sysdef)
30
31 ;;;--------------------------------------------------------------------------
32 ;;; Definition.
33
34 (defsystem sod-test
35
36   ;; Boring copyright stuff.
37   :version "1.0.0"
38   :author "Mark Wooding"
39   :license "GNU General Public License, version 2 or later"
40
41   ;; Documentation.
42   :description "Tests for the Sensible Object Design translator."
43
44   :long-description
45   "This system provides unit tests for the Sod translator."
46
47   :depends-on ("sod" "xlunit")
48
49   :components
50   ((:file "test-base")
51
52    ;; Test the parser edifice.
53    (:module "parser" :depends-on ("test-base") :components
54     ((:file "parser-test")
55      (:file "scanner-charbuf-test")))
56
57    ;; The actual tests.
58    (:file "c-types-test" :depends-on ("test-base"))
59    (:file "codegen-test" :depends-on ("test-base"))
60    (:file "lexer-test" :depends-on ("test-base"))))
61
62 ;;;--------------------------------------------------------------------------
63 ;;; Testing.
64
65 (defmethod perform ((op test-op) (system (eql (find-system "sod-test"))))
66   (operate 'load-op system)
67   (funcall (find-symbol "RUN-TESTS" "SOD-TEST")))
68
69 ;;;--------------------------------------------------------------------------
70 ;;; Hacks.
71
72 (defmethod perform :around
73     ((op compile-op) (component (eql (find-system "sod-test"))))
74   (let ((*compile-file-failure-behaviour* :warn))
75     (call-next-method)))
76
77 ;;;----- That's all, folks --------------------------------------------------