From rpgoldman at sift.info Mon Sep 10 18:53:44 2012 From: rpgoldman at sift.info (Robert Goldman) Date: Mon, 10 Sep 2012 13:53:44 -0500 Subject: [fiveam-devel] patch to RESULTS-STATUS Message-ID: <504E3738.2020208@sift.info> RESULTS-STATUS tells you if there are any non-"TEST-PASSED" results. But it doesn't provide any way for you to get your hands on these results. Originally, I thought that one could simply test for them, but the results categories aren't actually exported from FiveAM, so this is difficult. To make it easier to find "interesting" results, I modified RESULTS-STATUS to return a second value. The first value is a boolean, as before, telling you if the tests all passed. If they didn't, the second value is now a list of the non-passing results. I believe this to be a benign change from the standpoint of backward compatibility, since anyone just looking for a single return value will get the same boolean value as before. It's possible that the actual value --- not interpreted as a boolean --- will be different, since the new code uses REMOVE-IF instead of EVERY. But if a caller takes information out of the results list in a function whose documentation proclaims it to be boolean, I submit that the caller is doing so at his/her own risk! Proposed patch is attached. Best, Robert -------------- next part -------------- Index: src/run.lisp =================================================================== --- src/run.lisp (revision 989) +++ src/run.lisp (revision 990) @@ -115,10 +115,13 @@ (defmethod resolve-dependencies ((depend (defun results-status (result-list) "Given a list of test results (generated while running a test) return true if all of the results are of type TEST-PASSED, - faile otherwise." - (every (lambda (res) + fail otherwise. + Returns a second value, which is the set of non-passed tests." + (let ((non-passed + (remove-if #'(lambda (res) (typep res 'test-passed)) - result-list)) + result-list))) + (values (not non-passed) non-passed))) (defun return-result-list (test-lambda) "Run the test function TEST-LAMBDA and return a list of all