summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorDave Smith <dizzyd@dizzyd.com>2013-06-16 06:23:54 -0700
committerDave Smith <dizzyd@dizzyd.com>2013-06-16 06:23:54 -0700
commitc5e8671ef68d0b51ac3a5e60cdbc7cf63727ff92 (patch)
tree173a0e58243adee5dbd943b4041491720b07e29c /test
parentbaf2655343f06c9a8e5bd203cf3d55e1715b3964 (diff)
parentd89370856329459d5ff6a74457278835b6a027de (diff)
downloadrebar-c5e8671ef68d0b51ac3a5e60cdbc7cf63727ff92.tar.gz
Merge pull request #53 from oferrigni/unit_test_file_handling_fix
Fix file handling on windows for tests
Diffstat (limited to 'test')
-rw-r--r--test/rebar_eunit_tests.erl14
1 files changed, 11 insertions, 3 deletions
diff --git a/test/rebar_eunit_tests.erl b/test/rebar_eunit_tests.erl
index 7b2eec5..61a9bbf 100644
--- a/test/rebar_eunit_tests.erl
+++ b/test/rebar_eunit_tests.erl
@@ -337,7 +337,15 @@ basic_setup_test_() ->
"myfunc_test() -> ?assertMatch(ok, myapp_mymod:myfunc()).\n"]).
make_tmp_dir() ->
- ok = file:make_dir(?TMP_DIR).
+ case file:make_dir(?TMP_DIR) of
+ ok ->
+ ok;
+ {error, eexist} ->
+ remove_tmp_dir(),
+ make_tmp_dir();
+ Error ->
+ throw(Error)
+ end.
setup_environment() ->
ok = make_tmp_dir(),
@@ -389,8 +397,8 @@ prepare_rebar_script() ->
{unix, _} ->
[] = os:cmd("chmod u+x " ++ Rebar);
{win32, _} ->
- {ok, _} = file:copy(?REBAR_SCRIPT ++ ".bat",
- ?TMP_DIR ++ "rebar.bat")
+ {ok, _} = file:copy(?REBAR_SCRIPT ++ ".cmd",
+ ?TMP_DIR ++ "rebar.cmd")
end.
rebar() ->