erlang-安装配置

Rebar

安装apt-get install rebar
创建项目

mkdir myapp
cd myapp
rebar create-app appid=myapp
touch rebar.config
rebar compile
#清理使用
rebar compile

测试项目
Rebar 支持 EUnit和Common Test测试框架
src/myapp_app.erl添加代码,修改为

-module(myapp_app).

-behaviour(application).

%% Application callbacks
-export([start/2, stop/1]).
%% eunit testing
    -ifdef(TEST).
    -include_lib("eunit/include/eunit.hrl").
    -endif.

%% ===================================================================
%% Application callbacks
%% ===================================================================

start(_StartType, _StartArgs) ->
    myapp_sup:start_link().

stop(_State) ->
    ok.

%% eunit testing
	-ifdef(TEST).

	simple_test() ->
		ok = application:start(myapp),
		?assertNot(undefined == whereis(myapp_sup)).

	-endif.

在rebar.config中加入如下内容

{cover_enabled, true}.

再次运行rebar compile eunit
会生成统计网页.eunit/index.html

idea配置

超级麻烦:
http://www.cnblogs.com/jasonduan/p/5175660.html
http://blog.csdn.net/mycwq/article/details/44181207

posted @ 2017-03-27 17:15  zhangshihai1232  阅读(77)  评论(0)    收藏  举报