Unit testing Eunit超时不';行不通

Unit testing Eunit超时不';行不通,unit-testing,erlang,Unit Testing,Erlang,我试图在文件夹中使用eunit运行所有单元测试,但似乎超时总是重置为5秒 e、 g 模块: -module(example). -include_lib("eunit/include/eunit.hrl"). main_test() -> % sleep for 10 seconds ?assertEqual(true, begin timer:sleep(10000), true end). 命令行: Eshell V5.7.3 (abort with ^G) 1&

我试图在文件夹中使用eunit运行所有单元测试,但似乎超时总是重置为5秒

e、 g

模块:

-module(example).
-include_lib("eunit/include/eunit.hrl").

main_test() ->
    % sleep for 10 seconds
    ?assertEqual(true, begin timer:sleep(10000), true end).
命令行:

Eshell V5.7.3  (abort with ^G)
1> c(example).
{ok,example}
2> eunit:test({timeout, 15, example}).
  Test passed.
ok
3> eunit:test({timeout, 15, {dir, "."}}).
example: main_test (module 'example')...*timed out*
undefined
=======================================================
  Failed: 0.  Skipped: 0.  Passed: 0.
One or more tests were cancelled.
error

如您所见,运行
{timeout,15,example}
可以工作,但不能运行
{timeout,15,{dir,“}
。有人有线索吗?

对我来说,这很有意义:整个目录的超时可能与单个测试的超时无关

我会这样写测试:

main_test_() ->
    % sleep for 10 seconds
    {timeout, 15, ?_assertEqual(true, begin timer:sleep(10000), true end)}.
(添加下划线是为了创建一个测试表达式而不是测试本身;这都在中。我认为不可能以任何其他方式在测试本身中指定超时。)