Saturday, September 15, 2007

Working on FReT again

I've finally started work on FReT again. I want to actually start using it. Seems like such a waste to have put so much effort into getting so far, and then not being able to use it. I have yet to implement an essential feature of the software: being able to run a test suite/script through an ASDF operation. The ASDF operation must run an operation after a load has been performed on an instance of a module. For example, we would define a test definition for FReT itself as follows:

(defsystem fret-test
:class fret:system
:components ((:module test-support
:components ((:file "framework-tests-support"))))
:test-script fret::fret-test-script
:depends-on (fret))
Then, calling (asdf:operate 'fret:fret-op 'fret-test) should execute the test suite. fret:fret-op would be a subclass of asdf:load-op, and would only define an after method on whatever generic function signaled the completion of loading a testable module, in this case fret-test itself. I could have done without subclassing load-op, but then I would not be able to do a straight load.

The model here is that a system would be able to add a test suite into the primary system definition if it only had a set of simple tests. If the tests required any support code (as FReT's tests do) then we would have to introduce a separate system. Another reason we need to separate out the tester system for FReT is that the tester system cannot be declared without FReT. It is the only piece of software which would run into such a bootstrapping problem.

At present though it appears ASDF does not signal the completion of loading a module through any generic function. So I cannot know when I should run the test suite for a module, as I don't know when it has finished loading. I've posted a message on the mailing list asking for advice, as soon as I have some I'll be able to finish up my implementation.


No comments:

Post a Comment