我通过rebar3
模板创建了一个简单的应用程序,例如:
apps/myapp/app/myapp_app.erl
-module(myapp_app).
-behaviour(application).
-export([start/2, stop/1]).
start(_StartType, _Params) ->
ok.
stop(_State) ->
ok.
我为此写了一个测试:
apps/myapp/test/myapp_test.erl
-module(myapp_test).
-include_lib("eunit/include/eunit.hrl").
simple_test() ->
myapp_app:start(ok, 42).
可悲的是,当我启动测试时,两个文件之间的链接似乎没有完成:
$ rebar3 eunit
===> Verifying dependencies...
===> Compiling shoreline
===> Performing EUnit tests...
F
Failures:
1) myapp_test:simple_test/0
Failure/Error: {error,undef,
[{myapp_app,start,"*",[]},
{myapp_test,simple_test,0,
[{file,
"/.../apps/myapp/test/myapp_test.erl"},
{line,8}]},
{myapp_test,simple_test,0,[]}]}
Output:
Finished in 0.074 seconds
1 tests, 1 failures
===> Error running tests
有什么要补充的rebar.config
吗?