mirror of
https://github.com/correl/rebar.git
synced 2024-11-23 19:19:54 +00:00
Merge pull request #53 from oferrigni/unit_test_file_handling_fix
Fix file handling on windows for tests
This commit is contained in:
commit
c5e8671ef6
1 changed files with 11 additions and 3 deletions
|
@ -337,7 +337,15 @@ basic_setup_test_() ->
|
||||||
"myfunc_test() -> ?assertMatch(ok, myapp_mymod:myfunc()).\n"]).
|
"myfunc_test() -> ?assertMatch(ok, myapp_mymod:myfunc()).\n"]).
|
||||||
|
|
||||||
make_tmp_dir() ->
|
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() ->
|
setup_environment() ->
|
||||||
ok = make_tmp_dir(),
|
ok = make_tmp_dir(),
|
||||||
|
@ -389,8 +397,8 @@ prepare_rebar_script() ->
|
||||||
{unix, _} ->
|
{unix, _} ->
|
||||||
[] = os:cmd("chmod u+x " ++ Rebar);
|
[] = os:cmd("chmod u+x " ++ Rebar);
|
||||||
{win32, _} ->
|
{win32, _} ->
|
||||||
{ok, _} = file:copy(?REBAR_SCRIPT ++ ".bat",
|
{ok, _} = file:copy(?REBAR_SCRIPT ++ ".cmd",
|
||||||
?TMP_DIR ++ "rebar.bat")
|
?TMP_DIR ++ "rebar.cmd")
|
||||||
end.
|
end.
|
||||||
|
|
||||||
rebar() ->
|
rebar() ->
|
||||||
|
|
Loading…
Reference in a new issue