aboutsummaryrefslogtreecommitdiffstats
path: root/lib/kernel/test/code_SUITE.erl
diff options
context:
space:
mode:
authorLukas Larsson <[email protected]>2011-09-27 12:20:41 +0200
committerLukas Larsson <[email protected]>2011-09-29 17:31:29 +0200
commitbb98bf86894527817e0d00aa87286a4291937d03 (patch)
treecb7707206e08274e42cc222e99f4742e52fd2822 /lib/kernel/test/code_SUITE.erl
parent22a3818adb4e3433d7ab9f34e0ade06fdf10d8d6 (diff)
downloadotp-bb98bf86894527817e0d00aa87286a4291937d03.tar.gz
otp-bb98bf86894527817e0d00aa87286a4291937d03.tar.bz2
otp-bb98bf86894527817e0d00aa87286a4291937d03.zip
Remove test_server path instead of cwd for clash test
With the introduction of common_test as test framework the working directory of the tests changed to be the emulator_test directory. So we now have to remove the ../test_server directory instead. This change only affect tests run with a emulator which has not been installed.
Diffstat (limited to 'lib/kernel/test/code_SUITE.erl')
-rw-r--r--lib/kernel/test/code_SUITE.erl14
1 files changed, 8 insertions, 6 deletions
diff --git a/lib/kernel/test/code_SUITE.erl b/lib/kernel/test/code_SUITE.erl
index 86cccebc29..f7d56eed48 100644
--- a/lib/kernel/test/code_SUITE.erl
+++ b/lib/kernel/test/code_SUITE.erl
@@ -573,11 +573,13 @@ add_del_path(Config) when is_list(Config) ->
clash(Config) when is_list(Config) ->
DDir = ?config(data_dir,Config)++"clash/",
P = code:get_path(),
+ [TestServerPath|_] = [Path || Path <- code:get_path(),
+ re:run(Path,"test_server/?$",[]) /= nomatch],
%% test non-clashing entries
- %% remove "." to prevent clash with test-server path
- ?line true = code:del_path("."),
+ %% remove TestServerPath to prevent clash with test-server path
+ ?line true = code:del_path(TestServerPath),
?line true = code:add_path(DDir++"foobar-0.1/ebin"),
?line true = code:add_path(DDir++"zork-0.8/ebin"),
test_server:capture_start(),
@@ -589,8 +591,8 @@ clash(Config) when is_list(Config) ->
%% test clashing entries
- %% remove "." to prevent clash with test-server path
- ?line true = code:del_path("."),
+ %% remove TestServerPath to prevent clash with test-server path
+ ?line true = code:del_path(TestServerPath),
?line true = code:add_path(DDir++"foobar-0.1/ebin"),
?line true = code:add_path(DDir++"foobar-0.1.ez/foobar-0.1/ebin"),
test_server:capture_start(),
@@ -603,9 +605,9 @@ clash(Config) when is_list(Config) ->
%% test "Bad path can't read"
- %% remove "." to prevent clash with test-server path
+ %% remove TestServerPath to prevent clash with test-server path
Priv = ?config(priv_dir, Config),
- ?line true = code:del_path("."),
+ ?line true = code:del_path(TestServerPath),
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"),