如何在rebar3配置中更改eunit的超时?
当我运行基于属性的Triq测试时,我的eunit运行程序正在超时:
===> Verifying dependencies...
===> Compiling ierminer
===> Performing EUnit tests...
Pending:
test_ec:ec_prop_test/0
%% Unknown error: timeout
undefined
%% Unknown error: {blame,[3,1]}
Finished in ? seconds
3 tests, 0 failures, 3 cancelled
===> Error running tests这是我的财产规格:
-module(ec_property).
-include_lib("triq/include/triq.hrl").
prop_append() ->
?FORALL({Xs,Ys},{list(int()),list(int())},
lists:reverse(Xs++Ys)
==
lists:reverse(Ys) ++ lists:reverse(Xs)).
prop_valid_started() ->
?FORALL({Type, Items, Size},
{oneof([left,right]), non_empty(list(any())), pos_integer()},
element(1, ec:start(Type, Items, Size)) == ok).下面是我如何从eunit测试函数调用它:
ec_prop_test() -> ?assert(ec_property:check()).发布于 2016-04-05 20:12:09
使用测试发生器函数指定超过默认5秒的超时时间:
ec_prop_test_() ->
{timeout, 30, ?_assert(ec_property:check())}.注意添加到函数名称中的尾下划线--这就是您创建测试生成器的方式。还请注意_assert上的前面下划线,这是创建测试对象的一种方法。
将示例中的30更改为所需的任何秒数。
https://stackoverflow.com/questions/36434911
复制相似问题