passing runtime arguments to erlang when running rebar eunit

Deadly 提交于 2019-12-06 07:35:00

I answered my own question. I use the ERL_FLAGS variable to pass command line args. Here is a snippet from my Makefile:

ERL_FLAGS="-args_file test/conf/vm.eunit.args" ./rebar skip_deps=true eunit

The first method is satisfied with your restriction: 1. in your eunit test function, to use erlang's "os:cmd("erl -name bar -detached arguments")." to start another erlang node. In the arguments, you can insert whatever you want. But eunit's check will be difficult because the test will cross the nodes.

The second methods is to change your restriction: 1. To use "configuremnt file" to pass arguments, and not to use command parameter to pass parameters.

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!