X-Git-Url: http://git.kpe.io/?p=clsql.git;a=blobdiff_plain;f=tests%2Futils.lisp;fp=tests%2Futils.lisp;h=6b5d38e64606fe4406e1703801b81e52c2c4dabb;hp=bd51cb84ac32798e27789b7d5cb4fff37d740f07;hb=86440ca219f801a087ad917d1c1f46c77c920aa4;hpb=a223800f208347e8a07f597648fcdb6c05ec5afe diff --git a/tests/utils.lisp b/tests/utils.lisp index bd51cb8..6b5d38e 100644 --- a/tests/utils.lisp +++ b/tests/utils.lisp @@ -24,28 +24,28 @@ :type "config")) (defvar +all-db-types+ - #-clisp '(:postgresql :postgresql-socket :sqlite :mysql :odbc :aodbc) + #-clisp '(:postgresql :postgresql-socket :sqlite :mysql :odbc + #+allegro :aodbc) #+clisp '(:sqlite)) (defclass conn-specs () - ((aodbc-spec :accessor aodbc-spec :initform nil) - (odbc-spec :accessor odbc-spec :initform nil) - (mysql-spec :accessor mysql-spec :initform nil) - (postgresql-spec :accessor postgresql-spec :initform nil) - (postgresql-socket-spec :accessor postgresql-socket-spec :initform nil) - (sqlite-spec :accessor sqlite-spec :initform nil)) + ((aodbc :accessor aodbc-spec :initform nil) + (odbc :accessor odbc-spec :initform nil) + (mysql :accessor mysql-spec :initform nil) + (postgresql :accessor postgresql-spec :initform nil) + (postgresql-socket :accessor postgresql-socket-spec :initform nil) + (sqlite :accessor sqlite-spec :initform nil)) (:documentation "Connection specs for CLSQL testing")) (defun read-specs (&optional (path *config-pathname*)) (if (probe-file path) (with-open-file (stream path :direction :input) - (let ((config (read stream)) - (specs (make-instance 'conn-specs))) - (dolist (db-type +all-db-types+) - (setf (slot-value specs (spec-fn db-type)) - (cadr (assoc db-type config)))) - specs)) + (let ((specs (make-instance 'conn-specs))) + (dolist (spec (read stream) specs) + (push (second spec) + (slot-value specs (intern (symbol-name (first spec)) + (find-package '#:clsql-tests))))))) (progn (warn "CLSQL test config file ~S not found" path) nil)))