get paths to test files (config and database) from source code path

This commit is contained in:
Helmut Merz 2024-06-01 10:41:28 +02:00
parent 2a29b0bd9c
commit 99b1627bfa
2 changed files with 7 additions and 4 deletions

View file

@ -2,10 +2,11 @@
;;; use: `(load "test/...")` from package scopes/test-storage
(defparameter db-config-sqlite
'(:backend :dbi
`(:backend :dbi
:db-type :sqlite3
:connect-args
(:database-name "test/test.db")
(:database-name
,(str:concat (namestring (asdf:system-source-directory :scopes)) "test/test.db"))
:options nil))
(setf scopes/test-storage:*db-config-test* db-config-sqlite)

View file

@ -14,19 +14,21 @@
(in-package :scopes/test-storage)
(defparameter *db-config-test* nil)
(defparameter *config-source*
(str:concat (namestring (asdf:system-source-directory :scopes)) "test/config-"))
(defun run-all ()
(run-sqlite)
(run-postgres))
(defun run-sqlite ()
(load "test/config-sqlite")
(load (str:concat *config-source* "sqlite"))
(let ((storage:*db-config* *db-config-test*)
(t:*test-suite* (t:test-suite "sqlite")))
(run)))
(defun run-postgres ()
(load "test/config-postgres")
(load (str:concat *config-source* "postgres"))
(let ((storage:*db-config* *db-config-test*)
(t:*test-suite* (t:test-suite "postgres")))
(run)))