我使用rebar命令"rebar compile eunit“进行eunit测试,但得到一个错误信息:
==> myapp (compile)
==> myapp (eunit)
src/myapp_app.erl:8: badly formed 'include_lib'
src/myapp_app.erl:26: undefined macro 'assertNot/1'
ERROR: eunit failed while processing /Users/Dao/ErlProject/myapp: rebar_abort我真的不知道这是什么意思,谁能告诉我为什么?
附言:我的英语不好,请原谅。
类似这样的myapp_app.erl:
-ifdef(TEST).
-include_lib(“eunit/include/eunit.hrl”).
-endif.
........
-ifdef(TEST).
simple_test() ->
ok = application:start(myapp),
?assertNot(undefined == whereis(myapp_sup)).
-endif.它来自这里:https://github.com/rebar/rebar/wiki/Getting-started
我按照步骤操作,但得到了错误!
我的erlang版本是R15B03
操作系统: OS X Lion
发布于 2013-01-21 10:15:47
根据您提供的代码,我认为问题与您正在使用的双倍数有关。现在,您正在使用某种斜引号,如果我复制并粘贴它,并在测试模块中使用相同的定义,它将生成相同的错误。
你想确保你的双倍值使用“正常”值:
" (ASCII34)而不是”,后者是unicode。
所以改变吧
-include_lib(“eunit/include/eunit.hrl”).至
-include_lib("eunit/include/eunit.hrl").发布于 2013-01-21 02:46:23
请确保以以下方式包含eunit:
-include_lib("eunit/include/eunit.hrl").不用说,请确保您已经安装了eunit。例如,据我所知,在某些Ubuntu版本中,它可能不会默认安装。
https://stackoverflow.com/questions/14426524
复制相似问题