From df60dc3fe6fecf2e7cc6998498370804d106d7e3 Mon Sep 17 00:00:00 2001 From: Patrik Nyblom Date: Tue, 21 Sep 2010 16:13:20 +0200 Subject: Teach code_SUITE:clash Windows file system semantics --- lib/kernel/test/code_SUITE.erl | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) 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) -> -- cgit v1.2.3