diff options
author | Tuncer Ayaz <tuncer.ayaz@gmail.com> | 2012-07-11 20:36:41 +0200 |
---|---|---|
committer | Tuncer Ayaz <tuncer.ayaz@gmail.com> | 2012-07-11 20:36:41 +0200 |
commit | 015858b2d3265808fd2714e54a6d0dac38bea642 (patch) | |
tree | 78cae7861945f77bc6f2a586f05b240f51d76cb8 | |
parent | 990e60f120165abb4bfe563073ff35761b467a50 (diff) |
Simplify eunit
-rw-r--r-- | src/rebar_eunit.erl | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/rebar_eunit.erl b/src/rebar_eunit.erl index dcc46a1..f197f99 100644 --- a/src/rebar_eunit.erl +++ b/src/rebar_eunit.erl @@ -140,8 +140,7 @@ eunit(Config, _AppFile) -> ModuleBeamFiles = BeamFiles ++ OtherBeamFiles, Modules = [rebar_utils:beam_to_mod(?EUNIT_DIR, N) || N <- ModuleBeamFiles], SrcModules = [rebar_utils:erl_to_mod(M) || M <- SrcErls], - Suites = get_suites(), - FilteredModules = filtered_modules(Modules, Suites), + FilteredModules = filter_modules(Modules), {ok, CoverLog} = cover_init(Config, ModuleBeamFiles), @@ -183,13 +182,14 @@ eunit_dir() -> ebin_dir() -> filename:join(rebar_utils:get_cwd(), "ebin"). -get_suites() -> - Suites = rebar_utils:get_deprecated_global(suite, suites, [], "soon"), - [list_to_atom(Suite) || Suite <- string:tokens(Suites, ",")]. +filter_modules(Modules) -> + RawSuites = rebar_utils:get_deprecated_global(suite, suites, [], "soon"), + Suites = [list_to_atom(Suite) || Suite <- string:tokens(RawSuites, ",")], + filter_modules(Modules, Suites). -filtered_modules(Modules, []) -> +filter_modules(Modules, []) -> Modules; -filtered_modules(Modules, Suites) -> +filter_modules(Modules, Suites) -> [M || M <- Modules, lists:member(M, Suites)]. perform_eunit(Config, FilteredModules) -> |