[erlang-questions] Design strategies for a test suite

Richard Carlsson <>
Sat May 17 17:30:40 CEST 2008


John Haugeland wrote:
>     If you use eunit, you can:
>      - Write internal test functions that are automatically exported
>       (you don't have to write -export() declarations for them), but
>       which disappear when you compile with testing disabled.
> 
> Do you happen to know how this is implemented?  I confess this actually 
> sounds a whole lot like the macro compile solution suggested earlier, 
> but I'm curious whether someone else has found a different way.

It is, but with the extra twist of parse transforms that automatically
export test functions (detected based on naming conventions). You could
reuse that code if you want (it's LGPL).

> I'd appreciate someone else's perspective on what exactly constitutes 
> "neat" from the perspective of a testing suite.  The reason I'm 
> implementing my own is to get some functionality that I haven't found in 
> any other erlang test suites (with the exception of a commercial suite, 
> but Mine Shall Be Free (tm)).

Well, feel free to come with suggestions about features that I could add
to eunit (within reason - I won't try to compete with QuickCheck).

     /Richard



More information about the erlang-questions mailing list