eunit

Ensure epmd started

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-01 05:49:01
问题 I have an eunit test that generates a unique node name and starts distribution: {A,B,C} = now(), Nodename = list_to_atom(lists:flatten(io_lib:format( "test-~b-~b-~b@localhost", [A, B, C]))), {ok, _} = net_kernel:start([Nodename, shortnames]), This works fine as long as a distributed Erlang node has been running on the machine at some previous time, and thus epmd is still running, but on the build server I can't assume that's the case. I solved the problem by adding this to my test: _ = os:cmd

Getting test results from Eunit in Erlang

佐手、 提交于 2019-11-30 23:04:14
I am working with Erlang and EUnit to do unit tests, and I would like to write a test runner to automate the running of my unit tests. The problem is that eunit:test/1 seems to only return "error" or "ok" and not a list of tests and what they returned in terms of what passed or failed. So is there a way to run tests and get back some form of a data structure of what tests ran and their pass/fail state? If you are using rebar you don't have to implement your own runner. You can simply run: rebar eunit Rebar will compile and run all tests in the test directory (as well as eunit tests inside your

Getting test results from Eunit in Erlang

◇◆丶佛笑我妖孽 提交于 2019-11-30 17:43:40
问题 I am working with Erlang and EUnit to do unit tests, and I would like to write a test runner to automate the running of my unit tests. The problem is that eunit:test/1 seems to only return "error" or "ok" and not a list of tests and what they returned in terms of what passed or failed. So is there a way to run tests and get back some form of a data structure of what tests ran and their pass/fail state? 回答1: If you are using rebar you don't have to implement your own runner. You can simply run