summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorFred Hebert <mononcqc@ferd.ca>2018-04-20 18:31:26 -0700
committerGitHub <noreply@github.com>2018-04-20 18:31:26 -0700
commitd4c529a4702128761f7919a81b7ce88bf39809d9 (patch)
tree14100e1e27189f9eb6ed89301d9d1b21ac640779 /src
parent1a07624457fec031e248589e3324f275bc318beb (diff)
parent543fe579a6d7c71fb4ed6a898540b573f6255dd0 (diff)
Merge pull request #1759 from ferd/fix-erlopts-test-profile
Fix precedence rules of erl_opts for test profile
Diffstat (limited to 'src')
-rw-r--r--src/rebar3.erl6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/rebar3.erl b/src/rebar3.erl
index 80b4e4d..eb5ad58 100644
--- a/src/rebar3.erl
+++ b/src/rebar3.erl
@@ -389,7 +389,11 @@ state_from_global_config(Config, GlobalConfigFile) ->
rebar_state:providers(rebar_state:new(GlobalConfig3, Config), GlobalPlugins).
test_state(State) ->
- ErlOpts = rebar_state:get(State, erl_opts, []),
+ %% Fetch the test profile's erl_opts only
+ Opts = rebar_state:opts(State),
+ Profiles = rebar_opts:get(Opts, profiles, []),
+ ProfileOpts = proplists:get_value(test, Profiles, []),
+ ErlOpts = proplists:get_value(erl_opts, ProfileOpts, []),
TestOpts = safe_define_test_macro(ErlOpts),
[{extra_src_dirs, ["test"]}, {erl_opts, TestOpts}].