Created
October 27, 2011 11:56
-
-
Save fukamachi/1319363 to your computer and use it in GitHub Desktop.
Useful utilities for CL testing.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(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