diff options
author | alisdair sullivan <alisdairsullivan@yahoo.ca> | 2015-01-07 18:31:27 -0800 |
---|---|---|
committer | alisdair sullivan <alisdairsullivan@yahoo.ca> | 2015-01-07 18:31:27 -0800 |
commit | f4dafa4628da045db7b21c90406138baccd7b844 (patch) | |
tree | 096c00eb48387d9d11271fde8e530e2ec2ff42ff /src | |
parent | e5270da3d751605fbb6fbcdfd12ad0d76e1fcfbd (diff) |
switch to `lists:ukeymerge` to merge `ct` opts for better behavior
in presence of keys defined multiple times
Diffstat (limited to 'src')
-rw-r--r-- | src/rebar_prv_common_test.erl | 14 |
1 files changed, 1 insertions, 13 deletions
diff --git a/src/rebar_prv_common_test.erl b/src/rebar_prv_common_test.erl index 65a09ef..50c7cf0 100644 --- a/src/rebar_prv_common_test.erl +++ b/src/rebar_prv_common_test.erl @@ -275,19 +275,7 @@ resolve_ct_opts(State, Opts) -> %% rebar has seperate input and output directories whereas `common_test` %% uses only a single directory so handle `dir` elsewhere CmdLineOpts = lists:keydelete(dir, 1, Opts), - merge_opts(CTOpts, CmdLineOpts, []). - -%% merge opts by iterating over opts defined in `rebar.config` and checking -%% command line opts to see if opt is also defined there. if so, take that -%% value (dropping the value from `rebar.config`) and continue until there -%% are no more opts defined in `rebar.config` then append remaining command -%% line opts -merge_opts([], CmdLineOpts, Acc) -> [CmdLineOpts] ++ Acc; -merge_opts([{K, V}|Rest], CmdLineOpts, Acc) -> - case lists:keytake(K, 1, CmdLineOpts) of - {K, Override, Rem} -> merge_opts(Rest, Rem, [{K, Override}] ++ Acc); - false -> merge_opts(Rest, CmdLineOpts, [{K, V}] ++ Acc) - end. + lists:ukeymerge(1, lists:ukeysort(1, CmdLineOpts), lists:ukeysort(1, CTOpts)). handle_results([Result]) -> handle_results(Result); |