Do not keep eunit config

This commit is contained in:
Tuncer Ayaz 2012-07-13 22:47:56 +02:00
parent e1c9d69d1d
commit 5a4ddd5524

View file

@ -64,7 +64,7 @@
%% Public API %% Public API
%% =================================================================== %% ===================================================================
eunit(Config0, _AppFile) -> eunit(Config, _AppFile) ->
%% Make sure ?EUNIT_DIR/ and ebin/ directory exists (append dummy module) %% Make sure ?EUNIT_DIR/ and ebin/ directory exists (append dummy module)
ok = filelib:ensure_dir(filename:join(eunit_dir(), "dummy")), ok = filelib:ensure_dir(filename:join(eunit_dir(), "dummy")),
ok = filelib:ensure_dir(filename:join(ebin_dir(), "dummy")), ok = filelib:ensure_dir(filename:join(ebin_dir(), "dummy")),
@ -85,7 +85,7 @@ eunit(Config0, _AppFile) ->
%% Copy source files to eunit dir for cover in case they are not directly %% Copy source files to eunit dir for cover in case they are not directly
%% in src but in a subdirectory of src. Cover only looks in cwd and ../src %% in src but in a subdirectory of src. Cover only looks in cwd and ../src
%% for source files. Also copy files from src_dirs. %% for source files. Also copy files from src_dirs.
ErlOpts = rebar_utils:erl_opts(Config0), ErlOpts = rebar_utils:erl_opts(Config),
SrcDirs = rebar_utils:src_dirs(proplists:append_values(src_dirs, ErlOpts)), SrcDirs = rebar_utils:src_dirs(proplists:append_values(src_dirs, ErlOpts)),
SrcErls = lists:foldl( SrcErls = lists:foldl(
@ -119,8 +119,8 @@ eunit(Config0, _AppFile) ->
%% Compile erlang code to ?EUNIT_DIR, using a tweaked config %% Compile erlang code to ?EUNIT_DIR, using a tweaked config
%% with appropriate defines for eunit, and include all the test modules %% with appropriate defines for eunit, and include all the test modules
%% as well. %% as well.
Config = eunit_config(Config0), ok = rebar_erlc_compiler:doterl_compile(eunit_config(Config),
rebar_erlc_compiler:doterl_compile(Config, ?EUNIT_DIR, TestErls), ?EUNIT_DIR, TestErls),
%% Build a list of all the .beams in ?EUNIT_DIR -- use this for %% Build a list of all the .beams in ?EUNIT_DIR -- use this for
%% cover and eunit testing. Normally you can just tell cover %% cover and eunit testing. Normally you can just tell cover
@ -166,7 +166,7 @@ eunit(Config0, _AppFile) ->
%% Restore code path %% Restore code path
true = code:set_path(CodePath), true = code:set_path(CodePath),
{ok, Config}. ok.
clean(_Config, _File) -> clean(_Config, _File) ->
rebar_file_utils:rm_rf(?EUNIT_DIR). rebar_file_utils:rm_rf(?EUNIT_DIR).