Eunit controls

Nicolas Thauvin <>
Tue Jan 18 21:50:11 CET 2011


  While trying to make use of Eunit controls in rebar  
(, some  
questions arose...
My understanding is that all the test directives are recursive according  
to the @type tests() in eunit_data.erl.

1) Is it correct ?
  -> is {inorder, [{inparallel, [{timeout, 10, [{M,F}]}]}} a valid test  

2) Should modules be supported by the timeout control ?
  -> is {timeout, 10, [foo, bar]} valid ? => does not seem to work despite  
"A module can also be used to represent a test set [...]".

As the rebar building tool is working with modules, that would be great if  
all directives could take modules as arguments... But it does not seem to  
be the case, at least for {timeout, N, ...}.
For example, given two tests with basic timer:sleep(6000) :

* eunit:test([{inparallel, [{timeout, 10, {foo, t1_test}}, {timeout, 10,  
{foo, t2_test}}]}], [verbose]).
foo: t1_test...[6.005 s] ok
foo: t2_test...[6.003 s] ok
=> Timeout rules are applied in the inparallel directive

* eunit:test([{inparallel, [{timeout, 10, foo}]}], [verbose]).
foo: t1_test...*timed out*
=> timeout is ignored

What do you think ? Bug ? Feature ?

-- Nicolas

More information about the erlang-questions mailing list