aboutsummaryrefslogtreecommitdiffstats
path: root/lib/common_test/src
diff options
context:
space:
mode:
Diffstat (limited to 'lib/common_test/src')
-rw-r--r--lib/common_test/src/ct_run.erl12
-rw-r--r--lib/common_test/src/ct_testspec.erl18
2 files changed, 23 insertions, 7 deletions
diff --git a/lib/common_test/src/ct_run.erl b/lib/common_test/src/ct_run.erl
index 7798d369d2..19afb4b9f6 100644
--- a/lib/common_test/src/ct_run.erl
+++ b/lib/common_test/src/ct_run.erl
@@ -63,7 +63,7 @@
stylesheet,
multiply_timetraps = 1,
scale_timetraps = false,
- unique_priv_dir = false,
+ unique_priv_dir,
testspecs = [],
tests}).
@@ -182,7 +182,7 @@ script_start1(Parent, Args) ->
UniquePrivDir = get_start_opt(unique_priv_dir,
fun([UPD]) -> list_to_atom(UPD);
([]) -> auto
- end, false, Args),
+ end, Args),
EvHandlers = event_handler_args2opts(Args),
CTHooks = ct_hooks_args2opts(Args),
EnableBuiltinHooks = get_start_opt(enable_builtin_hooks,
@@ -802,7 +802,7 @@ run_test2(StartOpts) ->
ScaleTT = get_start_opt(scale_timetraps, value, false, StartOpts),
%% create unique priv dir names
- UniquePrivDir = get_start_opt(unique_priv_dir, value, false, StartOpts),
+ UniquePrivDir = get_start_opt(unique_priv_dir, value, StartOpts),
%% auto compile & include files
Include =
@@ -1871,8 +1871,8 @@ do_run_test(Tests, Skip, Opts) ->
test_server_ctrl:multiply_timetraps(Opts#opts.multiply_timetraps),
test_server_ctrl:scale_timetraps(Opts#opts.scale_timetraps),
- test_server_ctrl:unique_priv_dir(Opts#opts.unique_priv_dir),
-
+ test_server_ctrl:unique_priv_dir(choose_val(Opts#opts.unique_priv_dir,
+ false)),
ct_event:notify(#event{name=start_info,
node=node(),
data={NoOfTests,NoOfSuites,NoOfCases}}),
@@ -2453,7 +2453,7 @@ opts2args(EnvStartOpts) ->
({unique_priv_dir,false}) ->
[];
({unique_priv_dir,UPD}) when is_atom(UPD) ->
- [{unique_priv_dir,[UPD]}];
+ [{unique_priv_dir,[atom_to_list(UPD)]}];
({force_stop,true}) ->
[{force_stop,[]}];
({force_stop,false}) ->
diff --git a/lib/common_test/src/ct_testspec.erl b/lib/common_test/src/ct_testspec.erl
index b68cbd3aa1..9e8065c636 100644
--- a/lib/common_test/src/ct_testspec.erl
+++ b/lib/common_test/src/ct_testspec.erl
@@ -568,6 +568,21 @@ add_tests([{scale_timetraps,Node,ST}|Ts],Spec) ->
add_tests([{scale_timetraps,ST}|Ts],Spec) ->
add_tests([{scale_timetraps,all_nodes,ST}|Ts],Spec);
+%% --- unique_priv_dir ---
+add_tests([{unique_priv_dir,all_nodes,UPD}|Ts],Spec) ->
+ Tests = lists:map(fun(N) -> {unique_priv_dir,N,UPD} end, list_nodes(Spec)),
+ add_tests(Tests++Ts,Spec);
+add_tests([{unique_priv_dir,Nodes,UPD}|Ts],Spec) when is_list(Nodes) ->
+ Ts1 = separate(Nodes,unique_priv_dir,[UPD],Ts,Spec#testspec.nodes),
+ add_tests(Ts1,Spec);
+add_tests([{unique_priv_dir,Node,UPD}|Ts],Spec) ->
+ UPDs = Spec#testspec.unique_priv_dir,
+ UPDs1 = [{ref2node(Node,Spec#testspec.nodes),UPD} |
+ lists:keydelete(ref2node(Node,Spec#testspec.nodes),1,UPDs)],
+ add_tests(Ts,Spec#testspec{unique_priv_dir=UPDs1});
+add_tests([{unique_priv_dir,UPD}|Ts],Spec) ->
+ add_tests([{unique_priv_dir,all_nodes,UPD}|Ts],Spec);
+
%% --- config ---
add_tests([{config,all_nodes,Files}|Ts],Spec) ->
Tests = lists:map(fun(N) -> {config,N,Files} end, list_nodes(Spec)),
@@ -1158,7 +1173,8 @@ valid_terms() ->
{skip_groups,6},
{skip_groups,7},
{skip_cases,5},
- {skip_cases,6}
+ {skip_cases,6},
+ {unique_priv_dir,2}
].
%% this function "guesses" if the user has misspelled a term name