From f7007b48e30c768207b53ea3ca17d88f3f2dcb2a Mon Sep 17 00:00:00 2001 From: Helmut Merz Date: Sun, 16 Jun 2024 19:14:54 +0200 Subject: [PATCH] check (implementation = work in progress): logging; put sqlite DB in data subdirectory --- .gitignore | 1 + core/core.lisp | 6 ++++-- test/config-sqlite.lisp | 2 +- test/data/README.md | 1 + test/test-core.lisp | 1 + 5 files changed, 8 insertions(+), 3 deletions(-) create mode 100644 test/data/README.md diff --git a/.gitignore b/.gitignore index eca4762..a53e940 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ test.db bin +*-test.log diff --git a/core/core.lisp b/core/core.lisp index 09980e8..799b06f 100644 --- a/core/core.lisp +++ b/core/core.lisp @@ -66,8 +66,10 @@ (:method ((rcvr context) msg) (let* ((acts (actions rcvr)) (hdlrs (select msg acts))) - (dolist (hdlr hdlrs) - (funcall hdlr rcvr msg))))) + (if (null hdlrs) + (log:warn "no action selected for ~s" msg) + (dolist (hdlr hdlrs) + (funcall hdlr rcvr msg)))))) ;;;; simple printer service diff --git a/test/config-sqlite.lisp b/test/config-sqlite.lisp index e0f2170..d59fb3b 100644 --- a/test/config-sqlite.lisp +++ b/test/config-sqlite.lisp @@ -6,7 +6,7 @@ :db-type :sqlite3 :connect-args (:database-name - ,(namestring (scopes/testing:test-path "test.db"))) + ,(namestring (scopes/testing:test-path "test.db" "data"))) :options nil)) (setf scopes/test-storage:*db-config-test* db-config-sqlite) diff --git a/test/data/README.md b/test/data/README.md new file mode 100644 index 0000000..b4d023e --- /dev/null +++ b/test/data/README.md @@ -0,0 +1 @@ +Database files and other storage items should be placed here. diff --git a/test/test-core.lisp b/test/test-core.lisp index 161cd06..43f726a 100644 --- a/test/test-core.lisp +++ b/test/test-core.lisp @@ -51,6 +51,7 @@ (let* ((*config* nil) (t:*test-suite* (make-instance 'test-suite :name "core")) (rcvr (receiver t:*test-suite*))) + (log4cl:log-config :sane :daily (t:test-path "scopes-test.log" "log")) (load (t:test-path "config-core" "etc")) (core:add-action rcvr '(:test) #'check-message) (test-send)