aboutsummaryrefslogtreecommitdiffstats
path: root/lib/test_server/src/test_server_ctrl.erl
diff options
context:
space:
mode:
authorPeter Andersson <[email protected]>2012-03-27 17:57:40 +0200
committerPeter Andersson <[email protected]>2012-03-27 17:57:40 +0200
commiteffdfdc5a7a2d70ea4ce34ce446c9490f424f2d7 (patch)
treee91e8706a4e5679c01127e7dfefb44772e69b405 /lib/test_server/src/test_server_ctrl.erl
parentefee6d37c1ce665c535a45acb8ee03bce55d1e67 (diff)
parentc0d0515e45f94da60b9be463f1c7e957c14492f1 (diff)
downloadotp-effdfdc5a7a2d70ea4ce34ce446c9490f424f2d7.tar.gz
otp-effdfdc5a7a2d70ea4ce34ce446c9490f424f2d7.tar.bz2
otp-effdfdc5a7a2d70ea4ce34ce446c9490f424f2d7.zip
Merge remote branch 'origin/peppe/common_test/otp-10022' into maint
* origin/peppe/common_test/otp-10022: Fix problem with wrong data_dir sent to hooks if init_per_* is missing
Diffstat (limited to 'lib/test_server/src/test_server_ctrl.erl')
-rw-r--r--lib/test_server/src/test_server_ctrl.erl34
1 files changed, 22 insertions, 12 deletions
diff --git a/lib/test_server/src/test_server_ctrl.erl b/lib/test_server/src/test_server_ctrl.erl
index 79c45de071..52c32e87c4 100644
--- a/lib/test_server/src/test_server_ctrl.erl
+++ b/lib/test_server/src/test_server_ctrl.erl
@@ -2831,12 +2831,13 @@ run_test_cases_loop([{conf,Ref,Props,{Mod,Func}}|_Cases]=Cs0,
{failed,TcFail}]}]
end,
+ SuiteName = proplists:get_value(suite, Props),
case get(test_server_create_priv_dir) of
auto_per_run -> % use common priv_dir
TSDirs = [{priv_dir,get(test_server_priv_dir)},
- {data_dir,get_data_dir(Mod)}];
+ {data_dir,get_data_dir(Mod, SuiteName)}];
_ ->
- TSDirs = [{data_dir,get_data_dir(Mod)}]
+ TSDirs = [{data_dir,get_data_dir(Mod, SuiteName)}]
end,
ActualCfg =
@@ -3001,13 +3002,13 @@ run_test_cases_loop([{conf,_Ref,_Props,_X}=Conf|_Cases0],
run_test_cases_loop([{Mod,Case}|Cases], Config, TimetrapData, Mode, Status) ->
ActualCfg =
- case get(test_server_create_priv_dir) of
- auto_per_run ->
- update_config(hd(Config), [{priv_dir,get(test_server_priv_dir)},
- {data_dir,get_data_dir(Mod)}]);
- _ ->
- update_config(hd(Config), [{data_dir,get_data_dir(Mod)}])
- end,
+ case get(test_server_create_priv_dir) of
+ auto_per_run ->
+ update_config(hd(Config), [{priv_dir,get(test_server_priv_dir)},
+ {data_dir,get_data_dir(Mod)}]);
+ _ ->
+ update_config(hd(Config), [{data_dir,get_data_dir(Mod)}])
+ end,
run_test_cases_loop([{Mod,Case,[ActualCfg]}|Cases], Config,
TimetrapData, Mode, Status);
@@ -3172,13 +3173,20 @@ conf_start(Ref, Mode) ->
false -> 0
end.
+
get_data_dir(Mod) ->
- case code:which(Mod) of
+ get_data_dir(Mod, undefined).
+
+get_data_dir(Mod, Suite) ->
+ UseMod = if Suite == undefined -> Mod;
+ true -> Suite
+ end,
+ case code:which(UseMod) of
non_existing ->
print(12, "The module ~p is not loaded", [Mod]),
[];
FullPath ->
- filename:dirname(FullPath) ++ "/" ++ cast_to_list(Mod) ++
+ filename:dirname(FullPath) ++ "/" ++ cast_to_list(UseMod) ++
?data_dir_suffix
end.
@@ -5158,7 +5166,9 @@ init_props(Props) ->
end.
keep_name(Props) ->
- lists:filter(fun({name,_}) -> true; (_) -> false end, Props).
+ lists:filter(fun({name,_}) -> true;
+ ({suite,_}) -> true;
+ (_) -> false end, Props).
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% Target node handling functions %%