-
Including the EUnit header file
-include("eunit/include/eunit.hrl").
test/0, xxx_test(), xxx_test_()
-
Use exceptions to signal failures
Using assert macros
-
eunit:test(Module) <==> Module:test()
Putting tests in seperate modules: m_tests, only eunit:test(Module)
Eunit captures the output: use ?debugMsg(Text), ?debugFmt(FmtStr, Value)
-
Writing test generating functions
?_assert() vs. ?assert()
-
erlc -DNOTEST Module.erl
- Avoiding compile-time dependency on EUnit
-ifdef(TEST).
-include_lib("eunit/include/eunit.hrl").
-endif.
文章转自:http://chuqq.iteye.com/blog/1547056
Erlang单元测试
最新推荐文章于 2020-11-13 14:49:41 发布