I have read the documentation about EUnit, but still I have no idea what is the purpose of test generators.
I have also read a nice tutorial here, but still no luck (a little too advanced).
I somewhat understand that a test generator function returns a set of tests which are then executed by EUnit. (is that right?)
Unfortunately, the only thing that I am confident about now is that I can write a test like this:
myfun_test() ->
assertEqual(myresult,mymod:myfun()).
The question is: What are the test generators in EUnit needed for and what is their relation with a Simple Test Object?
P.S. I know there is a wonderful world (example) of unit tests which are made with the help of various automation tools and concepts, but I do not know how to enter it.
Reading from the very page you've linked in your question:
Think to test generators as to the possibility of grouping tests. Apart from having more compact code, you can have advanced features for your tests. For example, a state for your set of tests, an initialization function, and so on and so forth.
If what you need for your application is just a set of assertions, well, you probably don't need test sets. You could even avoid using EUnit as a whole. The pattern matching (=) operator in Erlang is a brilliant testing operator in itself. Compare:
with: