[erlang-questions] Module mock-up's

Filippo Pacini pacini@REDACTED
Wed Mar 21 16:37:49 CET 2007


Hi,
I'm not sure this is what you need, but did you look at eunit?
Google for eunit erlang.

For my tests I use a small module I developed when I was learning
erlang. It's enough for most of my needs, though I should really learn
the test_server and yatsy :-)

If you want to take a look download sgte:
http://code.google.com/p/sgte/

It's the file sgeunit.erl in the test/src directory.
In the file you find some test to test itself.

cheers,
filippo


Peter Mechlenborg wrote:
> Hi,
> 
> When writing tests I often find that I want to test the module that I 
> working on, in isolation from the rest of the system.
> In the past I have sometimes created mock-up processes, for the parts of 
> my system that interacts with the module I'm testing.  This works well 
> for some cases, but normally processes are encapsulated by a module, and 
> what I really want to do is to create a mock-up of the module instead of 
> the process.
> 
> I haven't found anything with Google, and before I start trying to 
> implementing a module-mock-up library, I would like to know if anyone 
> have done anything similar, creating mock-up modules?
> 
> I would also like to know if I'm missing something simple - how do you 
> guys normally test Erlang code that depends on other modules, without 
> creating a complete integration test?.  In other words I guess my 
> question is, how to do unit tests at the level of modules en Erlang?
> 
> Sincerely your,
> 
>   --  Peter Mechlenborg



More information about the erlang-questions mailing list