Bitfield groveller accepts aliased types
[cffi.git] / cffi-tests.asd
blob8c364412763579aeafc6e79262641d5cb1fbcef6
1 ;;;; -*- Mode: lisp; indent-tabs-mode: nil -*-
2 ;;;
3 ;;; cffi-tests.asd --- ASDF system definition for CFFI unit tests.
4 ;;;
5 ;;; Copyright (C) 2005-2006, James Bielman  <jamesjb@jamesjb.com>
6 ;;; Copyright (C) 2005-2011, Luis Oliveira  <loliveira@common-lisp.net>
7 ;;;
8 ;;; Permission is hereby granted, free of charge, to any person
9 ;;; obtaining a copy of this software and associated documentation
10 ;;; files (the "Software"), to deal in the Software without
11 ;;; restriction, including without limitation the rights to use, copy,
12 ;;; modify, merge, publish, distribute, sublicense, and/or sell copies
13 ;;; of the Software, and to permit persons to whom the Software is
14 ;;; furnished to do so, subject to the following conditions:
15 ;;;
16 ;;; The above copyright notice and this permission notice shall be
17 ;;; included in all copies or substantial portions of the Software.
18 ;;;
19 ;;; THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
20 ;;; EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
21 ;;; MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
22 ;;; NONINFRINGEMENT.  IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
23 ;;; HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
24 ;;; WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
25 ;;; OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
26 ;;; DEALINGS IN THE SOFTWARE.
27 ;;;
29 (defpackage #:cffi-tests-system
30   (:use #:cl #:asdf))
31 (in-package #:cffi-tests-system)
33 (eval-when (:compile-toplevel :load-toplevel :execute)
34   (oos 'load-op 'trivial-features))
36 (defvar *tests-dir* (append (pathname-directory *load-truename*) '("tests")))
38 (defclass c-test-lib (c-source-file)
39   ())
41 (defmethod perform ((o load-op) (c c-test-lib))
42   nil)
44 (defmethod perform ((o load-source-op) (c c-test-lib))
45   nil)
47 (defmethod perform ((o compile-op) (c c-test-lib))
48   #-windows
49   (unless (zerop (run-shell-command
50                   "cd ~A; make"
51                   (namestring (make-pathname :name nil :type nil
52                                              :directory *tests-dir*))))
53     (error 'operation-error :component c :operation o)))
55 ;; For the convenience of ECL users.
56 #+ecl (require 'rt)
58 (defsystem cffi-tests
59   :description "Unit tests for CFFI."
60   :depends-on (cffi-grovel cffi-libffi bordeaux-threads #-ecl rt)
61   :components
62   ((:module "tests"
63     :serial t
64     :components
65     ((:c-test-lib "libtest")
66      (:file "package")
67      (:file "bindings")
68      (:file "funcall")
69      (:file "defcfun")
70      (:file "callbacks")
71      (:file "foreign-globals")
72      (:file "memory")
73      (:file "strings")
74      (:file "struct")
75      (:file "fsbv")
76      (:file "union")
77      (:file "enum")
78      (:file "misc-types")
79      (:file "misc")
80      (:file "grovel")))))
82 (defmethod operation-done-p ((o test-op) (c (eql (find-system :cffi-tests))))
83   nil)
85 (defmethod perform ((o test-op) (c (eql (find-system :cffi-tests))))
86   (funcall (intern (string '#:run-all-cffi-tests) :cffi-tests)))
88 ;;; vim: ft=lisp et