diff options
author | Patrik Nyblom <[email protected]> | 2010-11-29 13:56:29 +0100 |
---|---|---|
committer | Patrik Nyblom <[email protected]> | 2010-11-29 13:56:29 +0100 |
commit | 07d875f3255ccc1dea6e1189879e8f74f6f750b5 (patch) | |
tree | f5dab9c8a3f34525b748ec85070407e0e9f6cdc7 /lib/kernel/test | |
parent | 23618d61985713b4c7b4a14001877f080bcc312b (diff) | |
parent | df60dc3fe6fecf2e7cc6998498370804d106d7e3 (diff) | |
download | otp-07d875f3255ccc1dea6e1189879e8f74f6f750b5.tar.gz otp-07d875f3255ccc1dea6e1189879e8f74f6f750b5.tar.bz2 otp-07d875f3255ccc1dea6e1189879e8f74f6f750b5.zip |
Merge branch 'pan/code-clash-testcase/OTP-8852' into dev
* pan/code-clash-testcase/OTP-8852:
Teach code_SUITE:clash Windows file system semantics
Diffstat (limited to 'lib/kernel/test')
-rw-r--r-- | lib/kernel/test/code_SUITE.erl | 10 |
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) -> |