48 lines
1.2 KiB
Common Lisp
48 lines
1.2 KiB
Common Lisp
;;; cl-scopes/test/test-storage
|
|
|
|
;;;; testing facility for scopes/storage
|
|
|
|
(defpackage :scopes/test-storage
|
|
(:use :common-lisp)
|
|
(:local-nicknames (:storage :scopes/storage)
|
|
(:tracking :scopes/storage/tracking)
|
|
(:t :scopes/testing))
|
|
(:export #:*db-config-postgres* #:*db-config-sqlite*
|
|
#:run #:run-all #:run-postgres #:run-sqlite #:try)
|
|
(:import-from :scopes/testing #:==))
|
|
|
|
(in-package :scopes/test-storage)
|
|
|
|
(defparameter *db-config-sqlite* nil)
|
|
(defparameter *db-config-postgres* nil)
|
|
(load "test/etc")
|
|
|
|
(defun try()
|
|
(setf storage:*db-config* *db-config-sqlite*)
|
|
(print storage:*db-config*)
|
|
(print *db-config-postgres*))
|
|
|
|
(defun run-all ()
|
|
(run-sqlite)
|
|
(run-postgres))
|
|
|
|
(defun run-sqlite ()
|
|
(let ((storage:*db-config* *db-config-sqlite*))
|
|
(run)))
|
|
|
|
(defun run-postgres ()
|
|
(let ((storage:*db-config* *db-config-postgres*))
|
|
(run)))
|
|
|
|
(defun run ()
|
|
(let ((st (storage:make-storage))
|
|
(t:*tst* (t:test-suite)))
|
|
(test-track st)
|
|
(t:show-result)))
|
|
|
|
(defun test-track (st)
|
|
(let ((tr (make-instance 'tracking:track)))
|
|
(storage:drop-table st :tracks)
|
|
(tracking:create-table st :tracks '(taskid username))
|
|
;(setf (scs:data tr) nil)
|
|
(== (tracking:data tr) nil)))
|