aboutsummaryrefslogtreecommitdiffstats
path: root/lib/common_test/src/ct_testspec.erl
diff options
context:
space:
mode:
authorPeter Andersson <[email protected]>2011-07-14 14:18:57 +0200
committerPeter Andersson <[email protected]>2011-09-23 12:24:54 +0200
commit021b0dcb2a3a86ec0e07b0de8dc7cde9be0924ba (patch)
treedb0243654226afff8b63b55076ca058a135cfff0 /lib/common_test/src/ct_testspec.erl
parentf703d6512219431fa7fe61e5ddd1a9ed32506daa (diff)
downloadotp-021b0dcb2a3a86ec0e07b0de8dc7cde9be0924ba.tar.gz
otp-021b0dcb2a3a86ec0e07b0de8dc7cde9be0924ba.tar.bz2
otp-021b0dcb2a3a86ec0e07b0de8dc7cde9be0924ba.zip
Introduce new 'logopts' flag
Introduce new 'logopts' flag and make it possible to modify the default logging behaviour OTP-9372 OTP-9396
Diffstat (limited to 'lib/common_test/src/ct_testspec.erl')
-rw-r--r--lib/common_test/src/ct_testspec.erl22
1 files changed, 22 insertions, 0 deletions
diff --git a/lib/common_test/src/ct_testspec.erl b/lib/common_test/src/ct_testspec.erl
index d845358bb2..bf1dfa24ea 100644
--- a/lib/common_test/src/ct_testspec.erl
+++ b/lib/common_test/src/ct_testspec.erl
@@ -481,6 +481,26 @@ add_tests([{logdir,Node,Dir}|Ts],Spec) ->
add_tests([{logdir,Dir}|Ts],Spec) ->
add_tests([{logdir,all_nodes,Dir}|Ts],Spec);
+%% --- logopts ---
+add_tests([{logopts,all_nodes,Opts}|Ts],Spec) ->
+ LogOpts = Spec#testspec.logopts,
+ Tests = [{logopts,N,Opts} ||
+ N <- list_nodes(Spec),
+ lists:keymember(ref2node(N,Spec#testspec.nodes),1,
+ LogOpts) == false],
+ add_tests(Tests++Ts,Spec);
+add_tests([{logopts,Nodes,Opts}|Ts],Spec) when is_list(Nodes) ->
+ Ts1 = separate(Nodes,logopts,[Opts],Ts,Spec#testspec.nodes),
+ add_tests(Ts1,Spec);
+add_tests([{logopts,Node,Opts}|Ts],Spec) ->
+ LogOpts = Spec#testspec.logopts,
+ LogOpts1 = [{ref2node(Node,Spec#testspec.nodes),Opts} |
+ lists:keydelete(ref2node(Node,Spec#testspec.nodes),
+ 1,LogOpts)],
+ add_tests(Ts,Spec#testspec{logopts=LogOpts1});
+add_tests([{logopts,Opts}|Ts],Spec) ->
+ add_tests([{logopts,all_nodes,Opts}|Ts],Spec);
+
%% --- label ---
add_tests([{label,all_nodes,Lbl}|Ts],Spec) ->
Labels = Spec#testspec.label,
@@ -1097,6 +1117,8 @@ valid_terms() ->
{merge_tests,1},
{logdir,2},
{logdir,3},
+ {logopts,2},
+ {logopts,3},
{label,2},
{label,3},
{event_handler,2},