`
poller
  • 浏览: 20265 次
  • 性别: Icon_minigender_1
  • 来自: 北京
最近访客 更多访客>>
社区版块
存档分类
最新评论
文章列表
实现代码覆盖关键在于erlang中cover,他的实现机制是对module进行再编译,实际上就是加上了自己的統計方法.然后通过cover:analyse(Module)返回統計結果. 一个简单例子: 利用EUnit进行自动化測試,以unit_start为例: -module(eunit_start). -include_lib("eunit/include/eunit.hrl"). reverse_test() -> ?assert(1 + 1 =:= 2). 执行: cover:compile(unit_start), unit_start:test(), cove ...
EUnit是一个对Erlang轻量級的单元測試框架. 一、如何在Erlang中应用EUnit? 1、引入EUnit的头文件,分3种方法(任选其一). (1). 在要用单元測試的每一个module中引入 -include_lib("eunit/include/eunit.hrl"). (2). 启动Eralng時指定Eunit路径 erlc -pa "path/to/eunit/ebin" $(ERL_COMPILE_FLAGS) -o$(EBIN) $< (3). 在$HOME/.erlang中加入 code:add_path("/pa ...
     很早就想写blog了,但在写在哪的問題上徘徊了許久.最終还是选择了javaeye.望大家多关注我,对我写的文章批評指証,当然如果我的文章能对你有些許帮助的話,那将是我最大的荣誉。
Global site tag (gtag.js) - Google Analytics