aboutsummaryrefslogtreecommitdiffstats
path: root/lib/kernel/test
diff options
context:
space:
mode:
authorHenrik Nord <[email protected]>2018-10-04 14:15:08 +0200
committerHenrik Nord <[email protected]>2018-10-04 14:16:47 +0200
commit3db745cf3b621cc343565e98f32e66e486523b42 (patch)
treeecf8bf344f611f0f62e4e6ee5a46f1381cc2e118 /lib/kernel/test
parent0f0a8cb58182b9c2b31b4b7f5c257eeab2c9c40b (diff)
downloadotp-3db745cf3b621cc343565e98f32e66e486523b42.tar.gz
otp-3db745cf3b621cc343565e98f32e66e486523b42.tar.bz2
otp-3db745cf3b621cc343565e98f32e66e486523b42.zip
make sure a set ERL_LIBS does not interfere with tests
Diffstat (limited to 'lib/kernel/test')
-rw-r--r--lib/kernel/test/code_SUITE.erl10
1 files changed, 8 insertions, 2 deletions
diff --git a/lib/kernel/test/code_SUITE.erl b/lib/kernel/test/code_SUITE.erl
index 1314316c13..f9b6159e24 100644
--- a/lib/kernel/test/code_SUITE.erl
+++ b/lib/kernel/test/code_SUITE.erl
@@ -1021,6 +1021,13 @@ mult_lib_remove_prefix([H|T1], [H|T2]) ->
mult_lib_remove_prefix([$/|T], []) -> T.
bad_erl_libs(Config) when is_list(Config) ->
+ %% Preserve ERL_LIBS if set.
+ BadLibs0 = "/no/such/dir",
+ BadLibs =
+ case os:getenv("ERL_LIBS") of
+ false -> BadLibs0;
+ Libs -> BadLibs0 ++ ":" ++ Libs
+ end,
{ok,Node} =
test_server:start_node(bad_erl_libs, slave, []),
Code = rpc:call(Node,code,get_path,[]),
@@ -1028,10 +1035,9 @@ bad_erl_libs(Config) when is_list(Config) ->
{ok,Node2} =
test_server:start_node(bad_erl_libs, slave,
- [{args,"-env ERL_LIBS /no/such/dir"}]),
+ [{args,"-env ERL_LIBS " ++ BadLibs}]),
Code2 = rpc:call(Node,code,get_path,[]),
test_server:stop_node(Node2),
-
%% Test that code path is not affected by the faulty ERL_LIBS
Code = Code2,