aboutsummaryrefslogtreecommitdiffstats
path: root/lib/kernel
diff options
context:
space:
mode:
authorPatrik Nyblom <[email protected]>2010-09-21 16:13:20 +0200
committerPatrik Nyblom <[email protected]>2010-09-21 16:13:20 +0200
commitdf60dc3fe6fecf2e7cc6998498370804d106d7e3 (patch)
tree72423a2ec457400c33487401e9459d91ad8e282a /lib/kernel
parentc1eb8a0b776634422cd9fe3cf6083d25d5b568d0 (diff)
downloadotp-df60dc3fe6fecf2e7cc6998498370804d106d7e3.tar.gz
otp-df60dc3fe6fecf2e7cc6998498370804d106d7e3.tar.bz2
otp-df60dc3fe6fecf2e7cc6998498370804d106d7e3.zip
Teach code_SUITE:clash Windows file system semantics
Diffstat (limited to 'lib/kernel')
-rw-r--r--lib/kernel/test/code_SUITE.erl10
1 files changed, 9 insertions, 1 deletions
diff --git a/lib/kernel/test/code_SUITE.erl b/lib/kernel/test/code_SUITE.erl
index c9437df258..07dfcf575d 100644
--- a/lib/kernel/test/code_SUITE.erl
+++ b/lib/kernel/test/code_SUITE.erl
@@ -584,13 +584,21 @@ clash(Config) when is_list(Config) ->
TmpEzFile = Priv++"foobar-0.tmp.ez",
?line {ok, _} = file:copy(DDir++"foobar-0.1.ez", TmpEzFile),
?line true = code:add_path(TmpEzFile++"/foobar-0.1/ebin"),
- ?line ok = file:delete(TmpEzFile),
+ case os:type() of
+ {win32,_} ->
+ %% The file wont be deleted on windows until it's closed, why we
+ %% need to rename instead.
+ ?line ok = file:rename(TmpEzFile,TmpEzFile++".moved");
+ _ ->
+ ?line ok = file:delete(TmpEzFile)
+ end,
test_server:capture_start(),
?line ok = code:clash(),
test_server:capture_stop(),
?line [BadPathMsg|_] = test_server:capture_get(),
?line true = lists:prefix("** Bad path can't read", BadPathMsg),
?line true = code:set_path(P),
+ file:delete(TmpEzFile++".moved"), %% Only effect on windows
ok.
ext_mod_dep(suite) ->