41 lines
1.3 KiB
Common Lisp
41 lines
1.3 KiB
Common Lisp
;;;; cl-scopes/test-csys - testing for the scopes-csys system.
|
|
|
|
(defpackage :scopes/test-csys
|
|
(:use :common-lisp)
|
|
(:local-nicknames (:alx :alexandria)
|
|
(:actor :scopes/core/actor)
|
|
(:async :scopes/util/async)
|
|
(:config :scopes/config)
|
|
(:core :scopes/core)
|
|
(:csys :scopes/csys)
|
|
(:logging :scopes/logging)
|
|
(:message :scopes/core/message)
|
|
(:shape :scopes/shape)
|
|
(:util :scopes/util)
|
|
(:t :scopes/testing))
|
|
(:export #:run)
|
|
(:import-from :scopes/testing #:deftest #:== #:!=))
|
|
|
|
(in-package :scopes/test-csys)
|
|
|
|
;;;; test runner
|
|
|
|
(defun run ()
|
|
(async:init)
|
|
(let* ((t:*test-suite* (make-instance 't:test-suite :name "csys"))
|
|
(csys:*sensors* (make-hash-table :test #'equal)))
|
|
(load (t:test-path "config-csys" "etc"))
|
|
(unwind-protect
|
|
(progn
|
|
(test-nodispatch))
|
|
(async:finish)
|
|
(t:show-result))))
|
|
|
|
(deftest test-nodispatch ()
|
|
(core:setup-services)
|
|
(csys:send-message '(:csys :add :log :s1) 1)
|
|
(csys:send-message '(:csys :add :log :s1) 3)
|
|
(csys:send-message '(:csys :sub :log :s2) 4)
|
|
(csys:send-message '(:csys :add :log :s2) 5)
|
|
(sleep 0.1)
|
|
)
|