- (usql:update-records-from-instance employee1)
- (usql:update-records-from-instance employee2)
- (usql:update-records-from-instance employee3)
- (usql:update-records-from-instance employee4)
- (usql:update-records-from-instance employee5)
- (usql:update-records-from-instance employee6)
- (usql:update-records-from-instance employee7)
- (usql:update-records-from-instance employee8)
- (usql:update-records-from-instance employee9)
- (usql:update-records-from-instance employee10)
- (usql:update-records-from-instance company1))
+ (clsql:update-records-from-instance employee1)
+ (clsql:update-records-from-instance employee2)
+ (clsql:update-records-from-instance employee3)
+ (clsql:update-records-from-instance employee4)
+ (clsql:update-records-from-instance employee5)
+ (clsql:update-records-from-instance employee6)
+ (clsql:update-records-from-instance employee7)
+ (clsql:update-records-from-instance employee8)
+ (clsql:update-records-from-instance employee9)
+ (clsql:update-records-from-instance employee10)
+ (clsql:update-records-from-instance company1))
+
+(defvar *error-count* 0)
+(defvar *error-list* nil)
+
+(defun run-tests-append-report-file (report-file)
+ (let* ((report-path (etypecase report-file
+ (pathname report-file)
+ (string (parse-namestring report-file))))
+ (sexp-report-path (make-pathname :defaults report-path
+ :type "sexp")))
+ (with-open-file (rs report-path :direction :output
+ :if-exists :append
+ :if-does-not-exist :create)
+ (with-open-file (srs sexp-report-path :direction :output
+ :if-exists :append
+ :if-does-not-exist :create)
+ (run-tests :report-stream rs :sexp-report-stream srs)))))
+
+(defun run-tests (&key (report-stream *standard-output*) (sexp-report-stream nil))
+ (let ((specs (read-specs))
+ (*report-stream* report-stream)
+ (*sexp-report-stream* sexp-report-stream)
+ (*error-count* 0)
+ (*error-list* nil))
+ (unless specs
+ (warn "Not running tests because test configuration file is missing")
+ (return-from run-tests :skipped))
+ (load-necessary-systems specs)
+ (dolist (db-type +all-db-types+)
+ (dolist (spec (db-type-spec db-type specs))
+ (do-tests-for-backend db-type spec))))
+ (zerop *error-count*))
+
+(defun load-necessary-systems (specs)
+ (dolist (db-type +all-db-types+)
+ (when (db-type-spec db-type specs)
+ (db-type-ensure-system db-type))))
+
+(defun do-tests-for-backend (db-type spec)
+ (test-connect-to-database db-type spec)