diff options
author | Lukas Larsson <[email protected]> | 2010-09-20 15:46:12 +0200 |
---|---|---|
committer | Lukas Larsson <[email protected]> | 2010-12-08 18:07:46 +0100 |
commit | ec4c840624a9a44d4d7d6b1e51e1f33a291a704b (patch) | |
tree | 6119a9f5fbc6a98424c37a57d57ef686aaedbefe /lib/common_test/src/ct_testspec.erl | |
parent | 9f4d45da9bfa3b1f5d3d345e48447ad89088afc9 (diff) | |
download | otp-ec4c840624a9a44d4d7d6b1e51e1f33a291a704b.tar.gz otp-ec4c840624a9a44d4d7d6b1e51e1f33a291a704b.tar.bz2 otp-ec4c840624a9a44d4d7d6b1e51e1f33a291a704b.zip |
Add support for suite_callback in spec, command_line and interactive. Start work on suite_callback functionality.
Diffstat (limited to 'lib/common_test/src/ct_testspec.erl')
-rw-r--r-- | lib/common_test/src/ct_testspec.erl | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/lib/common_test/src/ct_testspec.erl b/lib/common_test/src/ct_testspec.erl index f5069427a2..942241da6c 100644 --- a/lib/common_test/src/ct_testspec.erl +++ b/lib/common_test/src/ct_testspec.erl @@ -625,6 +625,20 @@ add_tests([{event_handler,Node,H,Args}|Ts],Spec) when is_atom(H) -> Node1 = ref2node(Node,Spec#testspec.nodes), add_tests(Ts,Spec#testspec{event_handler=[{Node1,H,Args}|EvHs]}); +%% --- suite_callbacks -- +add_tests([{suite_callbacks, all_nodes, CBs} | Ts], Spec) -> + Tests = [{suite_callbacks,N,CBs} || N <- list_nodes(Spec)], + add_tests(Tests ++ Ts, Spec); +add_tests([{suite_callbacks, Node, [CB|CBs]}|Ts], Spec) -> + SuiteCbs = Spec#testspec.suite_callbacks, + Node1 = ref2node(Node,Spec#testspec.nodes), + add_tests([{suite_callbacks, Node, CBs} | Ts], + Spec#testspec{suite_callbacks = [{Node1,CB} | SuiteCbs]}); +add_tests([{suite_callbacks, _Node, []}|Ts], Spec) -> + add_tests(Ts, Spec); +add_tests([{suite_callbacks, CBs}|Ts], Spec) -> + add_tests([{suite_callbacks, all_nodes, CBs}|Ts], Spec); + %% --- include --- add_tests([{include,all_nodes,InclDirs}|Ts],Spec) -> Tests = lists:map(fun(N) -> {include,N,InclDirs} end, list_nodes(Spec)), @@ -1051,6 +1065,8 @@ valid_terms() -> {event_handler,2}, {event_handler,3}, {event_handler,4}, + {suite_callbacks,2}, + {suite_callbacks,3}, {multiply_timetraps,2}, {multiply_timetraps,3}, {scale_timetraps,2}, |