diff options
author | alisdair sullivan <alisdairsullivan@yahoo.ca> | 2015-10-26 22:00:36 -0700 |
---|---|---|
committer | alisdair sullivan <alisdairsullivan@yahoo.ca> | 2015-10-26 22:06:36 -0700 |
commit | dee2392e13175b359ed6af7b0296ca2fb9e22789 (patch) | |
tree | 76f01dc3b1cd36f0abcb9049b4ccb3435dd089ce /src | |
parent | 3bf52241bda6130b0dfc2c18e21f16bb205781d4 (diff) |
remove unnecessary filtering of checkapps from project apps in `rebar_prv_eunit`
Diffstat (limited to 'src')
-rw-r--r-- | src/rebar_prv_eunit.erl | 20 |
1 files changed, 4 insertions, 16 deletions
diff --git a/src/rebar_prv_eunit.erl b/src/rebar_prv_eunit.erl index f12ab01..b748b06 100644 --- a/src/rebar_prv_eunit.erl +++ b/src/rebar_prv_eunit.erl @@ -133,7 +133,7 @@ compile(State, {ok, Tests}) -> compile(_State, Error) -> Error. inject_eunit_state(State, Tests) -> - Apps = project_apps(State), + Apps = rebar_state:project_apps(State), ModdedApps = lists:map(fun(App) -> NewOpts = inject(rebar_app_info:opts(App), State), rebar_app_info:opts(App, NewOpts) @@ -200,7 +200,7 @@ prepare_tests(State) -> %% parse and translate command line tests CmdTests = resolve_tests(State), CfgTests = rebar_state:get(State, eunit_tests, []), - ProjectApps = project_apps(State), + ProjectApps = rebar_state:project_apps(State), %% prioritize tests to run first trying any command line specified %% tests falling back to tests specified in the config file finally %% running a default set if no other tests are present @@ -231,18 +231,6 @@ resolve(Flag, EUnitKey, RawOpts) -> normalize(Key, Value) when Key == dir; Key == file -> {Key, Value}; normalize(Key, Value) -> {Key, list_to_atom(Value)}. -project_apps(State) -> - filter_checkouts(rebar_state:project_apps(State)). - -filter_checkouts(Apps) -> filter_checkouts(Apps, []). - -filter_checkouts([], Acc) -> lists:reverse(Acc); -filter_checkouts([App|Rest], Acc) -> - case rebar_app_info:is_checkout(App) of - true -> filter_checkouts(Rest, Acc); - false -> filter_checkouts(Rest, [App|Acc]) - end. - select_tests(State, ProjectApps, [], []) -> default_tests(State, ProjectApps); select_tests(_State, _ProjectApps, [], Tests) -> Tests; select_tests(_State, _ProjectApps, Tests, _) -> Tests. @@ -350,11 +338,11 @@ translate_paths(State, Tests) -> translate_paths(State, Tests, []). translate_paths(_State, [], Acc) -> lists:reverse(Acc); translate_paths(State, [{dir, Dir}|Rest], Acc) -> - Apps = project_apps(State), + Apps = rebar_state:project_apps(State), translate_paths(State, Rest, [translate(State, Apps, Dir)|Acc]); translate_paths(State, [{file, File}|Rest], Acc) -> Dir = filename:dirname(File), - Apps = project_apps(State), + Apps = rebar_state:project_apps(State), translate_paths(State, Rest, [translate(State, Apps, Dir)|Acc]); translate_paths(State, [Test|Rest], Acc) -> translate_paths(State, Rest, [Test|Acc]). |