summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/rebar_prv_eunit.erl16
1 files changed, 10 insertions, 6 deletions
diff --git a/src/rebar_prv_eunit.erl b/src/rebar_prv_eunit.erl
index b2f307e..0b00e89 100644
--- a/src/rebar_prv_eunit.erl
+++ b/src/rebar_prv_eunit.erl
@@ -144,12 +144,16 @@ resolve(Flag, RawOpts) -> resolve(Flag, Flag, RawOpts).
resolve(Flag, EUnitKey, RawOpts) ->
case proplists:get_value(Flag, RawOpts) of
undefined -> [];
- Args ->
- lists:flatten(lists:map(fun(Arg) -> normalize(EUnitKey, Arg) end,
- rebar_string:lexemes(Args, [$,])))
+ Args -> normalize(EUnitKey,
+ rebar_string:lexemes(Args, [$,]))
end.
-normalize(generator, Value) ->
+normalize(generator, Args) ->
+ lists:flatmap(fun(Value) -> normalize_(generator, Value) end, Args);
+normalize(EUnitKey, Args) ->
+ lists:map(fun(Arg) -> normalize_(EUnitKey, Arg) end, Args).
+
+normalize_(generator, Value) ->
case string:tokens(Value, [$:]) of
[Module0, Functions] ->
Module = list_to_atom(Module0),
@@ -158,8 +162,8 @@ normalize(generator, Value) ->
_ ->
?PRV_ERROR({generator, Value})
end;
-normalize(Key, Value) when Key == dir; Key == file -> {Key, Value};
-normalize(Key, Value) -> {Key, list_to_atom(Value)}.
+normalize_(Key, Value) when Key == dir; Key == file -> {Key, Value};
+normalize_(Key, Value) -> {Key, list_to_atom(Value)}.
cfg_tests(State) ->
case rebar_state:get(State, eunit_tests, []) of