瀏覽代碼

Run eunit in .eunit dir to ensure any created/temporary files are created there

pull/3/head
Dave Smith 15 年之前
父節點
當前提交
537eaa3bba
共有 1 個檔案被更改,包括 8 行新增0 行删除
  1. +8
    -0
      src/rebar_eunit.erl

+ 8
- 0
src/rebar_eunit.erl 查看文件

@ -85,10 +85,18 @@ eunit(Config, _File) ->
ok ok
end, end,
%% Move down into ?EUNIT_DIR while we run tests so any generated files
%% are created there (versus in the source dir)
Cwd = rebar_utils:get_cwd(),
file:set_cwd(?EUNIT_DIR),
%% Run eunit %% Run eunit
EunitOpts = BaseOpts ++ rebar_config:get_list(Config, eunit_opts, []), EunitOpts = BaseOpts ++ rebar_config:get_list(Config, eunit_opts, []),
EunitResult = (catch eunit:test(Modules, EunitOpts)), EunitResult = (catch eunit:test(Modules, EunitOpts)),
%% Return to original working dir
file:set_cwd(Cwd),
%% Analyze cover modules %% Analyze cover modules
cover_analyze(Config, cover:modules()), cover_analyze(Config, cover:modules()),

Loading…
取消
儲存