mirror of
https://github.com/correl/rebar.git
synced 2024-12-18 11:06:20 +00:00
Simplify eunit
This commit is contained in:
parent
990e60f120
commit
015858b2d3
1 changed files with 7 additions and 7 deletions
|
@ -140,8 +140,7 @@ eunit(Config, _AppFile) ->
|
||||||
ModuleBeamFiles = BeamFiles ++ OtherBeamFiles,
|
ModuleBeamFiles = BeamFiles ++ OtherBeamFiles,
|
||||||
Modules = [rebar_utils:beam_to_mod(?EUNIT_DIR, N) || N <- ModuleBeamFiles],
|
Modules = [rebar_utils:beam_to_mod(?EUNIT_DIR, N) || N <- ModuleBeamFiles],
|
||||||
SrcModules = [rebar_utils:erl_to_mod(M) || M <- SrcErls],
|
SrcModules = [rebar_utils:erl_to_mod(M) || M <- SrcErls],
|
||||||
Suites = get_suites(),
|
FilteredModules = filter_modules(Modules),
|
||||||
FilteredModules = filtered_modules(Modules, Suites),
|
|
||||||
|
|
||||||
{ok, CoverLog} = cover_init(Config, ModuleBeamFiles),
|
{ok, CoverLog} = cover_init(Config, ModuleBeamFiles),
|
||||||
|
|
||||||
|
@ -183,13 +182,14 @@ eunit_dir() ->
|
||||||
ebin_dir() ->
|
ebin_dir() ->
|
||||||
filename:join(rebar_utils:get_cwd(), "ebin").
|
filename:join(rebar_utils:get_cwd(), "ebin").
|
||||||
|
|
||||||
get_suites() ->
|
filter_modules(Modules) ->
|
||||||
Suites = rebar_utils:get_deprecated_global(suite, suites, [], "soon"),
|
RawSuites = rebar_utils:get_deprecated_global(suite, suites, [], "soon"),
|
||||||
[list_to_atom(Suite) || Suite <- string:tokens(Suites, ",")].
|
Suites = [list_to_atom(Suite) || Suite <- string:tokens(RawSuites, ",")],
|
||||||
|
filter_modules(Modules, Suites).
|
||||||
|
|
||||||
filtered_modules(Modules, []) ->
|
filter_modules(Modules, []) ->
|
||||||
Modules;
|
Modules;
|
||||||
filtered_modules(Modules, Suites) ->
|
filter_modules(Modules, Suites) ->
|
||||||
[M || M <- Modules, lists:member(M, Suites)].
|
[M || M <- Modules, lists:member(M, Suites)].
|
||||||
|
|
||||||
perform_eunit(Config, FilteredModules) ->
|
perform_eunit(Config, FilteredModules) ->
|
||||||
|
|
Loading…
Reference in a new issue