-(defun run-tests (backend)
- (format t "~&Running CLSQL tests with ~A backend.~%" backend)
- (test-connect-to-database backend)
- (test-initialise-database)
- (rtest:do-tests))
+(defclass conn-specs ()
+ ((aodbc-spec :accessor aodbc :initform nil)
+ (mysql-spec :accessor mysql :initform nil)
+ (pgsql-spec :accessor postgresql :initform nil)
+ (pgsql-socket-spec :accessor postgresql-socket :initform nil)
+ (sqlite-spec :accessor sqlite :initform nil))
+ (:documentation "Connection specifications for CLSQL testing"))
+
+(defun run-tests ()
+ (let ((specs (read-specs)))
+ (unless specs
+ (warn "Not running tests because test configuration file is missing")
+ (return-from run-tests :skipped))
+ (dolist (accessor '(postgresql postgresql-socket sqlite aodbc mysql))
+ (unless (find-package (symbol-name accessor))
+ (asdf:operate 'asdf:load-op
+ (intern (concatenate 'string
+ (symbol-name '#:clsql-)
+ (symbol-name accessor)))))
+ (rt:rem-all-tests)
+ (dolist (test (append *rt-connection* *rt-fddl* *rt-fdml*
+ *rt-ooddl* *rt-oodml* *rt-syntax*))
+ (eval test))