Wed Apr 15 14:36:50 EDT 2009  Russ Tyndall <russ@acceleration.net>
  * A bunch of changes to make running lift interactively a more useful experience
  by ensuring that the call stack and any arguements are avaialable at the debugger.
  
   * Made handler-bind condition binding lambdas have optional condition args
      since when invoked from the debugger, they do not get the condition
     (which it self signals another error).  Also added a restart for run-next-test
   * use handler bind instead of handler case in while-measuring, so that we get the stack in the invoked debugger
   * replaces a handler-case with a handler-bind, with mostly equivalent functionality
   * added the report arguments to the conditions, so that they are inspectable in the debugger
   * pass (not *test-break-on-errors?*) to while-measuring instead of always T
  

Tue Jun  9 10:13:59 EDT 2009  Russ Tyndall <russ@acceleration.net>
  * added current suite / test to each ensure generated error message

Thu Jan 28 14:07:00 EST 2010  Russ Tyndall <russ@acceleration.net>
  * Made report args get passed in the appropriate slot of the condition object

New patches:

[A bunch of changes to make running lift interactively a more useful experience
Russ Tyndall <russ@acceleration.net>**20090415183650
 by ensuring that the call stack and any arguements are avaialable at the debugger.
 
  * Made handler-bind condition binding lambdas have optional condition args
     since when invoked from the debugger, they do not get the condition
    (which it self signals another error).  Also added a restart for run-next-test
  * use handler bind instead of handler case in while-measuring, so that we get the stack in the invoked debugger
  * replaces a handler-case with a handler-bind, with mostly equivalent functionality
  * added the report arguments to the conditions, so that they are inspectable in the debugger
  * pass (not *test-break-on-errors?*) to while-measuring instead of always T
 
] {
hunk ./dev/lift.lisp 211
 		     (possible-matches c)))))
 
 (define-condition test-condition (warning) 
-                  ((message :initform ""
-                            :initarg :message
-                            :accessor message))
+  ((message :initform ""
+	    :initarg :message
+		     :accessor message)
+   (report-args :accessor report-args :initarg :report-args :initform nil))
   (:report (lambda (c s)
              (when (message c)
                (format s "~%~A" (message c))))))
hunk ./dev/lift.lisp 511
                                    :first-value value-1
                                    :second-value value-2
                                    :test test
+				   :report-args arguments
                                    :message (when report
                                               (apply #'format nil 
 						     report arguments)))))
hunk ./dev/lift.lisp 525
                                    :first-value value-1
                                    :second-value value-2
                                    :test test
+				   :report-args arguments
                                    :message (when report
                                               (apply #'format nil 
 						     report arguments)))))
