csys: allow testing with multiple different neural nets: move env and services setup to individual test

This commit is contained in:
Helmut Merz 2026-03-30 19:28:46 +02:00
parent c04546ffe7
commit de72fe9aaf

View file

@ -43,27 +43,24 @@
(util:lgi nmsg)
(actor:send (core:mailbox (tc:receiver t:*test-suite*)) nmsg))))
;;;; test runner
(defun run ()
(async:init)
(let* ((t:*test-suite* (make-instance 'tc:test-suite :name "csys"))
(csys:*environment* (make-instance 'test-env :test-suite t:*test-suite*)))
(let ((t:*test-suite* (make-instance 'tc:test-suite :name "csys")))
(load (t:test-path "config-csys" "etc"))
(setup-config)
(core:setup-services)
(async:init)
(unwind-protect
(let ((rcvr (core:find-service :test-receiver)))
(setf (tc:receiver t:*test-suite*) rcvr)
(test-init rcvr))
(test-init)
(sleep 0.1)
(core:shutdown)
;(tc:check-expected)
(t:show-result))))
(deftest test-init (rcvr)
;;;; tests
(deftest test-init ()
(let ((csys:*environment* (make-instance 'test-env :test-suite t:*test-suite*))
rcvr)
(setf (gethash '(:effect :default) (csys:procs csys:*environment*)) #'eff-proc)
;(csys:make-eff-proc (eff-handler '(1 3 4 5))))
(setup-config)
(core:setup-services)
(setf (tc:receiver t:*test-suite*) (core:find-service :test-receiver))
(csys:init)
(csys:send-message '(:csys :sensor :init :zero) '(:std :s1))
(csys:send-message '(:csys :sensor :init :zero) '(:std :s2))
@ -72,4 +69,5 @@
(csys:send-message '(:csys :add :std :s1) 3)
(csys:send-message '(:csys :sub :std :s2) 4)
(csys:send-message '(:csys :add :std :s2) 5)
)
(core:shutdown)
))