1 ;;;; -*- Mode: lisp; indent-tabs-mode: nil -*-
3 ;;; cffi-tests.asd --- ASDF system definition for CFFI unit tests.
5 ;;; Copyright (C) 2005-2006, James Bielman <jamesjb@jamesjb.com>
6 ;;; Copyright (C) 2005-2011, Luis Oliveira <loliveira@common-lisp.net>
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:
16 ;;; The above copyright notice and this permission notice shall be
17 ;;; included in all copies or substantial portions of the Software.
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.
29 (defpackage #:cffi-tests-system
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)
41 (defmethod perform ((o load-op) (c c-test-lib))
44 (defmethod perform ((o load-source-op) (c c-test-lib))
47 (defmethod perform ((o compile-op) (c c-test-lib))
49 (unless (zerop (run-shell-command
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.
59 :description "Unit tests for CFFI."
60 :depends-on (cffi-libffi bordeaux-threads #-ecl rt)
65 ((:c-test-lib "libtest")
71 (:file "foreign-globals")
81 (defmethod operation-done-p ((o test-op) (c (eql (find-system :cffi-tests))))
84 (defmethod perform ((o test-op) (c (eql (find-system :cffi-tests))))
85 (flet ((run-tests (&rest args)
86 (apply (intern (string '#:run-cffi-tests) '#:cffi-tests) args)))
87 (run-tests :compiled nil)
88 (run-tests :compiled t)))