hunk ./dev/lift.lisp 544
 	    (destructuring-bind ,vars ,(if single-var-p `(list ,case) case)
 	      (restart-case
 		  (progn ,@body)
-		(ensure-failed (cond)
+		(ensure-failed (&optional cond)
 		  (push (list ,case cond) ,problems)))))
        (if ,problems
 	 (let ((condition (make-condition 
hunk ./dev/lift.lisp 1360
 		  result)
 	     ;; cleanup
 	     (testsuite-teardown suite result)))
-       (ensure-failed (condition) 
+       (ensure-failed (&optional condition) 
 	 (report-test-problem
 	  'testsuite-failure result suite 
 	  *current-test-case-name* condition))
hunk ./dev/lift.lisp 1587
 		      (setup-test suite)
 		      (setf (current-step suite) :testing)
 		      (multiple-value-bind (result measures error-condition)
-			  (while-measuring (t measure-space measure-seconds)
+			  (while-measuring ((not *test-break-on-errors?*) measure-space measure-seconds)
 			    (lift-test suite name))
 			(declare (ignore result))
 			(setf error error-condition)
hunk ./dev/lift.lisp 1607
 	      *current-test-case-name* condition)
 	     (if (and *test-break-on-failures?*
 		      (not (testcase-expects-failure-p)))
-		 (invoke-debugger condition)
+		 (when (with-simple-restart (run-next-test "Run the next test")
+			 (invoke-debugger condition))
+		   (go :test-end))
 		 (go :test-end)))
 	   (retry-test () :report "Retry the test." 
 		       (go :test-start)))
hunk ./dev/macros.lisp 62
 	     (,gcatch-errors-p ,catch-errors-p)
 	     ,@vars)
 	 (setf ,gresult
-	       (handler-case 
-		   ,@(measure-1 vars measures)
-		 (error (c)
-		   (setf ,gcondition c)
-		   (unless ,gcatch-errors-p
-		     (error c)))))
+	       (block :here
+		 (handler-bind 
+		     ((error (lambda (c)
+			       (setf ,gcondition c)
+			       (when ,gcatch-errors-p
+				 (return-from :here nil)))))
+		   (progn ,@(measure-1 vars measures)))))
 	 (values ,gresult (list ,@vars) ,gcondition)))))
 
 #+notyet
hunk ./dev/measuring.lisp 53
     `(let ((,ginitial (,measure-fn))
 	   (,gcondition nil))
        (prog1
-	   (handler-case 
-	       (progn ,@body)
-	     (error (c) (setf ,gcondition c)))
+	   (handler-bind 
+	       ((error
+		 (lambda (c) ;; let this perkolate up so that stack traces show in the debugger
+		   (setf ,var (- (,measure-fn) ,ginitial)))))
+	     (progn ,@body))
 	 (setf ,var (- (,measure-fn) ,ginitial))
hunk ./dev/measuring.lisp 59
-	 (when ,gcondition (error ,gcondition))))))
+	 ))))
 
 
 (defmacro measure-time ((var) &body body)
}
[added current suite / test to each ensure generated error message
Russ Tyndall <russ@acceleration.net>**20090609141359] {
hunk ./dev/lift.lisp 217
    (report-args :accessor report-args :initarg :report-args :initform nil))
   (:report (lambda (c s)
              (when (message c)
-               (format s "~%~A" (message c))))))
+               (format s "~%[~a:~a] ~%~A" *current-testsuite-name* *current-test-case-name* (message c))))))
 
 (define-condition test-timeout-condition (test-condition) 
                   ((maximum-time :initform *test-maximum-time* 
hunk ./dev/lift.lisp 224
                                  :accessor maximum-time
                                  :initarg :maximum-time))
   (:report (lambda (c s)
-             (format s "Test ran out of time (longer than ~S-second~:P)" 
+             (format s "Test [~a:~a] ran out of time (longer than ~S-second~:P)"
+		     *current-testsuite-name* *current-test-case-name*
                      (maximum-time c)))))
 
 (define-condition ensure-failed-error (test-condition) 
hunk ./dev/lift.lisp 233
                               :accessor assertion
                               :initarg :assertion))
   (:report (lambda (c s)
-             (format s "Ensure failed: ~S ~@[(~a)~]" 
+             (format s "Ensure failed [~a:~a]: ~S ~@[(~a)~]"
+		     *current-testsuite-name* *current-test-case-name*
 		     (assertion c) (message c)))))
 
 (define-condition ensure-null-failed-error (ensure-failed-error)
hunk ./dev/lift.lisp 245
 	      :accessor assertion
 	      :initarg :assertion))
   (:report (lambda (c s)
-             (format s "Ensure null failed: ~s evaluates to ~s ~@[(~a)~]" 
+             (format s "Ensure null failed [~a:~a]: ~s evaluates to ~s ~@[(~a)~]"
+		     *current-testsuite-name* *current-test-case-name*
 		     (assertion c) (value c) (message c)))))
 
 (define-condition ensure-expected-condition (test-condition) 
hunk ./dev/lift.lisp 260
     :initarg :the-condition))
   (:report (lambda (c s)
 	     (let ((the-condition (the-condition c)))
-	       (format s "Expected ~S but got ~S~@[:~_   ~A~]" 
+	       (format s "[~a:~a] Expected ~S but got ~S~@[:~_   ~A~]"
+		       *current-testsuite-name* *current-test-case-name*
 		       (expected-condition-type c)
 		       (type-of the-condition)
 		       (and (typep the-condition 'condition)
hunk ./dev/lift.lisp 273
     :accessor the-condition
     :initarg :the-condition))
   (:report (lambda (c s)
-             (format s "Expected no warnings but got ~S" 
+             (format s "[~a:~a] Expected no warnings but got ~S"
+		     *current-testsuite-name* *current-test-case-name*
                      (the-condition c)))))
 
 (define-condition failed-comparison-condition (test-condition) 
hunk ./dev/lift.lisp 288
 (define-condition ensure-not-same (failed-comparison-condition) 
   ()
   (:report (lambda (c s)
-             (format s "Ensure-same: ~S is not ~S to ~S~@[ (~a)~]"
+             (format s "Ensure-same [~a:~a]: ~S is not ~S to ~S~@[ (~a)~]"
+		     *current-testsuite-name* *current-test-case-name*
                      (first-value c) (test c) (second-value c)
 		     (message c)))))
 
hunk ./dev/lift.lisp 296
 (define-condition ensure-same (failed-comparison-condition) 
   ()
   (:report (lambda (c s)
-             (format s "Ensure-different: ~S is ~S to ~S~@[ (~a)~]"
+             (format s "Ensure-different [~a:~a]: ~S is ~S to ~S~@[ (~a)~]"
+		     *current-testsuite-name* *current-test-case-name*
                      (first-value c) (test c) (second-value c)
 		     (message c)))))
 
hunk ./dev/lift.lisp 307
   (:report (lambda (condition stream)
 	     (format 
 	      stream 
-	      "Ensure-cases: ~d out of ~d cases failed. Failing cases are:"
+	      "Ensure-cases [~a:~a]: ~d out of ~d cases failed. Failing cases are:"
+	      *current-testsuite-name* *current-test-case-name*
 	      (length (slot-value condition 'problems))
 	      (slot-value condition 'total))
 	     (format 
hunk ./dev/lift.lisp 320
   ((expected :reader expected :initarg :expected)
    (expected-more :reader expected-more :initarg :expected-more))
   (:report (lambda (c s)
-	     (format s "Test succeeded but we expected ~s (~s)"
+	     (format s "[~a:~a] Test succeeded but we expected ~s (~s)"
+		     *current-testsuite-name* *current-test-case-name*
 		     (expected c)
 		     (expected-more c)))))
 
}
[Made report args get passed in the appropriate slot of the condition object
Russ Tyndall <russ@acceleration.net>**20100128190700
 Ignore-this: 3ac908017df11f8dd43e6892dfe8c59e
] {
hunk ./dev/lift.lisp 359
 
     Warning: Ensure failed: (= 23 12) (I hope 12 does not = 23)
 "
-  (let ((gpredicate (gensym)))
+  (let ((gpredicate (gensym "predicate"))
+	(gargs (gensym "args")))
     `(let ((,gpredicate ,predicate))
        (if ,gpredicate
 	   (values ,gpredicate)
hunk ./dev/lift.lisp 364
-	   (let ((condition (make-condition 
-			     'ensure-failed-error 
-			     :assertion ',predicate
-			     ,@(when report
-				     `(:message 
-				       (format nil ,report ,@arguments))))))
+	   (let* ((,gargs (list ,@arguments))
+		  (condition (make-condition 
+			      'ensure-failed-error 
+			      :assertion ',predicate
+			      ,@(when report
+				  `(:message 
+				    (apply #'format nil ,report ,gargs)))
+			      :report-args ,gargs)))
 	     (if (find-restart 'ensure-failed)
 		 (invoke-restart 'ensure-failed condition) 
 		 (warn condition)))))))
}

Context:

[TAG version-1.7.0
Gary King <gwking@metabang.com>**20090307211551] 
[bump version
Gary King <gwking@metabang.com>**20090307211539] 
[catch errors more nicely when reporting
Gary King <gwking@metabang.com>**20090307211514] 
[be a bit more careful about accumulating test results
Gary King <gwking@metabang.com>**20090307211502] 
[WARNING: simplified ensure-cases to make singleton variable use easier -- incompatible change
Gary King <gwking@metabang.com>**20090307211343] 
[ensure-same and ensure-different need to raise different conditions on failure
Gary King <gwking@metabang.com>**20090307211309] 
[pulled ensure-string out into its own function; simplified liftpropos
Gary King <gwking@metabang.com>**20090307211227] 
[typo in docstring
Gary King <gwking@metabang.com>**20090307211121] 
[Reworked the determination of report-pathname.
Gary King <gwking@metabang.com>**20090307210933] 
[don't include docs, take four
Gary King <gwking@metabang.com>**20090127003007] 
[don't include docs, take three
Gary King <gwking@metabang.com>**20090127002815] 
[don't include docs, take two
Gary King <gwking@metabang.com>**20090127002521] 
[TAG version-1.6.1
Gary King <gwking@metabang.com>**20090127000836] 
[bump version
Gary King <gwking@metabang.com>**20090126223840] 
[remove documentation system to prevent SBCL's asdf install from screaming
Gary King <gwking@metabang.com>**20090126223757] 
[use keywords for name instead of symbols
Gary King <gwking@metabang.com>**20090126223727] 
[divide result by delay to give count per second
Gary King <gwking@metabang.com>**20090126223710] 
[Use parameter, not special for report-pathname
Gary King <gwking@metabang.com>**20090126223652] 
[fix typo
Gary King <gwking@metabang.com>**20090126223635] 
[catch ambiguous names in make-testsuite
Gary King <gwking@metabang.com>**20090126223613] 
[other website tomfoolery
Gary King <gwking@metabang.com>**20090126223505] 
[Remove some old cruft from the website directory
Gary King <gwking@metabang.com>**20090126223429] 
[Added ignore-multiple-values? to ensure-same and ensure-different
Gary King <gwking@metabang.com>**20090126223344] 
[TAG version-1.6.0
Gary King <gwking@metabang.com>**20081026164144] 
[bump version
Gary King <gwking@metabang.com>**20081026164120] 
[Tweak standard configuration
Gary King <gwking@metabang.com>**20081026164054] 
[Fix test-test-suite-with-no-tests (correct the name it uses).
Gary King <gwking@metabang.com>**20081026164037] 
[add a little flexibility to unique-filename and improve error message when one cannot be generated with the limit provided.
Gary King <gwking@metabang.com>**20081026164009] 
[fix glitch that could cause the ensure-directories-exist call to be skipped.
Gary King <gwking@metabang.com>**20081026163931] 
[improve tests for maximum-error-count and maximum-failure-count (the issue is that it gets tricky to test these without also prematurely ending the test-suite!
Gary King <gwking@metabang.com>**20081026163823] 
[document and export *current-asdf-system-name*
Gary King <gwking@metabang.com>**20081026163554] 
[more website tweaks
Gary King <gwking@metabang.com>**20081026163515] 
[Fix bug wherein slots with a non-nil initform could not be set with an initarg
Gary King <gwking@metabang.com>**20081026005315] 
[Add the (currently unused) documentation argument to defmeasure
Gary King <gwking@metabang.com>**20081026005234] 
[cleanup
Gary King <gwking@metabang.com>**20081026005202] 
[lift documentation with docudown system
Gary King <gwking@metabang.com>**20081026005146] 
[cleanup package definition
Gary King <gwking@metabang.com>**20081026005106] 
[documentaton and docstrings
Gary King <gwking@metabang.com>**20081026005026] 
[Added *maximum-errors* and *maximum-failures* configuration variables
Gary King <gwking@metabang.com>**20081026004956] 
[Added documentation system
Gary King <gwking@metabang.com>**20081026004846] 
[Website changes
Gary King <gwking@metabang.com>**20081026004833] 
[Some internal documentation
Gary King <gwking@metabang.com>**20081026004821] 
[Case 168 - added test
Gary King <gwking@metabang.com>**20081019190709] 
[Moved a bunch of utility like functions from lift.lisp to utility,lisp
Gary King <gwking@metabang.com>**20081019190637] 
[Case 208: Added *test-maximum-error-count* and *test-maximum-failure-count*; at the same time, I've added helper macros to make defining configuration variables and such easier (and to eventually make it possible to define a documentation strategy on them...)
Gary King <gwking@metabang.com>**20081019181612] 
[Finish removing initialize-test
Gary King <gwking@metabang.com>**20081019173917] 
[Case 199: dynamic-variables now are declared as special; this means that they no longer need to be defined in the  environment but can be one-offs. Also added tests to make sure that continues to hold in the future.
Gary King <gwking@metabang.com>**20081019141321] 
[Refactored ensure-same and ensure-different to share most of their code; also corrected case 204 so that both ensures can work with flets, labels, and also support functions that predicates. Good stuff.
Gary King <gwking@metabang.com>**20081019133256] 
[cleanup report file location; try to use index when we can
Gary King <gwking@metabang.com>**20081018140209] 
[clisp doesn't like :unspecific
Gary King <gwking@metabang.com>**20081018140059] 
[Added website/website.tmproj
Gary King <gwking@metabang.com>**20081018135100] 
[Comment and cruft cleanup
Gary King <gwking@metabang.com>**20081018134918] 
[Better .boring file
Gary King <gwking@metabang.com>**20081018134852] 
[Added with-timeout copying to build system so that I can share that code; reworked system file to match
Gary King <gwking@metabang.com>**20081018134703] 
[Moved stuff from reports to other files; exported new defmeasure stuff
Gary King <gwking@metabang.com>**20081018134541] 
[Pulled in form-symbol and friends from metatilities. Used in macros
Gary King <gwking@metabang.com>**20081018134437] 
[formatting improvements (?) to report problems
Gary King <gwking@metabang.com>**20081018134317] 
[Reworked *test-environment* code to be more sane
Gary King <gwking@metabang.com>**20081018134247] 
[Moved slot initialization from initialize-test (which has vanished) to setup-test. This changes the order of some operations but in, I think, a good way.
Gary King <gwking@metabang.com>**20081018134051] 
[Simplified deftestsuite somewhat
Gary King <gwking@metabang.com>**20081018133950] 
[ensure-cases correctly returns  when all cases pass
Gary King <gwking@metabang.com>**20081018133856] 
[Added macros.lisp (and moved many macros into it)
Gary King <gwking@metabang.com>**20081018133708] 
[Make profiling more generic so that maybe soon I can get sbcl and other Lisps working
Gary King <gwking@metabang.com>**20081018133501] 
[Refactor run-test, etc. to use new measuring code, etc. Lots of smoke, maybe a little fire
Gary King <gwking@metabang.com>**20081018133243] 
[Some code cleanup and renaming (e.g., s/teardown-test/test-case-teardown/g
Gary King <gwking@metabang.com>**20081018133016] 
[removed 'prototypes' (since I never finished implementing them and they just complicate things; also removed initialize-test
Gary King <gwking@metabang.com>**20081018132801] 
[Improved output of ensure-cases slightly
Gary King <gwking@metabang.com>**20081018132622] 
[Refactored ensure-no-same and ensure-same conditions using failed-comparison-condition
Gary King <gwking@metabang.com>**20081018132510] 
[Removed the complex slot processing stuff (that came in from defclass-star a _long_ time ago).
Gary King <gwking@metabang.com>**20081018132240] 
[added some beauty to liftpropos
Gary King <gwking@metabang.com>**20081018132203] 
[Added :trace and :untrace configuration options
Gary King <gwking@metabang.com>**20081018132046] 
[Converted errors to warning so that configuration file glitches won't kill testing
Gary King <gwking@metabang.com>**20081018132005] 
[added tests that mistakes in configuration files won't kill testing
Gary King <gwking@metabang.com>**20081018131911] 
[Moved some notes from reports.lisp to calling.md
Gary King <gwking@metabang.com>**20081018030100] 
[Removing the old 'with-timeout' file
Gary King <gwking@metabang.com>**20080906202343] 
[Added timeout directory for with-timeout files (that get copied here in the metabang build process)
Gary King <gwking@metabang.com>**20080906202311] 
[TAG version-1.5.2
Gary King <gwking@metabang.com>**20080627023425] 
[rename things to be more self-consistent
Gary King <gwking@metabang.com>**20080627023332] 
[fix a few warnings for missing generics
Gary King <gwking@metabang.com>**20080627023317] 
[Add with-timeout.lisp to the repository -- ouch!
Gary King <gwking@metabang.com>**20080627021113] 
[TAG version-1.5.1
Gary King <gwking@metabang.com>**20080624213602] 
[bump version
Gary King <gwking@metabang.com>**20080624213547] 
[Moved with-timeout stuff out of port and into with-timeout.lisp (which is semi-shared with trivial-shell). This also adds in Lars Rune Nstdal's fix for my miscall to error (see http://paste.lisp.org/display/62686)
Gary King <gwking@metabang.com>**20080624213439] 
[Move export from lift.lisp into the defpackage form
Gary King <gwking@metabang.com>**20080624213258] 
[updates tests (and fix a typo) for changes in find-testsuite
Gary King <gwking@metabang.com>**20080621003155] 
[TAG version-1.5.0
Gary King <gwking@metabang.com>**20080621000206] 
[bumped version
Gary King <gwking@metabang.com>**20080621000157] 
[Implemented with-timeout for threadless sbcl using sbcl's timers
Gary King <gwking@metabang.com>**20080621000110] 
[Improved while-counting-repititions macro (now with more gensyms)
Gary King <gwking@metabang.com>**20080621000033] 
[Added testsuite-ambiguous (really part of case 165)
Gary King <gwking@metabang.com>**20080620235950] 
[Added errorp keyword arguments to find-testsuite, find-test-case and find-testcases (case 165)
Gary King <gwking@metabang.com>**20080620235800] 
[TAG version-1.4.7
Gary King <gwking@metabang.com>**20080608012359] 
[Fix typo s/defmethod/defgeneric/
Gary King <gwking@metabang.com>**20080608012351] 
[TAG version-1.4.7
Gary King <gwking@metabang.com>**20080608012246] 
[bump version
Gary King <gwking@metabang.com>**20080608012234] 
[Corrected some silly code errors (Thanks SBCL)
Gary King <gwking@metabang.com>**20080608012205] 
[Pulled code out of lift.lisp into utilities.lisp and introspection.lisp
Gary King <gwking@metabang.com>**20080608012144] 
[Pulled code out of lift.lisp into utilities.lisp and introspection.lisp
Gary King <gwking@metabang.com>**20080608012111] 
[Added more defgeneric stubs to prevent SBCL warnings (also moved a few things around for the same reason)
Gary King <gwking@metabang.com>**20080608012001] 
[TAG version-1.4.6
Gary King <gwking@metabang.com>**20080607233035] 
[bump version
Gary King <gwking@metabang.com>**20080607233025] 
[ccl port : with-timeout for openmcl / mcl / ccl has been lame for half past forever; fixing at last
Gary King <gwking@metabang.com>**20080607230248] 
[ccl port: muck with some ignore / ignorable declarations
Gary King <gwking@metabang.com>**20080607230220] 
[TAG version-1.4.5
Gary King <gwking@metabang.com>**20080606140530] 
Patch bundle hash:
1daf478f0b259c211b11869d1be44f30a6caa07e
