[erlang-questions] Application environment

Éric Pailleau <>
Wed May 27 22:55:18 CEST 2015


Hi,
See process_win function in this file :
https://github.com/erlang/otp/blob/master/lib/observer/test/observer_SUITE.erl

An example of temporary app env variable overriding... 
Regards


Le 27 mai 2015 22:39, Serge Aleynikov <> a écrit :
>
> I run into an issue while trying to fix a test case in this pull request:
> https://github.com/erlang/otp/pull/713
>
> Is it possible to override application's startup environment dynamically if its *.app file contains an {env, [...]} clause?
>
> I had the following in the test case, in which my {file, File} setting would get discarded:
>
>     SaslEnv = application:get_all_env(sasl),
>
>     lists:foreach(fun({E,_V}) -> application:unset_env(sasl,E) end, SaslEnv),
>
>
>
>     ok = application:set_env(sasl,sasl_error_logger,{file, File}),
>
>     ok = application:start(sasl),
>
> Serge


More information about the erlang-questions mailing list