web/server: stop server via shutdown, using unwind-protect
This commit is contained in:
parent
c3f4c20a75
commit
10948ef009
2 changed files with 12 additions and 9 deletions
|
@ -19,6 +19,8 @@
|
|||
(let ((t:*test-suite* (t:test-suite "web"))
|
||||
(*config* nil))
|
||||
(load (t:test-path "config-web" "etc"))
|
||||
(unwind-protect
|
||||
(progn
|
||||
(core:setup-services *config*)
|
||||
(let ((server (core:find-service :server))
|
||||
(client (core:find-service :client)))
|
||||
|
@ -26,8 +28,8 @@
|
|||
(sleep 0.1)
|
||||
(test-fileserver client)
|
||||
(test-message client)
|
||||
(sleep 0.1)
|
||||
(server:stop (core:find-service :server))
|
||||
(sleep 0.1)))
|
||||
(core:shutdown)
|
||||
(t:show-result))))
|
||||
|
||||
(deftest test-server-config (server)
|
||||
|
|
|
@ -14,6 +14,7 @@
|
|||
(defclass config (config:base)
|
||||
((config:env-slots :initform '(address port))
|
||||
(config:setup :initform #'setup)
|
||||
(config:shutdown :initform #'stop)
|
||||
(address :reader address :initarg :address :initform "localhost")
|
||||
(port :reader port :initarg :port :initform "8888")
|
||||
(routes :reader routes :initarg :routes :initform nil)))
|
||||
|
|
Loading…
Add table
Reference in a new issue