diff options
author | Dave Smith <dizzyd@dizzyd.com> | 2010-06-22 14:31:31 -0600 |
---|---|---|
committer | Dave Smith <dizzyd@dizzyd.com> | 2010-06-22 14:31:31 -0600 |
commit | 9d09ccc99aa7d8ae156ffd2bf6d61c8365299fab (patch) | |
tree | 81294e4f340a4579b36d5d09097fb3503dc0d717 /src | |
parent | 1f3c49cae7d4ff9744672d8cd799655fef8843e3 (diff) |
Adding support for restricting eunit to a specific application
Diffstat (limited to 'src')
-rw-r--r-- | src/rebar_eunit.erl | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/src/rebar_eunit.erl b/src/rebar_eunit.erl index bd93a48..e302481 100644 --- a/src/rebar_eunit.erl +++ b/src/rebar_eunit.erl @@ -54,7 +54,19 @@ %% Public API %% =================================================================== -eunit(Config, _File) -> +eunit(Config, AppFile) -> + %% Check for app global parameter; this ia comma-delimited list of apps + %% on which we want to run eunit + TargetApps = [list_to_atom(A) || A <- string:tokens(rebar_config:get_global(app, []), ",")], + ThisApp = rebar_app_utils:app_name(AppFile), + case lists:member(ThisApp, TargetApps) of + true -> + ok; + false -> + ?CONSOLE("Skipping eunit on app ~p\n", [ThisApp]), + throw(ok) + end, + %% Make sure ?EUNIT_DIR/ directory exists (tack on dummy module) ok = filelib:ensure_dir(?EUNIT_DIR ++ "/foo"), |