Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Useful utilities for CL testing.
(in-package :cl-user)
(ql:quickload :cl-test-more)
(defun asdf-component-files (comp)
(etypecase comp
(asdf::cl-source-file
(list (asdf:component-pathname comp)))
(asdf::static-file nil)
(asdf::component
(loop for c in (asdf:module-components comp)
append (asdf-component-files c)))))
(defun run-test-system (name)
(let ((system (asdf:find-system name)))
(map nil #'ql:quickload
(asdf::component-load-dependencies system))
(dolist (file (asdf-component-files system))
(with-open-file
(log-stream
(merge-pathnames (format nil "~A.log" (pathname-name file)) file)
:direction :output
:if-does-not-exist :create
:if-exists :supersede)
(let ((test-more:*test-result-output*
(make-broadcast-stream *standard-output* log-stream))
(*error-output*
(make-broadcast-stream *error-output* log-stream)))
(handler-case (load file)
(error (condition)
(princ condition test-more:*test-result-output*))))))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.