aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPatrik Nyblom <[email protected]>2010-12-01 15:11:07 +0100
committerPatrik Nyblom <[email protected]>2010-12-01 15:11:07 +0100
commit30ad8cfadba47123920128023cb06af6e0922746 (patch)
treeb03c402b9c33ce3c378d39a8bdd10c2f2a377e54
parent9fbce40dcbda8d4e7888507d646bfee22bf7d311 (diff)
downloadotp-30ad8cfadba47123920128023cb06af6e0922746.tar.gz
otp-30ad8cfadba47123920128023cb06af6e0922746.tar.bz2
otp-30ad8cfadba47123920128023cb06af6e0922746.zip
Mend on_load_embedded testcase which did not handle windows links
-rw-r--r--lib/kernel/test/code_SUITE.erl13
-rw-r--r--lib/kernel/test/code_SUITE_data/on_load_app-1.0/src/on_load_embedded.erl2
2 files changed, 12 insertions, 3 deletions
diff --git a/lib/kernel/test/code_SUITE.erl b/lib/kernel/test/code_SUITE.erl
index 0c7440a13e..e52f8a0e37 100644
--- a/lib/kernel/test/code_SUITE.erl
+++ b/lib/kernel/test/code_SUITE.erl
@@ -1268,7 +1268,8 @@ on_load_embedded_1(Config) ->
?line LibRoot = code:lib_dir(),
?line LinkName = filename:join(LibRoot, "on_load_app-1.0"),
?line OnLoadApp = filename:join(DataDir, "on_load_app-1.0"),
- ?line file:delete(LinkName),
+ ?line del_link(LinkName),
+ io:format("LinkName :~p, OnLoadApp: ~p~n",[LinkName,OnLoadApp]),
case file:make_symlink(OnLoadApp, LinkName) of
{error,enotsup} ->
throw({skip,"Support for symlinks required"});
@@ -1297,7 +1298,15 @@ on_load_embedded_1(Config) ->
%% Clean up.
?line stop_node(Node),
- ?line ok = file:delete(LinkName).
+ ?line ok = del_link(LinkName).
+
+del_link(LinkName) ->
+ case file:delete(LinkName) of
+ {error,eperm} ->
+ file:del_dir(LinkName);
+ Other ->
+ Other
+ end.
create_boot(Config, Options) ->
?line {ok, OldDir} = file:get_cwd(),
diff --git a/lib/kernel/test/code_SUITE_data/on_load_app-1.0/src/on_load_embedded.erl b/lib/kernel/test/code_SUITE_data/on_load_app-1.0/src/on_load_embedded.erl
index b7fdd4d9ae..646921026d 100644
--- a/lib/kernel/test/code_SUITE_data/on_load_app-1.0/src/on_load_embedded.erl
+++ b/lib/kernel/test/code_SUITE_data/on_load_app-1.0/src/on_load_embedded.erl
@@ -8,7 +8,7 @@ run_me() ->
LibDir = code:lib_dir(on_load_app),
PrivDir = code:priv_dir(on_load_app),
LibDir = filename:dirname(PrivDir),
- ModPath = code:which(?MODULE),
+ ModPath = filename:join(filename:split(code:which(?MODULE))),
LibDir = filename:dirname(filename:dirname(ModPath)),
%% Start a process to remember that the on_load was called.