Re: ASDF test-op

Gary King <[email protected]> Tue, 1 Jan 2008 10:28:20 -0500
Newsgroups gmane.lisp.cclan.general
Message-ID <[email protected]>
Hi Robert,

I think that your proposal(s) are both steps in the right direction.  
Just to clarify (and to think out load), there are two issues we'd  
like to solve:

  1. allow ASDF to communicate the results of an operation back to the  
caller
  2. control the stream to which ASDF sends output during an operation

In particular, we'd like to do this for test-ops but other ops could  
also make use of this.

The most general solution might be to

  1. add a generic function:

      (defgeneric output-stream-for-component-and-operation (component  
operation))

  2. add an `output-stream` slot to operation

  3. add an around method to perform

		(defmethod perform :around ((operation operation) (c component))
		  (let ((*standard-output* (output-stream-for-operation-and-component
					    operation component)))
		    (call-next-method)))

  4. and a "default" value for output-stream-for-component-and-operation

		(defmethod output-stream-for-component-and-operation
		    (component operation)
		  *standard-output*)

AFAICT (from an admittedly cursory analysis), these changes would not  
alter anything `downstream` unless and until a new `output-stream-for- 
component-and-operation` method was written.

(There is some danger involved in adding the around method. To  
mitigate against this, I think we should add an new class operation- 
abstract that is the sole superclass of operation and then use that  
for the around method).

On the other hand, this proposal is sort of the opposite of your. You  
use the result stream to modify `cl-user::*nst-default-report-stream*`  
whereas I'm suggesting using `cl-user::*nst-default-report-stream*` to  
modify the result-stream. E.g., by writing:

	(defmethod output-stream-for-component/operation
	    ((component (eql (find-system 'my-system))) (operation test-op))
	  cl-user::*nst-default-report-stream*)

thoughts?


> OK, if it's easy to do this kind of thing with your own subclass of
> asdf:test-op, why should this be put in the standard distribution.  I
> can think of two benefits

< SNIP >

Right on! Testing and being able to run tests and get results should  
not be an afterthought.

--
Gary Warren King, metabang.com
Cell: (413) 559 8738
Fax: (206) 338-4052
gwkkwg on Skype * garethsan on AIM





-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/