From 06890e2395fc25ba3bddcc4fe7cef3c41e4dcf95 Mon Sep 17 00:00:00 2001 From: Jaidyn Ann <10477760+JadedCtrl@users.noreply.github.com> Date: Fri, 31 May 2024 12:10:29 -0500 Subject: [PATCH] Ensure testing HTTP server dies, even post-error --- t/mirror-img.lisp | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/t/mirror-img.lisp b/t/mirror-img.lisp index 227232f..d3548cd 100644 --- a/t/mirror-img.lisp +++ b/t/mirror-img.lisp @@ -27,15 +27,21 @@ (asdf:system-relative-pathname :mirror-img/tests path)) (defun run () + "Run all tests for the mirror-img package." (let* ((doc-root (relative-pathname "t/testing-website/")) (acceptor (make-instance 'hunchentoot:easy-acceptor :port 4242 :document-root doc-root)) (server (hunchentoot:start acceptor))) - (lisp-unit2:with-summary () - (run-tests :package :mirror-img/tests) - (hunchentoot:stop server)))) + (lisp-unit2:with-summary () + (handler-case + (progn + (run-tests :package :mirror-img/tests) + (hunchentoot:stop server)) + (error (c) + (hunchentoot:stop server) + c))))) (define-test mirror-img (:tags '(mirror-img)) (assert-eq 'T