summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorDave Smith <dizzyd@dizzyd.com>2009-12-14 09:59:00 -0500
committerDave Smith <dizzyd@dizzyd.com>2009-12-14 09:59:00 -0500
commit537eaa3bba6b9a71884830136fb2517161c01540 (patch)
tree07f487fb3a78049bcf0c96278b069a1e50591077 /src
parente86f82f10d2c734ae2ca7def9b94994142c8d63b (diff)
Run eunit in .eunit dir to ensure any created/temporary files are created there
Diffstat (limited to 'src')
-rw-r--r--src/rebar_eunit.erl8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/rebar_eunit.erl b/src/rebar_eunit.erl
index e82bd38..162a692 100644
--- a/src/rebar_eunit.erl
+++ b/src/rebar_eunit.erl
@@ -85,10 +85,18 @@ eunit(Config, _File) ->
ok
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
EunitOpts = BaseOpts ++ rebar_config:get_list(Config, eunit_opts, []),
EunitResult = (catch eunit:test(Modules, EunitOpts)),
+ %% Return to original working dir
+ file:set_cwd(Cwd),
+
%% Analyze cover modules
cover_analyze(Config, cover:modules()),