[erlang-questions] Eunit controls

5 views
Skip to first unread message

Nicolas Thauvin

unread,
Jan 18, 2011, 3:50:11 PM1/18/11
to erlang-q...@erlang.org
Hi,

While trying to make use of Eunit controls in rebar
(http://www.erlang.org/doc/apps/eunit/chapter.html#Control), 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
specification?

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

________________________________________________________________
erlang-questions (at) erlang.org mailing list.
See http://www.erlang.org/faq.html
To unsubscribe; mailto:erlang-questio...@erlang.org

Reply all
Reply to author
Forward
0 new messages