[plt-scheme] testing a module

From: Neil W. Van Dyke (neil at neilvandyke.org)
Date: Wed Mar 30 14:06:21 EST 2005

This isn't quite what you asked for, but... for unit tests in R5RS code,
I use Testeez, which has a messy convention for disabling the test suite
(and removing the Testeez dependency) in production code.

    http://www.neilvandyke.org/testeez/

There's a very simple heuristic that an external tool such as DrScheme
could use to locate Testeez tests within a file, but I've not yet had a
need to implement that.

There are a few PLT-specific test case tools, but some of my libraries
get tested on a dozen different Scheme implementations, so Testeez
requires only R5RS.


Chris Wright <c.wright at southernhealth.org.au> writes at 09:46 30-Mar-2005 +1000:
> From: Chris Wright <c.wright at southernhealth.org.au>
> To: plt-scheme at list.cs.brown.edu
> Subject: [plt-scheme] testing a module
> Date: Wed, 30 Mar 2005 09:46:48 +1000
> 
>   For list-related administrative tasks:
>   http://list.cs.brown.edu/mailman/listinfo/plt-scheme
> 
> what is the most sensible way to include tests in a module?
> 
> python uses an idiom where
> 
> if __name__ == '__main__':
>     do_the_tests()
> 
> 
> is placed at the end of a module, and then the module can be called with
> 
>  > python <module-name>
> 
> and do_the_tests() will be executed.
> 
> What's the most sensible way to do this in drscheme? I would expect the 
> test code to be executed when I "ran" the module in the IDE.
> 
> cheers and thanks
> 
> Chris Wright
> 
> 

-- 
                                             http://www.neilvandyke.org/



Posted on the users mailing list.