Pergunta

In my startup script, I am starting erlang with:

erl -args_file vm.args

Currently, while trying to run unit tests with rebar eunit is there a way for me to pass custom runtime arguments such as the -args_file option to the erlang process that rebar kicks off? I have searched docs high and low to no avail...

I appreciate the help.

Foi útil?

Solução

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

Outras dicas

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.

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top