X-Git-Url: http://git.kpe.io/?a=blobdiff_plain;f=uffi-tests.asd;h=d68d1b0ac83cd0b85b0de6d31ec352e5c41e51eb;hb=c4b68632f52cb0443d791ac887069c13a929925b;hp=6f2c4bfc7c129149caaaf776c756afc6f6d583cb;hpb=7c6a7667f14741d85625f4091e931f1d5ed42159;p=uffi.git diff --git a/uffi-tests.asd b/uffi-tests.asd index 6f2c4bf..d68d1b0 100644 --- a/uffi-tests.asd +++ b/uffi-tests.asd @@ -14,41 +14,33 @@ (:use #:asdf #:cl)) (in-package #:uffi-tests-system) -(defvar *asd-file-dir* (pathname-directory *load-truename*)) +(defvar *library-file-dir* (append (pathname-directory *load-truename*) + (list "tests"))) (defclass uffi-test-source-file (c-source-file) ()) (defmethod output-files ((o compile-op) (c uffi-test-source-file)) - (let ((searched (or - (probe-file #p"/usr/lib/uffi/uffi-c-test.so") - (probe-file (make-pathname - :directory *asd-file-dir* - :name "uffi-c-test" - :type "so"))))) - (if searched - (list searched) - (list (merge-pathnames - (make-pathname :name (component-name c) - :type "so" - :directory '(:relative "tests")) - (make-pathname :directory *asd-file-dir*)))))) + (let ((found (some #'(lambda (dir) + (probe-file (make-pathname :directory dir + :name (component-name c) + :type "so"))) + '((:absolute "usr" "lib" "uffi"))))) + (list (if found + found + (make-pathname :name (component-name c) + :type "so" + :directory *library-file-dir*))))) (defmethod perform ((o load-op) (c uffi-test-source-file)) - (dolist (f (asdf::input-files o c)) - (funcall (intern (symbol-name '#:load-foreign-library) - (symbol-name '#:uffi)) - f :module "uffi_tests"))) + nil) ;; lisp loader file will load library (defmethod perform ((o compile-op) (c uffi-test-source-file)) - (unless (zerop (run-shell-command "cd ~A; make" - (namestring (merge-pathnames - (make-pathname - :name nil - :type nil - :directory '(:relative "tests")) - (make-pathname - :directory *asd-file-dir*))))) + (unless (zerop (run-shell-command + "cd ~A; make" + (namestring (make-pathname :name nil + :type nil + :directory *library-file-dir*)))) (error 'operation-error :component c :operation o)))