On Sun, 8 Dec 2002, stktrc wrote:
> But would it be possible to dynamically instantiate test cases?
> For example, in Java you could have a test interface. The main
> program would then instantiate a class implementing the test interface
> from each file in a file system directory (I believe this falls under
> reflection). This way the specific test cases are not hard-wired into
> the main program.
> Could this be done with S48 modules? Am I comparing apples with
> oranges? What would the correct way be to achieve this?
Well, I think you can open or define structures directly from code,
if you import the bindings of DEFINE-STRUCTURE etc. I never needed to do
so myself and therefore cannot give detailed instructions, but Richard
Kelsey's post in scsh.net > docu > how-to addresses related issues, cf.
However, I doubt that modules make for good testing fixtures. At least,
these would require a much finer granularity than the modules in the scsh
system have. And I believe there are more straightforward implementations
by classical schemely means. I would have a look at the existing Scheme
unit testing frameworks and steal suitable ideas, or port a good one to
Scheme 48 / Scsh. (Indeed, I planned to do so myself ... next year.)