csys: allow testing with multiple different neural nets: move env and services setup to individual test
This commit is contained in:
parent
c04546ffe7
commit
de72fe9aaf
1 changed files with 22 additions and 24 deletions
|
|
@ -43,27 +43,24 @@
|
||||||
(util:lgi nmsg)
|
(util:lgi nmsg)
|
||||||
(actor:send (core:mailbox (tc:receiver t:*test-suite*)) nmsg))))
|
(actor:send (core:mailbox (tc:receiver t:*test-suite*)) nmsg))))
|
||||||
|
|
||||||
;;;; test runner
|
|
||||||
|
|
||||||
(defun run ()
|
(defun run ()
|
||||||
(async:init)
|
(let ((t:*test-suite* (make-instance 'tc:test-suite :name "csys")))
|
||||||
(let* ((t:*test-suite* (make-instance 'tc:test-suite :name "csys"))
|
|
||||||
(csys:*environment* (make-instance 'test-env :test-suite t:*test-suite*)))
|
|
||||||
(load (t:test-path "config-csys" "etc"))
|
(load (t:test-path "config-csys" "etc"))
|
||||||
(setup-config)
|
(async:init)
|
||||||
(core:setup-services)
|
|
||||||
(unwind-protect
|
(unwind-protect
|
||||||
(let ((rcvr (core:find-service :test-receiver)))
|
(test-init)
|
||||||
(setf (tc:receiver t:*test-suite*) rcvr)
|
|
||||||
(test-init rcvr))
|
|
||||||
(sleep 0.1)
|
(sleep 0.1)
|
||||||
(core:shutdown)
|
|
||||||
;(tc:check-expected)
|
|
||||||
(t:show-result))))
|
(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)
|
(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:init)
|
||||||
(csys:send-message '(:csys :sensor :init :zero) '(:std :s1))
|
(csys:send-message '(:csys :sensor :init :zero) '(:std :s1))
|
||||||
(csys:send-message '(:csys :sensor :init :zero) '(:std :s2))
|
(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 :add :std :s1) 3)
|
||||||
(csys:send-message '(:csys :sub :std :s2) 4)
|
(csys:send-message '(:csys :sub :std :s2) 4)
|
||||||
(csys:send-message '(:csys :add :std :s2) 5)
|
(csys:send-message '(:csys :add :std :s2) 5)
|
||||||
)
|
(core:shutdown)
|
||||||
|
))
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue