From: Mark Wooding Date: Sat, 25 Mar 2017 18:17:53 +0000 (+0000) Subject: src/final.lisp (test-module): By default, just report and count up errors. X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~mdw/git/sod/commitdiff_plain/60529354d9cf7b479605366b103517af44927e02 src/final.lisp (test-module): By default, just report and count up errors. This makes the whole return value thing more useful. You can still get a backtrace (or enter the debugger or whatever) by setting the new BACKTRACE argument. --- diff --git a/doc/misc.tex b/doc/misc.tex index e97fcb0..5ef4d1f 100644 --- a/doc/misc.tex +++ b/doc/misc.tex @@ -568,7 +568,8 @@ These symbols are defined in the @!optparse| package. \begin{describe}{var}{*debugout-pathname*} \end{describe} -\begin{describe}{fun}{test-module @ \&key :reason :clear @> @} +\begin{describe}{fun} + {test-module @ \&key :reason :clear :backtrace @> @} \end{describe} \begin{describe}{fun} diff --git a/src/final.lisp b/src/final.lisp index 0528491..8cd42f8 100644 --- a/src/final.lisp +++ b/src/final.lisp @@ -39,7 +39,7 @@ (export '*debugout-pathname*) (defvar *debugout-pathname* #p"debugout.c") (export 'test-module) -(defun test-module (path &key reason clear) +(defun test-module (path &key reason clear backtrace) "Read a module from PATH, to exercise the machinery. If CLEAR is non-nil, then reset the translator's state before proceeding. @@ -51,7 +51,8 @@ (defun test-module (path &key reason clear) warnings encountered while processing the module." (when clear (clear-the-decks)) (multiple-value-bind (module nerror nwarning) - (count-and-report-errors () (read-module path)) + (if backtrace (read-module path) + (count-and-report-errors () (read-module path))) (when (and module reason) (with-open-file (out *debugout-pathname* :direction :output