diff options
Diffstat (limited to 'lib/megaco')
68 files changed, 2202 insertions, 2903 deletions
diff --git a/lib/megaco/Makefile b/lib/megaco/Makefile index d4698eb558..10efaf667f 100644 --- a/lib/megaco/Makefile +++ b/lib/megaco/Makefile @@ -1,7 +1,7 @@ # # %CopyrightBegin% # -# Copyright Ericsson AB 1999-2009. All Rights Reserved. +# Copyright Ericsson AB 1999-2011. All Rights Reserved. # # The contents of this file are subject to the Erlang Public License, # Version 1.1, (the "License"); you may not use this file except in @@ -97,12 +97,19 @@ endif CONFIGURE_OPTS = $(FLEX_SCANNER_LINENO_ENABLER) $(FLEX_SCANNER_REENTRANT_ENABLER) +MEGACO_DIA_PLT = ./priv/megaco.plt +MEGACO_DIA_PLT_LOG = $(basename $(MEGACO_DIA_PLT)).dialyzer_plt_log +MEGACO_DIA_LOG = $(basename $(MEGACO_DIA_PLT)).dialyzer_log + # ---------------------------------------------------- # Default Subdir Targets # ---------------------------------------------------- include $(ERL_TOP)/make/otp_subdir.mk +.PHONY: reconf conf dconf econf configure setup info version \ + app_install dialyzer + reconf: (cd $(ERL_TOP) && \ ./otp_build autoconf && \ @@ -132,6 +139,10 @@ info: @echo "APP_TAR_FILE: $(APP_TAR_FILE)" @echo "OTP_INSTALL_DIR: $(OTP_INSTALL_DIR)" @echo "APP_INSTALL_DIR: $(APP_INSTALL_DIR)" + @echo "" + @echo "MEGACO_PLT = $(MEGACO_PLT)" + @echo "MEGACO_DIA_LOG = $(MEGACO_DIA_LOG)" + @echo "" version: @echo "$(VSN)" @@ -190,9 +201,18 @@ tar: $(APP_TAR_FILE) $(APP_TAR_FILE): $(APP_DIR) (cd $(APP_RELEASE_DIR); gtar zcf $(APP_TAR_FILE) $(DIR_NAME)) -dialyzer: - (cd ./ebin; \ - dialyzer --build_plt \ - --output_plt ../priv/megaco.plt \ - -r ../../megaco/ebin \ - --verbose) +dialyzer_plt: $(MEGACO_DIA_PLT) + +$(MEGACO_DIA_PLT): + @echo "Building megaco plt file" + @dialyzer --build_plt \ + --output_plt $@ \ + -r ../megaco/ebin \ + -o $(MEGACO_DIA_PLT_LOG) \ + --verbose + +dialyzer: $(MEGACO_DIA_PLT) + (dialyzer --plt $< \ + -o $(MEGACO_DIA_LOG) \ + ../megaco/ebin \ + && (shell cat $(MEGACO_DIA_LOG))) diff --git a/lib/megaco/doc/src/notes.xml b/lib/megaco/doc/src/notes.xml index 81c9305542..4f678a2a1b 100644 --- a/lib/megaco/doc/src/notes.xml +++ b/lib/megaco/doc/src/notes.xml @@ -1,10 +1,10 @@ -<?xml version="1.0" encoding="latin1" ?> +<?xml version="1.0" encoding="iso-8859-1" ?> <!DOCTYPE chapter SYSTEM "chapter.dtd"> <chapter> <header> <copyright> - <year>2000</year><year>2010</year> + <year>2000</year><year>2011</year> <holder>Ericsson AB. All Rights Reserved.</holder> </copyright> <legalnotice> @@ -35,22 +35,90 @@ thus constitutes one section in this document. The title of each section is the version number of Megaco.</p> + + <section><title>Megaco 3.15.1</title> + + <p>Version 3.15.1 supports code replacement in runtime from/to + version 3.15, 3.14.1.1, 3.14.1 and 3.14.</p> + + <section> + <title>Improvements and new features</title> + + <p>-</p> + +<!-- + <list type="bulleted"> + <item> + <p>Updated the + <seealso marker="megaco_performance">performance</seealso> + chapter. </p> + <p>Own Id: OTP-8696</p> + </item> + + </list> +--> + + </section> + + <section> + <title>Fixed bugs and malfunctions</title> + +<!-- + <p>-</p> +--> + + <list type="bulleted"> + <item> + <p>Fixing miscellaneous things detected by dialyzer. </p> + <p>Own Id: OTP-9075</p> + <!-- <p>Aux Id: Seq 11579</p> --> + </item> + + </list> + + </section> + + </section> <!-- 3.15.1 --> + + <section><title>Megaco 3.15</title> <section><title>Improvements and New Features</title> - <list> + +<!-- + <p>-</p> +--> + + <list type="bulleted"> + <item> + <p>Fixing auto-import issues.</p> + <p>Own Id: OTP-8842</p> + </item> + </list> + </section> + + <section> + <title>Fixed bugs and malfunctions</title> + <p>-</p> + +<!-- + <list type="bulleted"> <item> - <p> - Fixing auto-import issues.</p> - <p> - Own Id: OTP-8842</p> + <p>Eliminated a possible race condition while creating + pending counters. </p> + <p>Own Id: OTP-8634</p> + <p>Aux Id: Seq 11579</p> </item> + </list> +--> + </section> -</section> + </section> <!-- 3.15 --> -<section> + + <section> <title>Megaco 3.14.1.1</title> <p>Version 3.14.1.1 supports code replacement in runtime from/to diff --git a/lib/megaco/src/app/megaco.app.src b/lib/megaco/src/app/megaco.app.src index 503fcd7176..c0d8218ac8 100644 --- a/lib/megaco/src/app/megaco.app.src +++ b/lib/megaco/src/app/megaco.app.src @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 1999-2009. All Rights Reserved. +%% Copyright Ericsson AB 1999-2011. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -67,6 +67,7 @@ megaco_compact_text_encoder_prev3c, megaco_compact_text_encoder_v3, megaco_config, + megaco_config_misc, megaco_digit_map, megaco_encoder, megaco_edist_compress, diff --git a/lib/megaco/src/app/megaco.appup.src b/lib/megaco/src/app/megaco.appup.src index 66068f650f..01b070d79f 100644 --- a/lib/megaco/src/app/megaco.appup.src +++ b/lib/megaco/src/app/megaco.appup.src @@ -2,7 +2,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2001-2010. All Rights Reserved. +%% Copyright Ericsson AB 2001-2011. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -133,50 +133,34 @@ %% | %% v %% 3.15 +%% | +%% v +%% 3.15.1 %% %% {"%VSN%", [ - {"3.14.1.1", + {"3.15", [ - {load_module, megaco_binary_transformer_prev3a, soft_purge, soft_purge, []}, - {load_module, megaco_binary_transformer_prev3b, soft_purge, soft_purge, []}, - {load_module, megaco_binary_transformer_prev3c, soft_purge, soft_purge, []}, + {load_module, megaco_flex_scanner, soft_purge, soft_purge, []}, {load_module, megaco_sdp, soft_purge, soft_purge, []}, - {load_module, megaco_compact_text_encoder_v1, soft_purge, soft_purge, []}, - {load_module, megaco_pretty_text_encoder_v1, soft_purge, soft_purge, []}, - {load_module, megaco_compact_text_encoder_v2, soft_purge, soft_purge, []}, - {load_module, megaco_pretty_text_encoder_v2, soft_purge, soft_purge, []}, - {load_module, megaco_compact_text_encoder_prev3a, soft_purge, soft_purge, []}, - {load_module, megaco_pretty_text_encoder_prev3a, soft_purge, soft_purge, []}, - {load_module, megaco_compact_text_encoder_prev3b, soft_purge, soft_purge, []}, - {load_module, megaco_pretty_text_encoder_prev3b, soft_purge, soft_purge, []}, - {load_module, megaco_compact_text_encoder_prev3c, soft_purge, soft_purge, []}, - {load_module, megaco_pretty_text_encoder_prev3c, soft_purge, soft_purge, []}, - {load_module, megaco_compact_text_encoder_v3, soft_purge, soft_purge, []}, - {load_module, megaco_pretty_text_encoder_v3, soft_purge, soft_purge, []} + {load_module, megaco_filter, soft_purge, soft_purge, []}, + {load_module, megaco_timer, soft_purge, soft_purge, [megaco_config_misc]}, + {update, megaco_config, soft, soft_purge, soft_purge, + [megaco_timer, megaco_config_misc]}, + {add_module, megaco_config_misc} ] } ], [ - {"3.14.1.1", + {"3.15", [ - {load_module, megaco_binary_transformer_prev3a, soft_purge, soft_purge, []}, - {load_module, megaco_binary_transformer_prev3b, soft_purge, soft_purge, []}, - {load_module, megaco_binary_transformer_prev3c, soft_purge, soft_purge, []}, + {load_module, megaco_flex_scanner, soft_purge, soft_purge, []}, {load_module, megaco_sdp, soft_purge, soft_purge, []}, - {load_module, megaco_compact_text_encoder_v1, soft_purge, soft_purge, []}, - {load_module, megaco_pretty_text_encoder_v1, soft_purge, soft_purge, []}, - {load_module, megaco_compact_text_encoder_v2, soft_purge, soft_purge, []}, - {load_module, megaco_pretty_text_encoder_v2, soft_purge, soft_purge, []}, - {load_module, megaco_compact_text_encoder_prev3a, soft_purge, soft_purge, []}, - {load_module, megaco_pretty_text_encoder_prev3a, soft_purge, soft_purge, []}, - {load_module, megaco_compact_text_encoder_prev3b, soft_purge, soft_purge, []}, - {load_module, megaco_pretty_text_encoder_prev3b, soft_purge, soft_purge, []}, - {load_module, megaco_compact_text_encoder_prev3c, soft_purge, soft_purge, []}, - {load_module, megaco_pretty_text_encoder_prev3c, soft_purge, soft_purge, []}, - {load_module, megaco_compact_text_encoder_v3, soft_purge, soft_purge, []}, - {load_module, megaco_pretty_text_encoder_v3, soft_purge, soft_purge, []} + {load_module, megaco_filter, soft_purge, soft_purge, []}, + {load_module, megaco_timer, soft_purge, soft_purge, [megaco_config]}, + {update, megaco_config, soft, soft_purge, soft_purge, []}, + {remove, {megaco_config_misc, soft_purge, brutal_purge}} ] } ] diff --git a/lib/megaco/src/binary/megaco_binary_encoder_lib.erl b/lib/megaco/src/binary/megaco_binary_encoder_lib.erl index 842d6b70d1..967ee93935 100644 --- a/lib/megaco/src/binary/megaco_binary_encoder_lib.erl +++ b/lib/megaco/src/binary/megaco_binary_encoder_lib.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2005-2009. All Rights Reserved. +%% Copyright Ericsson AB 2005-2011. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -134,6 +134,12 @@ encode_transaction(EC, {Tag, _} = Trans, AsnMod, TransMod, Type) encode_transaction(_EC, T, _AsnMod, _TransMod, _Type) -> {error, {no_megaco_transaction, T}}. +-spec do_encode_transaction(EC :: list(), + Trans :: tuple(), + AnsMod :: atom(), + TransMod :: atom(), + Type :: atom()) -> + {'ok', binary()} | {'error', any()}. do_encode_transaction([native], _Trans, _AsnMod, _TransMod, binary) -> %% asn1rt:encode(AsnMod, element(1, T), T); {error, not_implemented}; @@ -160,6 +166,12 @@ do_encode_transaction(EC, _Trans, _AsnMod, _TransMod, _Type) -> %% Convert a list of ActionRequest record's into a binary %% Return {ok, DeepIoList} | {error, Reason} %%---------------------------------------------------------------------- +-spec encode_action_requests(EC :: list(), + ARs :: list(), + AnsMod :: atom(), + TransMod :: atom(), + Type :: atom()) -> + {'ok', binary()} | {'error', any()}. encode_action_requests([native], _ARs, _AsnMod, _TransMod, binary) -> %% asn1rt:encode(AsnMod, element(1, T), T); {error, not_implemented}; @@ -183,13 +195,20 @@ encode_action_requests(EC, _ARs, _AsnMod, _TransMod, _Type) -> %% Convert a ActionRequest record into a binary %% Return {ok, DeepIoList} | {error, Reason} %%---------------------------------------------------------------------- -encode_action_request([native], _ARs, _AsnMod, _TransMod, binary) -> + +-spec encode_action_request(EC :: list(), + AR :: tuple(), + AnsMod :: atom(), + TransMod :: atom(), + Type :: atom()) -> + {'ok', binary()} | {'error', any()}. +encode_action_request([native], _AR, _AsnMod, _TransMod, binary) -> %% asn1rt:encode(AsnMod, element(1, T), T); {error, not_implemented}; -encode_action_request(_EC, _ARs0, _AsnMod, _TransMod, binary) -> +encode_action_request(_EC, _AR, _AsnMod, _TransMod, binary) -> {error, not_implemented}; -encode_action_request(EC, ARs, AsnMod, TransMod, io_list) -> - case encode_action_request(EC, ARs, AsnMod, TransMod, binary) of +encode_action_request(EC, AR, AsnMod, TransMod, io_list) -> + case encode_action_request(EC, AR, AsnMod, TransMod, binary) of {ok, Bin} when is_binary(Bin) -> {ok, Bin}; {ok, DeepIoList} -> @@ -198,7 +217,7 @@ encode_action_request(EC, ARs, AsnMod, TransMod, io_list) -> {error, Reason} -> {error, Reason} end; -encode_action_request(EC, _ARs, _AsnMod, _TransMod, _Type) -> +encode_action_request(EC, _AR, _AsnMod, _TransMod, _Type) -> {error, {bad_encoding_config, EC}}. diff --git a/lib/megaco/src/engine/depend.mk b/lib/megaco/src/engine/depend.mk index 8d8c83e923..935eb813e5 100644 --- a/lib/megaco/src/engine/depend.mk +++ b/lib/megaco/src/engine/depend.mk @@ -2,7 +2,7 @@ # %CopyrightBegin% # -# Copyright Ericsson AB 2003-2009. All Rights Reserved. +# Copyright Ericsson AB 2003-2011. All Rights Reserved. # # The contents of this file are subject to the Erlang Public License, # Version 1.1, (the "License"); you may not use this file except in @@ -17,6 +17,8 @@ # # %CopyrightEnd% +$(EBIN)/megaco_config_misc.$(EMULATOR): megaco_config_misc.erl + $(EBIN)/megaco_config.$(EMULATOR): megaco_config.erl \ ../../include/megaco.hrl \ ../app/megaco_internal.hrl diff --git a/lib/megaco/src/engine/megaco_config.erl b/lib/megaco/src/engine/megaco_config.erl index 6805db790d..b65ddbe232 100644 --- a/lib/megaco/src/engine/megaco_config.erl +++ b/lib/megaco/src/engine/megaco_config.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2000-2010. All Rights Reserved. +%% Copyright Ericsson AB 2000-2011. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -46,10 +46,10 @@ %% Verification functions verify_val/2, - verify_strict_uint/1, - verify_strict_int/1, verify_strict_int/2, - verify_uint/1, - verify_int/1, verify_int/2, +%% verify_strict_uint/1, +%% verify_strict_int/1, verify_strict_int/2, +%% verify_uint/1, +%% verify_int/1, verify_int/2, %% Reply limit counter @@ -1501,28 +1501,37 @@ verify_val(Item, Val) -> mid -> true; local_mid -> true; remote_mid -> true; - min_trans_id -> verify_strict_uint(Val, 4294967295); % uint32 - max_trans_id -> verify_uint(Val, 4294967295); % uint32 + min_trans_id -> + megaco_config_misc:verify_strict_uint(Val, 4294967295); % uint32 + max_trans_id -> + megaco_config_misc:verify_uint(Val, 4294967295); % uint32 request_timer -> verify_timer(Val); long_request_timer -> verify_timer(Val); - auto_ack -> verify_bool(Val); + auto_ack -> + megaco_config_misc:verify_bool(Val); - trans_ack -> verify_bool(Val); - trans_ack_maxcount -> verify_uint(Val); + trans_ack -> + megaco_config_misc:verify_bool(Val); + trans_ack_maxcount -> + megaco_config_misc:verify_uint(Val); - trans_req -> verify_bool(Val); - trans_req_maxcount -> verify_uint(Val); - trans_req_maxsize -> verify_uint(Val); + trans_req -> + megaco_config_misc:verify_bool(Val); + trans_req_maxcount -> + megaco_config_misc:verify_uint(Val); + trans_req_maxsize -> + megaco_config_misc:verify_uint(Val); - trans_timer -> verify_timer(Val) and (Val >= 0); - trans_sender when Val == undefined -> true; + trans_timer -> + verify_timer(Val) and (Val >= 0); + trans_sender when Val =:= undefined -> true; pending_timer -> verify_timer(Val); - sent_pending_limit -> verify_uint(Val) andalso - (Val > 0); - recv_pending_limit -> verify_uint(Val) andalso - (Val > 0); + sent_pending_limit -> + megaco_config_misc:verify_uint(Val) andalso (Val > 0); + recv_pending_limit -> + megaco_config_misc:verify_uint(Val) andalso (Val > 0); reply_timer -> verify_timer(Val); control_pid when is_pid(Val) -> true; monitor_ref -> true; % Internal usage only @@ -1530,110 +1539,43 @@ verify_val(Item, Val) -> send_handle -> true; encoding_mod when is_atom(Val) -> true; encoding_config when is_list(Val) -> true; - protocol_version -> verify_strict_uint(Val); + protocol_version -> + megaco_config_misc:verify_strict_uint(Val); auth_data -> true; user_mod when is_atom(Val) -> true; user_args when is_list(Val) -> true; reply_data -> true; - threaded -> verify_bool(Val); - strict_version -> verify_bool(Val); - long_request_resend -> verify_bool(Val); - call_proxy_gc_timeout -> verify_strict_uint(Val); - cancel -> verify_bool(Val); + threaded -> + megaco_config_misc:verify_bool(Val); + strict_version -> + megaco_config_misc:verify_bool(Val); + long_request_resend -> + megaco_config_misc:verify_bool(Val); + call_proxy_gc_timeout -> + megaco_config_misc:verify_strict_uint(Val); + cancel -> + megaco_config_misc:verify_bool(Val); resend_indication -> verify_resend_indication(Val); - segment_reply_ind -> verify_bool(Val); - segment_recv_acc -> verify_bool(Val); + segment_reply_ind -> + megaco_config_misc:verify_bool(Val); + segment_recv_acc -> + megaco_config_misc:verify_bool(Val); segment_recv_timer -> verify_timer(Val); segment_send -> verify_segmentation_window(Val); segment_send_timer -> verify_timer(Val); - max_pdu_size -> verify_int(Val) andalso (Val > 0); + max_pdu_size -> + megaco_config_misc:verify_int(Val) andalso (Val > 0); request_keep_alive_timeout -> - (verify_uint(Val) orelse (Val =:= plain)); + (megaco_config_misc:verify_uint(Val) orelse (Val =:= plain)); _ -> false end. -verify_bool(true) -> true; -verify_bool(false) -> true; -verify_bool(_) -> false. - verify_resend_indication(flag) -> true; -verify_resend_indication(Val) -> verify_bool(Val). - --spec verify_strict_int(Int :: integer()) -> boolean(). -verify_strict_int(Int) when is_integer(Int) -> true; -verify_strict_int(_) -> false. - --spec verify_strict_int(Int :: integer(), - Max :: integer() | 'infinity') -> boolean(). -verify_strict_int(Int, infinity) -> - verify_strict_int(Int); -verify_strict_int(Int, Max) -> - verify_strict_int(Int) andalso verify_strict_int(Max) andalso (Int =< Max). - --spec verify_strict_uint(Int :: non_neg_integer()) -> boolean(). -verify_strict_uint(Int) when is_integer(Int) andalso (Int >= 0) -> true; -verify_strict_uint(_) -> false. - --spec verify_strict_uint(Int :: non_neg_integer(), - Max :: non_neg_integer() | 'infinity') -> boolean(). -verify_strict_uint(Int, infinity) -> - verify_strict_uint(Int); -verify_strict_uint(Int, Max) -> - verify_strict_int(Int, 0, Max). - --spec verify_uint(Val :: non_neg_integer() | 'infinity') -> boolean(). -verify_uint(infinity) -> true; -verify_uint(Val) -> verify_strict_uint(Val). - --spec verify_int(Val :: integer() | 'infinity') -> boolean(). -verify_int(infinity) -> true; -verify_int(Val) -> verify_strict_int(Val). - --spec verify_int(Int :: integer() | 'infinity', - Max :: integer() | 'infinity') -> boolean(). -verify_int(Int, infinity) -> - verify_int(Int); -verify_int(infinity, _Max) -> - true; -verify_int(Int, Max) -> - verify_strict_int(Int) andalso verify_strict_int(Max) andalso (Int =< Max). - --spec verify_uint(Int :: non_neg_integer() | 'infinity', - Max :: non_neg_integer() | 'infinity') -> boolean(). -verify_uint(Int, infinity) -> - verify_uint(Int); -verify_uint(infinity, _Max) -> - true; -verify_uint(Int, Max) -> - verify_strict_int(Int, 0, Max). - --spec verify_strict_int(Int :: integer(), - Min :: integer(), - Max :: integer()) -> boolean(). -verify_strict_int(Val, Min, Max) - when (is_integer(Val) andalso - is_integer(Min) andalso - is_integer(Max) andalso - (Val >= Min) andalso - (Val =< Max)) -> - true; -verify_strict_int(_Val, _Min, _Max) -> - false. - --spec verify_int(Val :: integer() | 'infinity', - Min :: integer(), - Max :: integer() | 'infinity') -> boolean(). -verify_int(infinity, Min, infinity) -> - verify_strict_int(Min); -verify_int(Val, Min, infinity) -> - verify_strict_int(Val) andalso - verify_strict_int(Min) andalso (Val >= Min); -verify_int(Int, Min, Max) -> - verify_strict_int(Int, Min, Max). +verify_resend_indication(Val) -> megaco_config_misc:verify_bool(Val). verify_timer(Timer) -> megaco_timer:verify(Timer). @@ -1641,7 +1583,7 @@ verify_timer(Timer) -> verify_segmentation_window(none) -> true; verify_segmentation_window(K) -> - verify_int(K, 1, infinity). + megaco_config_misc:verify_int(K, 1, infinity). handle_stop_user(UserMid) -> case catch user_info(UserMid, mid) of diff --git a/lib/megaco/src/engine/megaco_config_misc.erl b/lib/megaco/src/engine/megaco_config_misc.erl new file mode 100644 index 0000000000..0a1601c766 --- /dev/null +++ b/lib/megaco/src/engine/megaco_config_misc.erl @@ -0,0 +1,113 @@ +%% +%% %CopyrightBegin% +%% +%% Copyright Ericsson AB 2011-2011. All Rights Reserved. +%% +%% The contents of this file are subject to the Erlang Public License, +%% Version 1.1, (the "License"); you may not use this file except in +%% compliance with the License. You should have received a copy of the +%% Erlang Public License along with this software. If not, it can be +%% retrieved online at http://www.erlang.org/. +%% +%% Software distributed under the License is distributed on an "AS IS" +%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See +%% the License for the specific language governing rights and limitations +%% under the License. +%% +%% %CopyrightEnd% +%% + +%% +%%---------------------------------------------------------------------- +%% Purpose: Utility module for megaco_config +%%---------------------------------------------------------------------- +%% + +-module(megaco_config_misc). + +%% Application internal exports +-export([ + verify_bool/1, + + verify_int/1, verify_int/2, verify_int/3, + verify_strict_int/1, verify_strict_int/2, verify_strict_int/3, + + verify_uint/1, verify_uint/2, + verify_strict_uint/1, verify_strict_uint/2 + ]). + + +%%%---------------------------------------------------------------------- +%%% API +%%%---------------------------------------------------------------------- + +verify_bool(true) -> true; +verify_bool(false) -> true; +verify_bool(_) -> false. + + +%% verify_int(Val) -> boolean() +verify_int(infinity) -> true; +verify_int(Val) -> verify_strict_int(Val). + +%% verify_int(Val, Max) -> boolean() +verify_int(Int, infinity) -> + verify_int(Int); +verify_int(infinity, _Max) -> + true; +verify_int(Int, Max) -> + verify_strict_int(Int) andalso verify_strict_int(Max) andalso (Int =< Max). + +%% verify_int(Val, Min, Max) -> boolean() +verify_int(infinity, Min, infinity) -> + verify_strict_int(Min); +verify_int(Val, Min, infinity) -> + verify_strict_int(Val) andalso + verify_strict_int(Min) andalso (Val >= Min); +verify_int(Int, Min, Max) -> + verify_strict_int(Int, Min, Max). + +%% verify_strict_int(Val) -> boolean() +verify_strict_int(Int) when is_integer(Int) -> true; +verify_strict_int(_) -> false. + +%% verify_strict_int(Val, Max) -> boolean() +verify_strict_int(Int, infinity) -> + verify_strict_int(Int); +verify_strict_int(Int, Max) -> + verify_strict_int(Int) andalso verify_strict_int(Max) andalso (Int =< Max). + +%% verify_strict_int(Val, Min, Max) -> boolean() +verify_strict_int(Val, Min, Max) + when (is_integer(Val) andalso + is_integer(Min) andalso + is_integer(Max) andalso + (Val >= Min) andalso + (Val =< Max)) -> + true; +verify_strict_int(_Val, _Min, _Max) -> + false. + + +%% verify_uint(Val) -> boolean() +verify_uint(infinity) -> true; +verify_uint(Val) -> verify_strict_uint(Val). + +%% verify_uint(Val, Max) -> boolean() +verify_uint(Int, infinity) -> + verify_uint(Int); +verify_uint(infinity, _Max) -> + true; +verify_uint(Int, Max) -> + verify_strict_int(Int, 0, Max). + +%% verify_strict_uint(Val) -> boolean() +verify_strict_uint(Int) when is_integer(Int) andalso (Int >= 0) -> true; +verify_strict_uint(_) -> false. + +%% verify_strict_uint(Val, Max) -> boolean() +verify_strict_uint(Int, infinity) -> + verify_strict_uint(Int); +verify_strict_uint(Int, Max) -> + verify_strict_int(Int, 0, Max). + diff --git a/lib/megaco/src/engine/megaco_filter.erl b/lib/megaco/src/engine/megaco_filter.erl index 9df752789c..fb0c700a82 100644 --- a/lib/megaco/src/engine/megaco_filter.erl +++ b/lib/megaco/src/engine/megaco_filter.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2000-2010. All Rights Reserved. +%% Copyright Ericsson AB 2000-2011. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -21,6 +21,7 @@ %%---------------------------------------------------------------------- %% Purpose : Megaco/H.248 customization of the Event Tracer tool %%---------------------------------------------------------------------- +%% -module(megaco_filter). @@ -33,6 +34,7 @@ -include_lib("megaco/src/app/megaco_internal.hrl"). -include_lib("et/include/et.hrl"). + %%---------------------------------------------------------------------- %% BUGBUG: There are some opportunities for improvements: %% @@ -43,7 +45,8 @@ %% records that already are defined in megaco_message_{v1,v2,v3}.hrl. %% * The records megaco_udp and megaco_tcp are copied from the files %% megaco_udp.hrl and megaco_tcp.hrl respectively, as we cannot include -%% both header files. They both defines the macros HEAP_SIZE and GC_MSG_LIMIT. +%% both header files. +%% They both defines the macros HEAP_SIZE and GC_MSG_LIMIT. %%-include("megaco_message_internal.hrl"). -record('megaco_transaction_reply', @@ -76,6 +79,8 @@ module = megaco, serialize = false % false: Spawn a new process for each message }). + + %%---------------------------------------------------------------------- start() -> @@ -360,28 +365,24 @@ pretty(_ConnData, MegaMsg) when is_record(MegaMsg, 'MegacoMessage') -> {ok, Bin} = megaco_pretty_text_encoder:encode_message([], MegaMsg), term_to_string(Bin); pretty(_ConnData, CmdReq) when is_record(CmdReq, 'CommandRequest') -> - {ok, IoList} = megaco_pretty_text_encoder:encode_command_request(CmdReq), - term_to_string(lists:flatten(IoList)); + {ok, Bin} = megaco_pretty_text_encoder:encode_command_request(CmdReq), + term_to_string(Bin); pretty(_ConnData, {complete_success, ContextId, RepList}) -> ActRep = #'ActionReply'{contextId = ContextId, commandReply = RepList}, - {ok, IoList} = megaco_pretty_text_encoder:encode_action_reply(ActRep), - term_to_string(lists:flatten(IoList)); + {ok, Bin} = megaco_pretty_text_encoder:encode_action_reply(ActRep), + term_to_string(Bin); pretty(_ConnData, AR) when is_record(AR, 'ActionReply') -> - {ok, IoList} = megaco_pretty_text_encoder:encode_action_reply(AR), - term_to_string(lists:flatten(IoList)); + {ok, Bin} = megaco_pretty_text_encoder:encode_action_reply(AR), + term_to_string(Bin); pretty(_ConnData, {partial_failure, ContextId, RepList}) -> ActRep = #'ActionReply'{contextId = ContextId, commandReply = RepList}, - {ok, IoList} = megaco_pretty_text_encoder:encode_action_reply(ActRep), - term_to_string(lists:flatten(IoList)); + {ok, Bin} = megaco_pretty_text_encoder:encode_action_reply(ActRep), + term_to_string(Bin); pretty(_ConnData, {trans, Trans}) -> - case megaco_pretty_text_encoder:encode_transaction(Trans) of - {ok, Bin} when is_binary(Bin) -> - term_to_string(binary_to_list(Bin)); - {ok, IoList} -> - term_to_string(lists:flatten(IoList)) - end; + {ok, Bin} = megaco_pretty_text_encoder:encode_transaction(Trans), + term_to_string(Bin); pretty(__ConnData, Other) -> term_to_string(Other). diff --git a/lib/megaco/src/engine/megaco_sdp.erl b/lib/megaco/src/engine/megaco_sdp.erl index 37f28cac59..96732584fb 100644 --- a/lib/megaco/src/engine/megaco_sdp.erl +++ b/lib/megaco/src/engine/megaco_sdp.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2001-2010. All Rights Reserved. +%% Copyright Ericsson AB 2001-2011. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -877,9 +877,7 @@ decode_bandwidth_bwt("CT") -> decode_bandwidth_bwt("AS") -> as; decode_bandwidth_bwt(BwType) when is_list(BwType) -> - BwType; -decode_bandwidth_bwt(BadBwType) -> - error({invalid_bandwidth_bwtype, BadBwType}). + BwType. encode_bandwidth_bwt(ct) -> "CT"; diff --git a/lib/megaco/src/engine/megaco_timer.erl b/lib/megaco/src/engine/megaco_timer.erl index 9f524523a8..1336be0b5b 100644 --- a/lib/megaco/src/engine/megaco_timer.erl +++ b/lib/megaco/src/engine/megaco_timer.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2007-2009. All Rights Reserved. +%% Copyright Ericsson AB 2007-2011. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -42,7 +42,7 @@ %% NewTimer = megaco_timer() %% TimeoutTime = infinity | integer() %% -init(SingleWaitFor) when SingleWaitFor == infinity -> +init(SingleWaitFor) when SingleWaitFor =:= infinity -> {SingleWaitFor, timeout}; init(SingleWaitFor) when is_integer(SingleWaitFor) and (SingleWaitFor >= 0) -> {SingleWaitFor, timeout}; @@ -76,17 +76,17 @@ verify(#megaco_incr_timer{wait_for = WaitFor, factor = Factor, incr = Incr, max_retries = MaxRetries}) -> - (megaco_config:verify_strict_uint(WaitFor) and - megaco_config:verify_strict_uint(Factor) and - megaco_config:verify_strict_int(Incr) and + (megaco_config_misc:verify_strict_uint(WaitFor) and + megaco_config_misc:verify_strict_uint(Factor) and + megaco_config_misc:verify_strict_int(Incr) and verify_max_retries(MaxRetries)); verify(Timer) -> - megaco_config:verify_uint(Timer). + megaco_config_misc:verify_uint(Timer). verify_max_retries(infinity_restartable) -> true; verify_max_retries(Val) -> - megaco_config:verify_uint(Val). + megaco_config_misc:verify_uint(Val). %%----------------------------------------------------------------- diff --git a/lib/megaco/src/engine/modules.mk b/lib/megaco/src/engine/modules.mk index 44bcadc37b..4bc57cd63e 100644 --- a/lib/megaco/src/engine/modules.mk +++ b/lib/megaco/src/engine/modules.mk @@ -2,7 +2,7 @@ # %CopyrightBegin% # -# Copyright Ericsson AB 2001-2009. All Rights Reserved. +# Copyright Ericsson AB 2001-2011. All Rights Reserved. # # The contents of this file are subject to the Erlang Public License, # Version 1.1, (the "License"); you may not use this file except in @@ -24,6 +24,7 @@ BEHAVIOUR_MODULES = \ MODULES = \ $(BEHAVIOUR_MODULES) \ + megaco_config_misc \ megaco_config \ megaco_digit_map \ megaco_erl_dist_encoder \ diff --git a/lib/megaco/src/flex/megaco_flex_scanner.erl b/lib/megaco/src/flex/megaco_flex_scanner.erl index e471412c13..508f8905e7 100644 --- a/lib/megaco/src/flex/megaco_flex_scanner.erl +++ b/lib/megaco/src/flex/megaco_flex_scanner.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2001-2009. All Rights Reserved. +%% Copyright Ericsson AB 2001-2011. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -30,21 +30,11 @@ -define(SCHED_ID(), erlang:system_info(scheduler_id)). -define(SMP_SUPPORT_DEFAULT(), erlang:system_info(smp_support)). -is_enabled() -> - case ?ENABLE_MEGACO_FLEX_SCANNER of - true -> - true; - _ -> - false - end. +is_enabled() -> + (true =:= ?ENABLE_MEGACO_FLEX_SCANNER). is_reentrant_enabled() -> - case ?MEGACO_REENTRANT_FLEX_SCANNER of - true -> - true; - _ -> - false - end. + (true =:= ?MEGACO_REENTRANT_FLEX_SCANNER). is_scanner_port(Port, Port) when is_port(Port) -> true; diff --git a/lib/megaco/test/megaco.cover b/lib/megaco/test/megaco.cover index e7764017d4..be21216c24 100644 --- a/lib/megaco/test/megaco.cover +++ b/lib/megaco/test/megaco.cover @@ -1,5 +1,7 @@ +{incl_app,megaco,details}. + %% -*- erlang -*- -{exclude, +{excl_mods, megaco, [megaco_encoder, megaco_edist_compress, megaco_filter, diff --git a/lib/megaco/test/megaco.spec b/lib/megaco/test/megaco.spec index 7493bd5df8..cab8499835 100644 --- a/lib/megaco/test/megaco.spec +++ b/lib/megaco/test/megaco.spec @@ -1,5 +1,2 @@ -{topcase, {dir, "../megaco_test"}}. -{require_nodenames, 1}. -%{skip, {megaco_digit_map_test, all, "Not yet implemented"}}. -{skip, {megaco_measure_test, all, "Not yet implemented"}}. -%{skip, {M, F, "Not yet implemented"}}. +{suites,"../megaco_test",all}. +{skip_cases,"../megaco_test",megaco_measure_test,[all],"Not yet implemented"}. diff --git a/lib/megaco/test/megaco_SUITE.erl b/lib/megaco/test/megaco_SUITE.erl index 1bb3a570a4..007677ba4d 100644 --- a/lib/megaco/test/megaco_SUITE.erl +++ b/lib/megaco/test/megaco_SUITE.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2000-2009. All Rights Reserved. +%% Copyright Ericsson AB 2000-2011. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -36,8 +36,8 @@ t(Case) -> megaco_test_lib:t({?MODULE, Case}). init_per_testcase(Case, Config) -> megaco_test_lib:init_per_testcase(Case, Config). -fin_per_testcase(Case, Config) -> - megaco_test_lib:fin_per_testcase(Case, Config). +end_per_testcase(Case, Config) -> + megaco_test_lib:end_per_testcase(Case, Config). init() -> process_flag(trap_exit, true), @@ -46,97 +46,86 @@ init() -> %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %% Top test case -all(suite) -> - [ - app_test, - appup_test, - config, - flex, - udp, - tcp, - examples, - %% call_flow, - digit_map, - mess, - measure, - binary_term_id, - codec, - sdp, - mib, - trans, - actions, - load, - pending_limit, - segmented, - timer - ]. +suite() -> [{ct_hooks, [{ts_install_cth, [{nodenames,1}]}]}]. + +all() -> + [{group, app_test}, + {group, appup_test}, + {group, config}, + {group, flex}, + {group, udp}, + {group, tcp}, + {group, examples}, + {group, digit_map}, + {group, mess}, + {group, measure}, + {group, binary_term_id}, + {group, codec}, + {group, sdp}, + {group, mib}, + {group, trans}, + {group, actions}, + {group, load}, + {group, pending_limit}, + {group, segmented}, + {group, timer}]. + +groups() -> + [{tickets, [], [{group, mess}, {group, codec}]}, + {app_test, [], [{megaco_app_test, all}]}, + {appup_test, [], [{megaco_appup_test, all}]}, + {config, [], [{megaco_config_test, all}]}, + {call_flow, [], [{megaco_call_flow_test, all}]}, + {digit_map, [], [{megaco_digit_map_test, all}]}, + {mess, [], [{megaco_mess_test, all}]}, + {udp, [], [{megaco_udp_test, all}]}, + {tcp, [], [{megaco_tcp_test, all}]}, + {examples, [], [{megaco_examples_test, all}]}, + {measure, [], [{megaco_measure_test, all}]}, + {binary_term_id, [], [{megaco_binary_term_id_test, all}]}, + {codec, [], [{megaco_codec_test, all}]}, + {sdp, [], [{megaco_sdp_test, all}]}, + {mib, [], [{megaco_mib_test, all}]}, + {trans, [], [{megaco_trans_test, all}]}, + {actions, [], [{megaco_actions_test, all}]}, + {load, [], [{megaco_load_test, all}]}, + {pending_limit, [], [{megaco_pending_limit_test, all}]}, + {segmented, [], [{megaco_segment_test, all}]}, + {timer, [], [{megaco_timer_test, all}]}, + {flex, [], [{megaco_flex_test, all}]}]. + +init_per_suite(Config) -> + Config. + +end_per_suite(_Config) -> + ok. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + -tickets(suite) -> - [ - mess, - codec - ]. -app_test(suite) -> - [{megaco_app_test, all}]. -appup_test(suite) -> - [{megaco_appup_test, all}]. -config(suite) -> - [{megaco_config_test, all}]. -call_flow(suite) -> - [{megaco_call_flow_test, all}]. -digit_map(suite) -> - [{megaco_digit_map_test, all}]. -mess(suite) -> - [{megaco_mess_test, all}]. -udp(suite) -> - [{megaco_udp_test, all}]. -tcp(suite) -> - [{megaco_tcp_test, all}]. -examples(suite) -> - [{megaco_examples_test, all}]. -measure(suite) -> - [{megaco_measure_test, all}]. -binary_term_id(suite) -> - [{megaco_binary_term_id_test, all}]. -codec(suite) -> - [{megaco_codec_test, all}]. -sdp(suite) -> - [{megaco_sdp_test, all}]. -mib(suite) -> - [{megaco_mib_test, all}]. -trans(suite) -> - [{megaco_trans_test, all}]. -actions(suite) -> - [{megaco_actions_test, all}]. -load(suite) -> - [{megaco_load_test, all}]. -pending_limit(suite) -> - [{megaco_pending_limit_test, all}]. -segmented(suite) -> - [{megaco_segment_test, all}]. -timer(suite) -> - [{megaco_timer_test, all}]. -flex(suite) -> - [{megaco_flex_test, all}]. diff --git a/lib/megaco/test/megaco_actions_test.erl b/lib/megaco/test/megaco_actions_test.erl index d493022ca1..2efb6e834a 100644 --- a/lib/megaco/test/megaco_actions_test.erl +++ b/lib/megaco/test/megaco_actions_test.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2004-2009. All Rights Reserved. +%% Copyright Ericsson AB 2004-2010. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -72,28 +72,25 @@ init_per_testcase(Case, Config) -> process_flag(trap_exit, true), megaco_test_lib:init_per_testcase(Case, Config). -fin_per_testcase(Case, Config) -> +end_per_testcase(Case, Config) -> process_flag(trap_exit, false), - megaco_test_lib:fin_per_testcase(Case, Config). + megaco_test_lib:end_per_testcase(Case, Config). %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -all(suite) -> - Cases = - [ - pretty_text, - flex_pretty_text, - compact_text, - flex_compact_text, - erl_dist, - erl_dist_mc, - ber_bin, - ber_bin_drv, - ber_bin_native, - ber_bin_drv_native - ], - Cases. +all() -> + [pretty_text, flex_pretty_text, compact_text, + flex_compact_text, erl_dist, erl_dist_mc, ber_bin, + ber_bin_drv, ber_bin_native, ber_bin_drv_native]. +groups() -> + []. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/lib/megaco/test/megaco_app_test.erl b/lib/megaco/test/megaco_app_test.erl index 597ec26338..00f7b7fb68 100644 --- a/lib/megaco/test/megaco_app_test.erl +++ b/lib/megaco/test/megaco_app_test.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2002-2010. All Rights Reserved. +%% Copyright Ericsson AB 2002-2011. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -39,28 +39,36 @@ init_per_testcase(undef_funcs = Case, Config) -> init_per_testcase(Case, Config) -> megaco_test_lib:init_per_testcase(Case, Config). -fin_per_testcase(Case, Config) -> - megaco_test_lib:fin_per_testcase(Case, Config). +end_per_testcase(Case, Config) -> + megaco_test_lib:end_per_testcase(Case, Config). + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -all(suite) -> - Cases = - [ - fields, - modules, - exportall, - app_depend, - undef_funcs - ], - {req, [], {conf, app_init, Cases, app_fin}}. +all() -> + [ + fields, + modules, + exportall, + app_depend, + undef_funcs + ]. + +groups() -> + []. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -app_init(suite) -> []; -app_init(doc) -> []; -app_init(Config) when is_list(Config) -> +init_per_suite(suite) -> []; +init_per_suite(doc) -> []; +init_per_suite(Config) when is_list(Config) -> case is_app(megaco) of {ok, AppFile} -> io:format("AppFile: ~n~p~n", [AppFile]), @@ -96,9 +104,9 @@ is_app(App) -> end. -app_fin(suite) -> []; -app_fin(doc) -> []; -app_fin(Config) when is_list(Config) -> +end_per_suite(suite) -> []; +end_per_suite(doc) -> []; +end_per_suite(Config) when is_list(Config) -> Config. @@ -110,7 +118,7 @@ fields(doc) -> []; fields(Config) when is_list(Config) -> AppFile = key1search(app_file, Config), - Fields = [vsn, description, modules, registered, applications], + Fields = [vsn, description, modules, registered, applications], case check_fields(Fields, AppFile, []) of [] -> ok; diff --git a/lib/megaco/test/megaco_appup_mg.erl b/lib/megaco/test/megaco_appup_mg.erl index f6060e406b..bb8b098f5d 100644 --- a/lib/megaco/test/megaco_appup_mg.erl +++ b/lib/megaco/test/megaco_appup_mg.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2003-2009. All Rights Reserved. +%% Copyright Ericsson AB 2003-2010. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in diff --git a/lib/megaco/test/megaco_appup_mgc.erl b/lib/megaco/test/megaco_appup_mgc.erl index b6e53655f8..49c5f24852 100644 --- a/lib/megaco/test/megaco_appup_mgc.erl +++ b/lib/megaco/test/megaco_appup_mgc.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2003-2009. All Rights Reserved. +%% Copyright Ericsson AB 2003-2010. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in diff --git a/lib/megaco/test/megaco_appup_test.erl b/lib/megaco/test/megaco_appup_test.erl index 09732c6a4d..40eebcae86 100644 --- a/lib/megaco/test/megaco_appup_test.erl +++ b/lib/megaco/test/megaco_appup_test.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2002-2009. All Rights Reserved. +%% Copyright Ericsson AB 2002-2011. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -24,6 +24,7 @@ -module(megaco_appup_test). -compile(export_all). +-compile({no_auto_import,[error/1]}). -include("megaco_test_lib.hrl"). @@ -37,25 +38,31 @@ t(Case) -> megaco_test_lib:t({?MODULE, Case}). init_per_testcase(Case, Config) -> megaco_test_lib:init_per_testcase(Case, Config). -fin_per_testcase(Case, Config) -> - megaco_test_lib:fin_per_testcase(Case, Config). +end_per_testcase(Case, Config) -> + megaco_test_lib:end_per_testcase(Case, Config). %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -all(suite) -> - Cases = - [ - appup - ], - {req, [], {conf, appup_init, Cases, appup_fin}}. +all() -> + [appup]. + +groups() -> + []. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -appup_init(suite) -> []; -appup_init(doc) -> []; -appup_init(Config) when is_list(Config) -> +init_per_suite(suite) -> []; +init_per_suite(doc) -> []; +init_per_suite(Config) when is_list(Config) -> AppFile = file_name(?APPLICATION, ".app"), AppupFile = file_name(?APPLICATION, ".appup"), [{app_file, AppFile}, {appup_file, AppupFile}|Config]. @@ -66,9 +73,9 @@ file_name(App, Ext) -> filename:join([LibDir, "ebin", atom_to_list(App) ++ Ext]). -appup_fin(suite) -> []; -appup_fin(doc) -> []; -appup_fin(Config) when is_list(Config) -> +end_per_suite(suite) -> []; +end_per_suite(doc) -> []; +end_per_suite(Config) when is_list(Config) -> Config. diff --git a/lib/megaco/test/megaco_binary_term_id_test.erl b/lib/megaco/test/megaco_binary_term_id_test.erl index da4e69c617..47a7a76c1c 100644 --- a/lib/megaco/test/megaco_binary_term_id_test.erl +++ b/lib/megaco/test/megaco_binary_term_id_test.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2001-2009. All Rights Reserved. +%% Copyright Ericsson AB 2001-2010. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -37,8 +37,8 @@ -export([t/0]). %% Test suite exports --export([all/1, encode_first/1, decode_first/1, - init_per_testcase/2, fin_per_testcase/2]). +-export([all/0,groups/0,init_per_group/2,end_per_group/2, + init_per_testcase/2, end_per_testcase/2]). %%---------------------------------------------------------------------- @@ -57,25 +57,25 @@ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %% Top test case -all(suite) -> - [ - encode_first, - decode_first - ]. +all() -> + [{group, encode_first}, {group, decode_first}]. -encode_first(suite) -> - encode_first_cases(). +groups() -> + [{encode_first, [], encode_first_cases()}, + {decode_first, [], decode_first_cases()}]. -decode_first(suite) -> - decode_first_cases(). +init_per_group(_GroupName, Config) -> + Config. +end_per_group(_GroupName, Config) -> + Config. %% Test server callbacks init_per_testcase(Case, Config) -> megaco_test_lib:init_per_testcase(Case, Config). -fin_per_testcase(Case, Config) -> - megaco_test_lib:fin_per_testcase(Case, Config). +end_per_testcase(Case, Config) -> + megaco_test_lib:end_per_testcase(Case, Config). %%====================================================================== @@ -89,11 +89,12 @@ t() -> cases() -> encode_first_cases() ++ decode_first_cases(). -encode_first_cases() -> [te01,te02,te03,te04,te05, - te06,te07,te08,te09,te10, - te11,te12,te13,te14,te15, - te16,te17,te18,te19]. -decode_first_cases() -> [td01,td02,td03,td04,td05,td06]. +encode_first_cases() -> +[te01, te02, te03, te04, te05, te06, te07, te08, te09, + te10, te11, te12, te13, te14, te15, te16, te17, te18, + te19]. +decode_first_cases() -> +[td01, td02, td03, td04, td05, td06]. do(Case) -> case doc(Case) of diff --git a/lib/megaco/test/megaco_call_flow_test.erl b/lib/megaco/test/megaco_call_flow_test.erl index a25a7924e8..b9d64ca8b2 100644 --- a/lib/megaco/test/megaco_call_flow_test.erl +++ b/lib/megaco/test/megaco_call_flow_test.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2000-2009. All Rights Reserved. +%% Copyright Ericsson AB 2000-2010. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -50,37 +50,25 @@ t(Case) -> megaco_test_lib:t({?MODULE, Case}). init_per_testcase(Case, Config) -> megaco_test_lib:init_per_testcase(Case, Config). -fin_per_testcase(Case, Config) -> - megaco_test_lib:fin_per_testcase(Case, Config). +end_per_testcase(Case, Config) -> + megaco_test_lib:end_per_testcase(Case, Config). %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %% Top test case -all(suite) -> - [ - text, - binary - ]. +all() -> + [{group, text}, {group, binary}]. -text(suite) -> - [ - pretty, - compact - ]. +groups() -> + [{text, [], [pretty, compact]}, + {flex, [], [pretty_flex, compact_flex]}, + {binary, [], [bin, ber, ber_bin, per]}]. -flex(suite) -> - [ - pretty_flex, - compact_flex - ]. +init_per_group(_GroupName, Config) -> + Config. -binary(suite) -> - [ - bin, - ber, - ber_bin, - per - ]. +end_per_group(_GroupName, Config) -> + Config. pretty(suite) -> []; diff --git a/lib/megaco/test/megaco_codec_flex_lib.erl b/lib/megaco/test/megaco_codec_flex_lib.erl index de76956711..93bc5d4bbc 100644 --- a/lib/megaco/test/megaco_codec_flex_lib.erl +++ b/lib/megaco/test/megaco_codec_flex_lib.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2007-2009. All Rights Reserved. +%% Copyright Ericsson AB 2007-2010. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in diff --git a/lib/megaco/test/megaco_codec_mini_test.erl b/lib/megaco/test/megaco_codec_mini_test.erl index e509739bb1..ff0c154c7c 100644 --- a/lib/megaco/test/megaco_codec_mini_test.erl +++ b/lib/megaco/test/megaco_codec_mini_test.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2008-2009. All Rights Reserved. +%% Copyright Ericsson AB 2008-2010. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -34,14 +34,14 @@ -export([t/0, t/1]). --export([all/1, +-export([all/0,groups/0,init_per_group/2,end_per_group/2, tickets/0, - tickets/1, + otp7672_msg01/1, otp7672_msg02/1, - init_per_testcase/2, fin_per_testcase/2]). + init_per_testcase/2, end_per_testcase/2]). %% ---- @@ -49,31 +49,6 @@ -define(SET_DBG(S,D), begin put(severity, S), put(dbg, D) end). -define(RESET_DBG(), begin erase(severity), erase(dbg) end). - -%% ---- - -tickets() -> - Flag = process_flag(trap_exit, true), - Cases = expand(tickets), - Fun = fun(Case) -> - C = init_per_testcase(Case, [{tc_timeout, - timer:minutes(10)}]), - io:format("Eval ~w~n", [Case]), - Result = - case (catch apply(?MODULE, Case, [C])) of - {'EXIT', Reason} -> - io:format("~n~p exited:~n ~p~n", - [Case, Reason]), - {error, {Case, Reason}}; - Res -> - Res - end, - fin_per_testcase(Case, C), - Result - end, - process_flag(trap_exit, Flag), - lists:map(Fun, Cases). - expand(RootCase) -> expand([RootCase], []). @@ -106,24 +81,51 @@ init_per_testcase(Case, Config) -> end, megaco_test_lib:init_per_testcase(Case, C). -fin_per_testcase(Case, Config) -> +end_per_testcase(Case, Config) -> erase(verbosity), - megaco_test_lib:fin_per_testcase(Case, Config). + megaco_test_lib:end_per_testcase(Case, Config). %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %% Top test case -all(suite) -> - [ - tickets - ]. +all() -> + [{group, tickets}]. + +groups() -> + [{tickets, [], [otp7672_msg01, otp7672_msg02]}]. + +init_per_group(_GroupName, Config) -> + Config. -tickets(suite) -> - [ - otp7672_msg01, - otp7672_msg02 - ]. +end_per_group(_GroupName, Config) -> + Config. + + + +%% ---- + +tickets() -> + Flag = process_flag(trap_exit, true), + Cases = expand(tickets), + Fun = fun(Case) -> + C = init_per_testcase(Case, [{tc_timeout, + timer:minutes(10)}]), + io:format("Eval ~w~n", [Case]), + Result = + case (catch apply(?MODULE, Case, [C])) of + {'EXIT', Reason} -> + io:format("~n~p exited:~n ~p~n", + [Case, Reason]), + {error, {Case, Reason}}; + Res -> + Res + end, + end_per_testcase(Case, C), + Result + end, + process_flag(trap_exit, Flag), + lists:map(Fun, Cases). %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/lib/megaco/test/megaco_codec_prev3a_test.erl b/lib/megaco/test/megaco_codec_prev3a_test.erl index 696a72343c..d50e72aef1 100644 --- a/lib/megaco/test/megaco_codec_prev3a_test.erl +++ b/lib/megaco/test/megaco_codec_prev3a_test.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2005-2009. All Rights Reserved. +%% Copyright Ericsson AB 2005-2010. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -36,22 +36,16 @@ -export([t/0, t/1]). --export([all/1, +-export([all/0,groups/0,init_per_group/2,end_per_group/2, - text/1, - - pretty/1, pretty_test_msgs/1, - - compact/1, + compact_test_msgs/1, - - flex_pretty/1, + flex_pretty_init/1, flex_pretty_finish/1, flex_pretty_test_msgs/1, - - flex_compact/1, + flex_compact_init/1, flex_compact_finish/1, flex_compact_test_msgs/1, @@ -64,32 +58,21 @@ flex_compact_dm_timers6/1, flex_compact_dm_timers7/1, flex_compact_dm_timers8/1, - - binary/1, - bin/1, bin_test_msgs/1, - - ber/1, + ber_test_msgs/1, - - ber_bin/1, + ber_bin_test_msgs/1, - - per/1, + per_test_msgs/1, - - per_bin/1, + per_bin_test_msgs/1, - - erl_dist/1, - erl_dist_m/1, + erl_dist_m_test_msgs/1, tickets/0, - tickets/1, - - compact_tickets/1, + compact_otp4011_msg1/1, compact_otp4011_msg2/1, compact_otp4011_msg3/1, @@ -132,8 +115,7 @@ compact_otp6017_msg01/1, compact_otp6017_msg02/1, compact_otp6017_msg03/1, - - flex_compact_tickets/1, + flex_compact_otp7431_msg01/1, flex_compact_otp7431_msg02/1, flex_compact_otp7431_msg03/1, @@ -141,8 +123,7 @@ flex_compact_otp7431_msg05/1, flex_compact_otp7431_msg06/1, flex_compact_otp7431_msg07/1, - - pretty_tickets/1, + pretty_otp4632_msg1/1, pretty_otp4632_msg2/1, pretty_otp4632_msg3/1, @@ -185,8 +166,7 @@ pretty_otp7671_msg04/1, pretty_otp7671_msg05/1, pretty_otp8114_msg01/1, - - flex_pretty_tickets/1, + flex_pretty_otp5042_msg1/1, flex_pretty_otp5085_msg1/1, flex_pretty_otp5085_msg2/1, @@ -208,7 +188,7 @@ flex_pretty_otp7431_msg06/1, flex_pretty_otp7431_msg07/1, - init_per_testcase/2, fin_per_testcase/2]). + init_per_testcase/2, end_per_testcase/2]). -export([display_text_messages/0]). @@ -263,30 +243,7 @@ expand([Case|Cases], Acc) -> expand(Cases, [Case|Acc]) end. - -%% ---- - -tickets() -> - Flag = process_flag(trap_exit, true), - Cases = expand(tickets), - Fun = fun(Case) -> - C = init_per_testcase(Case, [{tc_timeout, - timer:minutes(10)}]), - io:format("Eval ~w~n", [Case]), - Result = - case (catch apply(?MODULE, Case, [C])) of - {'EXIT', Reason} -> - io:format("~n~p exited:~n ~p~n", - [Case, Reason]), - {error, {Case, Reason}}; - Res -> - Res - end, - fin_per_testcase(Case, C), - Result - end, - process_flag(trap_exit, Flag), - lists:map(Fun, Cases). + %% ---- @@ -306,268 +263,166 @@ init_per_testcase(Case, Config) -> end, megaco_test_lib:init_per_testcase(Case, C). -fin_per_testcase(Case, Config) -> +end_per_testcase(Case, Config) -> erase(verbosity), - megaco_test_lib:fin_per_testcase(Case, Config). + megaco_test_lib:end_per_testcase(Case, Config). %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %% Top test case -all(suite) -> - [ - text, - binary, - erl_dist, - tickets - ]. - -text(suite) -> - [ - pretty, - flex_pretty, - compact, - flex_compact - ]. - -binary(suite) -> - [ - bin, - ber, - ber_bin, - per, - per_bin - ]. - -erl_dist(suite) -> - [ - erl_dist_m - ]. - -pretty(suite) -> - [ - pretty_test_msgs - ]. - - -compact(suite) -> - [ - compact_test_msgs - ]. - - -flex_pretty(suite) -> - {req, [], - {conf, flex_pretty_init, flex_pretty_cases(), flex_pretty_finish}}. - -flex_pretty_cases() -> - [ - flex_pretty_test_msgs - ]. - -flex_compact(suite) -> - {req, [], - {conf, flex_compact_init, flex_compact_cases(), flex_compact_finish}}. - -flex_compact_cases() -> - [ - flex_compact_test_msgs, - flex_compact_dm_timers1, - flex_compact_dm_timers2, - flex_compact_dm_timers3, - flex_compact_dm_timers4, - flex_compact_dm_timers5, - flex_compact_dm_timers6, - flex_compact_dm_timers7, - flex_compact_dm_timers8 - ]. - - -bin(suite) -> - [ - bin_test_msgs - ]. - - -ber(suite) -> - [ - ber_test_msgs - ]. - - -ber_bin(suite) -> - [ - ber_bin_test_msgs - ]. - - -per(suite) -> - [ - per_test_msgs - ]. - +all() -> + [{group, text}, {group, binary}, {group, erl_dist}, + {group, tickets}]. + +groups() -> + [{text, [], + [{group, pretty}, {group, flex_pretty}, + {group, compact}, {group, flex_compact}]}, + {binary, [], + [{group, bin}, {group, ber}, {group, ber_bin}, + {group, per}, {group, per_bin}]}, + {erl_dist, [], [{group, erl_dist_m}]}, + {pretty, [], [pretty_test_msgs]}, + {compact, [], [compact_test_msgs]}, + {flex_pretty, [], flex_pretty_cases()}, + {flex_compact, [], flex_compact_cases()}, + {bin, [], [bin_test_msgs]}, {ber, [], [ber_test_msgs]}, + {ber_bin, [], [ber_bin_test_msgs]}, + {per, [], [per_test_msgs]}, + {per_bin, [], [per_bin_test_msgs]}, + {erl_dist_m, [], [erl_dist_m_test_msgs]}, + {tickets, [], + [{group, compact_tickets}, + {group, flex_compact_tickets}, {group, pretty_tickets}, + {group, flex_pretty_tickets}]}, + {compact_tickets, [], + [compact_otp4011_msg1, compact_otp4011_msg2, + compact_otp4011_msg3, compact_otp4013_msg1, + compact_otp4085_msg1, compact_otp4085_msg2, + compact_otp4280_msg1, compact_otp4299_msg1, + compact_otp4299_msg2, compact_otp4359_msg1, + compact_otp4920_msg0, compact_otp4920_msg1, + compact_otp4920_msg2, compact_otp4920_msg3, + compact_otp4920_msg4, compact_otp4920_msg5, + compact_otp4920_msg6, compact_otp4920_msg7, + compact_otp4920_msg8, compact_otp4920_msg9, + compact_otp4920_msg10, compact_otp4920_msg11, + compact_otp4920_msg12, compact_otp4920_msg20, + compact_otp4920_msg21, compact_otp4920_msg22, + compact_otp4920_msg23, compact_otp4920_msg24, + compact_otp4920_msg25, compact_otp5186_msg01, + compact_otp5186_msg02, compact_otp5186_msg03, + compact_otp5186_msg04, compact_otp5186_msg05, + compact_otp5186_msg06, compact_otp5793_msg01, + compact_otp5993_msg01, compact_otp5993_msg02, + compact_otp5993_msg03, compact_otp6017_msg01, + compact_otp6017_msg02, compact_otp6017_msg03]}, + {flex_compact_tickets, [], + flex_compact_tickets_cases()}, + {pretty_tickets, [], + [pretty_otp4632_msg1, pretty_otp4632_msg2, + pretty_otp4632_msg3, pretty_otp4632_msg4, + pretty_otp4710_msg1, pretty_otp4710_msg2, + pretty_otp4945_msg1, pretty_otp4945_msg2, + pretty_otp4945_msg3, pretty_otp4945_msg4, + pretty_otp4945_msg5, pretty_otp4945_msg6, + pretty_otp4949_msg1, pretty_otp4949_msg2, + pretty_otp4949_msg3, pretty_otp5042_msg1, + pretty_otp5068_msg1, pretty_otp5085_msg1, + pretty_otp5085_msg2, pretty_otp5085_msg3, + pretty_otp5085_msg4, pretty_otp5085_msg5, + pretty_otp5085_msg6, pretty_otp5085_msg7, + pretty_otp5085_msg8, pretty_otp5600_msg1, + pretty_otp5600_msg2, pretty_otp5601_msg1, + pretty_otp5793_msg01, pretty_otp5882_msg01, + pretty_otp6490_msg01, pretty_otp6490_msg02, + pretty_otp6490_msg03, pretty_otp6490_msg04, + pretty_otp6490_msg05, pretty_otp6490_msg06, + pretty_otp7671_msg01, pretty_otp7671_msg02, + pretty_otp7671_msg03, pretty_otp7671_msg04, + pretty_otp7671_msg05, pretty_otp8114_msg01]}, + {flex_pretty_tickets, [], flex_pretty_tickets_cases()}]. + +init_per_group(flex_pretty_tickets, Config) -> + flex_pretty_init(Config); +init_per_group(flex_compact_tickets, Config) -> + flex_compact_init(Config); +init_per_group(flex_compact, Config) -> + flex_compact_init(Config); +init_per_group(flex_pretty, Config) -> + flex_pretty_init(Config); +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(flex_pretty_tickets, Config) -> + flex_pretty_finish(Config); +end_per_group(flex_compact_tickets, Config) -> + flex_compact_finish(Config); +end_per_group(flex_compact, Config) -> + flex_compact_finish(Config); +end_per_group(flex_pretty, Config) -> + flex_pretty_finish(Config); +end_per_group(_GroupName, Config) -> + Config. + +flex_pretty_cases() -> + [flex_pretty_test_msgs]. + + +flex_compact_cases() -> + [flex_compact_test_msgs, flex_compact_dm_timers1, + flex_compact_dm_timers2, flex_compact_dm_timers3, + flex_compact_dm_timers4, flex_compact_dm_timers5, + flex_compact_dm_timers6, flex_compact_dm_timers7, + flex_compact_dm_timers8]. %% Support for per_bin was added to ASN.1 as of version %% 1.3.2 (R8). And later merged into 1.3.1.3 (R7). These %% releases are identical (as far as I know). %% -per_bin(suite) -> - [ - per_bin_test_msgs - ]. - - -erl_dist_m(suite) -> - [ - erl_dist_m_test_msgs - ]. - -tickets(suite) -> - [ - compact_tickets, - flex_compact_tickets, - pretty_tickets, - flex_pretty_tickets - ]. - -compact_tickets(suite) -> - [ - compact_otp4011_msg1, - compact_otp4011_msg2, - compact_otp4011_msg3, - compact_otp4013_msg1, - compact_otp4085_msg1, - compact_otp4085_msg2, - compact_otp4280_msg1, - compact_otp4299_msg1, - compact_otp4299_msg2, - compact_otp4359_msg1, - compact_otp4920_msg0, - compact_otp4920_msg1, - compact_otp4920_msg2, - compact_otp4920_msg3, - compact_otp4920_msg4, - compact_otp4920_msg5, - compact_otp4920_msg6, - compact_otp4920_msg7, - compact_otp4920_msg8, - compact_otp4920_msg9, - compact_otp4920_msg10, - compact_otp4920_msg11, - compact_otp4920_msg12, - compact_otp4920_msg20, - compact_otp4920_msg21, - compact_otp4920_msg22, - compact_otp4920_msg23, - compact_otp4920_msg24, - compact_otp4920_msg25, - compact_otp5186_msg01, - compact_otp5186_msg02, - compact_otp5186_msg03, - compact_otp5186_msg04, - compact_otp5186_msg05, - compact_otp5186_msg06, - compact_otp5793_msg01, - compact_otp5993_msg01, - compact_otp5993_msg02, - compact_otp5993_msg03, - compact_otp6017_msg01, - compact_otp6017_msg02, - compact_otp6017_msg03 - ]. - -flex_compact_tickets(suite) -> - {req, [], - {conf, flex_compact_init, flex_compact_tickets_cases(), - flex_compact_finish}}. +flex_compact_tickets_cases() -> + [flex_compact_otp7431_msg01, flex_compact_otp7431_msg02, + flex_compact_otp7431_msg03, flex_compact_otp7431_msg04, + flex_compact_otp7431_msg05, flex_compact_otp7431_msg06, + flex_compact_otp7431_msg07]. + +flex_pretty_tickets_cases() -> + [flex_pretty_otp5042_msg1, flex_pretty_otp5085_msg1, + flex_pretty_otp5085_msg2, flex_pretty_otp5085_msg3, + flex_pretty_otp5085_msg4, flex_pretty_otp5085_msg5, + flex_pretty_otp5085_msg6, flex_pretty_otp5085_msg7, + flex_pretty_otp5085_msg8, flex_pretty_otp5600_msg1, + flex_pretty_otp5600_msg2, flex_pretty_otp5601_msg1, + flex_pretty_otp5793_msg01, flex_pretty_otp7431_msg01, + flex_pretty_otp7431_msg02, flex_pretty_otp7431_msg03, + flex_pretty_otp7431_msg04, flex_pretty_otp7431_msg05, + flex_pretty_otp7431_msg06, flex_pretty_otp7431_msg07]. -flex_compact_tickets_cases() -> - [ - flex_compact_otp7431_msg01, - flex_compact_otp7431_msg02, - flex_compact_otp7431_msg03, - flex_compact_otp7431_msg04, - flex_compact_otp7431_msg05, - flex_compact_otp7431_msg06, - flex_compact_otp7431_msg07 - ]. - - -pretty_tickets(suite) -> - [ - pretty_otp4632_msg1, - pretty_otp4632_msg2, - pretty_otp4632_msg3, - pretty_otp4632_msg4, - pretty_otp4710_msg1, - pretty_otp4710_msg2, - pretty_otp4945_msg1, - pretty_otp4945_msg2, - pretty_otp4945_msg3, - pretty_otp4945_msg4, - pretty_otp4945_msg5, - pretty_otp4945_msg6, - pretty_otp4949_msg1, - pretty_otp4949_msg2, - pretty_otp4949_msg3, - pretty_otp5042_msg1, - pretty_otp5068_msg1, - pretty_otp5085_msg1, - pretty_otp5085_msg2, - pretty_otp5085_msg3, - pretty_otp5085_msg4, - pretty_otp5085_msg5, - pretty_otp5085_msg6, - pretty_otp5085_msg7, - pretty_otp5085_msg8, - pretty_otp5600_msg1, - pretty_otp5600_msg2, - pretty_otp5601_msg1, - pretty_otp5793_msg01, - pretty_otp5882_msg01, - pretty_otp6490_msg01, - pretty_otp6490_msg02, - pretty_otp6490_msg03, - pretty_otp6490_msg04, - pretty_otp6490_msg05, - pretty_otp6490_msg06, - pretty_otp7671_msg01, - pretty_otp7671_msg02, - pretty_otp7671_msg03, - pretty_otp7671_msg04, - pretty_otp7671_msg05, - pretty_otp8114_msg01 - ]. +%% ---- -flex_pretty_tickets(suite) -> - {req, [], - {conf, flex_pretty_init, flex_pretty_tickets_cases(), - flex_pretty_finish}}. - -flex_pretty_tickets_cases() -> - [ - flex_pretty_otp5042_msg1, - flex_pretty_otp5085_msg1, - flex_pretty_otp5085_msg2, - flex_pretty_otp5085_msg3, - flex_pretty_otp5085_msg4, - flex_pretty_otp5085_msg5, - flex_pretty_otp5085_msg6, - flex_pretty_otp5085_msg7, - flex_pretty_otp5085_msg8, - flex_pretty_otp5600_msg1, - flex_pretty_otp5600_msg2, - flex_pretty_otp5601_msg1, - flex_pretty_otp5793_msg01, - flex_pretty_otp7431_msg01, - flex_pretty_otp7431_msg02, - flex_pretty_otp7431_msg03, - flex_pretty_otp7431_msg04, - flex_pretty_otp7431_msg05, - flex_pretty_otp7431_msg06, - flex_pretty_otp7431_msg07 - ]. +tickets() -> + Flag = process_flag(trap_exit, true), + Cases = expand(tickets), + Fun = fun(Case) -> + C = init_per_testcase(Case, [{tc_timeout, + timer:minutes(10)}]), + io:format("Eval ~w~n", [Case]), + Result = + case (catch apply(?MODULE, Case, [C])) of + {'EXIT', Reason} -> + io:format("~n~p exited:~n ~p~n", + [Case, Reason]), + {error, {Case, Reason}}; + Res -> + Res + end, + end_per_testcase(Case, C), + Result + end, + process_flag(trap_exit, Flag), + lists:map(Fun, Cases). %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/lib/megaco/test/megaco_codec_prev3b_test.erl b/lib/megaco/test/megaco_codec_prev3b_test.erl index b5fe4d2038..eaab8f37c1 100644 --- a/lib/megaco/test/megaco_codec_prev3b_test.erl +++ b/lib/megaco/test/megaco_codec_prev3b_test.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2005-2009. All Rights Reserved. +%% Copyright Ericsson AB 2005-2010. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -36,22 +36,16 @@ -export([t/0, t/1]). --export([all/1, - - text/1, - - pretty/1, +-export([all/0,groups/0,init_per_group/2,end_per_group/2, + pretty_test_msgs/1, - - compact/1, + compact_test_msgs/1, - flex_pretty/1, flex_pretty_init/1, flex_pretty_finish/1, flex_pretty_test_msgs/1, - - flex_compact/1, + flex_compact_init/1, flex_compact_finish/1, flex_compact_test_msgs/1, @@ -64,32 +58,21 @@ flex_compact_dm_timers6/1, flex_compact_dm_timers7/1, flex_compact_dm_timers8/1, - - binary/1, - bin/1, bin_test_msgs/1, - - ber/1, + ber_test_msgs/1, - - ber_bin/1, + ber_bin_test_msgs/1, - - per/1, + per_test_msgs/1, - - per_bin/1, + per_bin_test_msgs/1, - - erl_dist/1, - erl_dist_m/1, + erl_dist_m_test_msgs/1, tickets/0, - tickets/1, - - compact_tickets/1, + compact_otp4011_msg1/1, compact_otp4011_msg2/1, compact_otp4011_msg3/1, @@ -133,8 +116,7 @@ compact_otp6017_msg01/1, compact_otp6017_msg02/1, compact_otp6017_msg03/1, - - flex_compact_tickets/1, + flex_compact_otp7431_msg01/1, flex_compact_otp7431_msg02/1, flex_compact_otp7431_msg03/1, @@ -142,8 +124,7 @@ flex_compact_otp7431_msg05/1, flex_compact_otp7431_msg06/1, flex_compact_otp7431_msg07/1, - - pretty_tickets/1, + pretty_otp4632_msg1/1, pretty_otp4632_msg2/1, pretty_otp4632_msg3/1, @@ -190,8 +171,7 @@ pretty_otp7671_msg04/1, pretty_otp7671_msg05/1, pretty_otp8114_msg01/1, - - flex_pretty_tickets/1, + flex_pretty_otp5042_msg1/1, flex_pretty_otp5085_msg1/1, flex_pretty_otp5085_msg2/1, @@ -217,7 +197,7 @@ flex_pretty_otp7431_msg06/1, flex_pretty_otp7431_msg07/1, - init_per_testcase/2, fin_per_testcase/2]). + init_per_testcase/2, end_per_testcase/2]). -export([display_text_messages/0, generate_text_messages/0]). @@ -281,31 +261,6 @@ expand([Case|Cases], Acc) -> expand(Cases, [Case|Acc]) end. - -%% ---- - -tickets() -> - Flag = process_flag(trap_exit, true), - Cases = expand(tickets), - Fun = fun(Case) -> - C = init_per_testcase(Case, [{tc_timeout, - timer:minutes(10)}]), - io:format("Eval ~w~n", [Case]), - Result = - case (catch apply(?MODULE, Case, [C])) of - {'EXIT', Reason} -> - io:format("~n~p exited:~n ~p~n", - [Case, Reason]), - {error, {Case, Reason}}; - Res -> - Res - end, - fin_per_testcase(Case, C), - Result - end, - process_flag(trap_exit, Flag), - lists:map(Fun, Cases). - %% ---- @@ -324,276 +279,170 @@ init_per_testcase(Case, Config) -> end, megaco_test_lib:init_per_testcase(Case, C). -fin_per_testcase(Case, Config) -> +end_per_testcase(Case, Config) -> erase(verbosity), - megaco_test_lib:fin_per_testcase(Case, Config). + megaco_test_lib:end_per_testcase(Case, Config). %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %% Top test case -all(suite) -> - [ - text, - binary, - erl_dist, - tickets - ]. - -text(suite) -> - [ - pretty, - flex_pretty, - compact, - flex_compact - ]. - -binary(suite) -> - [ - bin, - ber, - ber_bin, - per, - per_bin - ]. - -erl_dist(suite) -> - [ - erl_dist_m - ]. - -pretty(suite) -> - [ - pretty_test_msgs - ]. - - -compact(suite) -> - [ - compact_test_msgs - ]. - - -flex_pretty(suite) -> - {req, [], - {conf, flex_pretty_init, flex_pretty_cases(), flex_pretty_finish}}. - -flex_pretty_cases() -> - [ - flex_pretty_test_msgs - ]. - -flex_compact(suite) -> - {req, [], - {conf, flex_compact_init, flex_compact_cases(), flex_compact_finish}}. - -flex_compact_cases() -> - [ - flex_compact_test_msgs, - flex_compact_dm_timers1, - flex_compact_dm_timers2, - flex_compact_dm_timers3, - flex_compact_dm_timers4, - flex_compact_dm_timers5, - flex_compact_dm_timers6, - flex_compact_dm_timers7, - flex_compact_dm_timers8 - ]. - - -bin(suite) -> - [ - bin_test_msgs - ]. - - -ber(suite) -> - [ - ber_test_msgs - ]. - - -ber_bin(suite) -> - [ - ber_bin_test_msgs - ]. - - -per(suite) -> - [ - per_test_msgs - ]. - +all() -> + [{group, text}, {group, binary}, {group, erl_dist}, + {group, tickets}]. + +groups() -> + [{text, [], + [{group, pretty}, {group, flex_pretty}, + {group, compact}, {group, flex_compact}]}, + {binary, [], + [{group, bin}, {group, ber}, {group, ber_bin}, + {group, per}, {group, per_bin}]}, + {erl_dist, [], [{group, erl_dist_m}]}, + {pretty, [], [pretty_test_msgs]}, + {compact, [], [compact_test_msgs]}, + {flex_pretty, [], flex_pretty_cases()}, + {flex_compact, [], flex_compact_cases()}, + {bin, [], [bin_test_msgs]}, {ber, [], [ber_test_msgs]}, + {ber_bin, [], [ber_bin_test_msgs]}, + {per, [], [per_test_msgs]}, + {per_bin, [], [per_bin_test_msgs]}, + {erl_dist_m, [], [erl_dist_m_test_msgs]}, + {tickets, [], + [{group, compact_tickets}, + {group, flex_compact_tickets}, {group, pretty_tickets}, + {group, flex_pretty_tickets}]}, + {compact_tickets, [], + [compact_otp4011_msg1, compact_otp4011_msg2, + compact_otp4011_msg3, compact_otp4013_msg1, + compact_otp4085_msg1, compact_otp4085_msg2, + compact_otp4280_msg1, compact_otp4299_msg1, + compact_otp4299_msg2, compact_otp4359_msg1, + compact_otp4920_msg0, compact_otp4920_msg1, + compact_otp4920_msg2, compact_otp4920_msg3, + compact_otp4920_msg4, compact_otp4920_msg5, + compact_otp4920_msg6, compact_otp4920_msg7, + compact_otp4920_msg8, compact_otp4920_msg9, + compact_otp4920_msg10, compact_otp4920_msg11, + compact_otp4920_msg12, compact_otp4920_msg20, + compact_otp4920_msg21, compact_otp4920_msg22, + compact_otp4920_msg23, compact_otp4920_msg24, + compact_otp4920_msg25, compact_otp5186_msg01, + compact_otp5186_msg02, compact_otp5186_msg03, + compact_otp5186_msg04, compact_otp5186_msg05, + compact_otp5186_msg06, compact_otp5793_msg01, + compact_otp5836_msg01, compact_otp5993_msg01, + compact_otp5993_msg02, compact_otp5993_msg03, + compact_otp6017_msg01, compact_otp6017_msg02, + compact_otp6017_msg03]}, + {flex_compact_tickets, [], + flex_compact_tickets_cases()}, + {pretty_tickets, [], + [pretty_otp4632_msg1, pretty_otp4632_msg2, + pretty_otp4632_msg3, pretty_otp4632_msg4, + pretty_otp4710_msg1, pretty_otp4710_msg2, + pretty_otp4945_msg1, pretty_otp4945_msg2, + pretty_otp4945_msg3, pretty_otp4945_msg4, + pretty_otp4945_msg5, pretty_otp4945_msg6, + pretty_otp4949_msg1, pretty_otp4949_msg2, + pretty_otp4949_msg3, pretty_otp5042_msg1, + pretty_otp5068_msg1, pretty_otp5085_msg1, + pretty_otp5085_msg2, pretty_otp5085_msg3, + pretty_otp5085_msg4, pretty_otp5085_msg5, + pretty_otp5085_msg6, pretty_otp5085_msg7, + pretty_otp5085_msg8, pretty_otp5600_msg1, + pretty_otp5600_msg2, pretty_otp5601_msg1, + pretty_otp5793_msg01, pretty_otp5803_msg01, + pretty_otp5803_msg02, pretty_otp5805_msg01, + pretty_otp5836_msg01, pretty_otp5882_msg01, + pretty_otp6490_msg01, pretty_otp6490_msg02, + pretty_otp6490_msg03, pretty_otp6490_msg04, + pretty_otp6490_msg05, pretty_otp6490_msg06, + pretty_otp7671_msg01, pretty_otp7671_msg02, + pretty_otp7671_msg03, pretty_otp7671_msg04, + pretty_otp7671_msg05, pretty_otp8114_msg01]}, + {flex_pretty_tickets, [], flex_pretty_tickets_cases()}]. + +init_per_group(flex_pretty_tickets, Config) -> + flex_pretty_init(Config); +init_per_group(flex_compact_tickets, Config) -> + flex_compact_init(Config); +init_per_group(flex_compact, Config) -> + flex_compact_init(Config); +init_per_group(flex_pretty, Config) -> + flex_pretty_init(Config); +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(flex_pretty_tickets, Config) -> + flex_pretty_finish(Config); +end_per_group(flex_compact_tickets, Config) -> + flex_compact_finish(Config); +end_per_group(flex_compact, Config) -> + flex_compact_finish(Config); +end_per_group(flex_pretty, Config) -> + flex_pretty_finish(Config); +end_per_group(_GroupName, Config) -> + Config. + +flex_pretty_cases() -> + [flex_pretty_test_msgs]. + +flex_compact_cases() -> + [flex_compact_test_msgs, flex_compact_dm_timers1, + flex_compact_dm_timers2, flex_compact_dm_timers3, + flex_compact_dm_timers4, flex_compact_dm_timers5, + flex_compact_dm_timers6, flex_compact_dm_timers7, + flex_compact_dm_timers8]. %% Support for per_bin was added to ASN.1 as of version %% 1.3.2 (R8). And later merged into 1.3.1.3 (R7). These %% releases are identical (as far as I know). %% -per_bin(suite) -> - [ - per_bin_test_msgs - ]. - - -erl_dist_m(suite) -> - [ - erl_dist_m_test_msgs - ]. - -tickets(suite) -> - [ - compact_tickets, - flex_compact_tickets, - pretty_tickets, - flex_pretty_tickets - ]. +flex_compact_tickets_cases() -> + [flex_compact_otp7431_msg01, flex_compact_otp7431_msg02, + flex_compact_otp7431_msg03, flex_compact_otp7431_msg04, + flex_compact_otp7431_msg05, flex_compact_otp7431_msg06, + flex_compact_otp7431_msg07]. + +flex_pretty_tickets_cases() -> + [flex_pretty_otp5042_msg1, flex_pretty_otp5085_msg1, + flex_pretty_otp5085_msg2, flex_pretty_otp5085_msg3, + flex_pretty_otp5085_msg4, flex_pretty_otp5085_msg5, + flex_pretty_otp5085_msg6, flex_pretty_otp5085_msg7, + flex_pretty_otp5085_msg8, flex_pretty_otp5600_msg1, + flex_pretty_otp5600_msg2, flex_pretty_otp5601_msg1, + flex_pretty_otp5793_msg01, flex_pretty_otp5803_msg01, + flex_pretty_otp5803_msg02, flex_pretty_otp5805_msg01, + flex_pretty_otp5836_msg01, flex_pretty_otp7431_msg01, + flex_pretty_otp7431_msg02, flex_pretty_otp7431_msg03, + flex_pretty_otp7431_msg04, flex_pretty_otp7431_msg05, + flex_pretty_otp7431_msg06, flex_pretty_otp7431_msg07]. -compact_tickets(suite) -> - [ - compact_otp4011_msg1, - compact_otp4011_msg2, - compact_otp4011_msg3, - compact_otp4013_msg1, - compact_otp4085_msg1, - compact_otp4085_msg2, - compact_otp4280_msg1, - compact_otp4299_msg1, - compact_otp4299_msg2, - compact_otp4359_msg1, - compact_otp4920_msg0, - compact_otp4920_msg1, - compact_otp4920_msg2, - compact_otp4920_msg3, - compact_otp4920_msg4, - compact_otp4920_msg5, - compact_otp4920_msg6, - compact_otp4920_msg7, - compact_otp4920_msg8, - compact_otp4920_msg9, - compact_otp4920_msg10, - compact_otp4920_msg11, - compact_otp4920_msg12, - compact_otp4920_msg20, - compact_otp4920_msg21, - compact_otp4920_msg22, - compact_otp4920_msg23, - compact_otp4920_msg24, - compact_otp4920_msg25, - compact_otp5186_msg01, - compact_otp5186_msg02, - compact_otp5186_msg03, - compact_otp5186_msg04, - compact_otp5186_msg05, - compact_otp5186_msg06, - compact_otp5793_msg01, - compact_otp5836_msg01, - compact_otp5993_msg01, - compact_otp5993_msg02, - compact_otp5993_msg03, - compact_otp6017_msg01, - compact_otp6017_msg02, - compact_otp6017_msg03 - ]. - -flex_compact_tickets(suite) -> - {req, [], - {conf, flex_compact_init, flex_compact_tickets_cases(), - flex_compact_finish}}. - -flex_compact_tickets_cases() -> - [ - flex_compact_otp7431_msg01, - flex_compact_otp7431_msg02, - flex_compact_otp7431_msg03, - flex_compact_otp7431_msg04, - flex_compact_otp7431_msg05, - flex_compact_otp7431_msg06, - flex_compact_otp7431_msg07 - ]. - -pretty_tickets(suite) -> - [ - pretty_otp4632_msg1, - pretty_otp4632_msg2, - pretty_otp4632_msg3, - pretty_otp4632_msg4, - pretty_otp4710_msg1, - pretty_otp4710_msg2, - pretty_otp4945_msg1, - pretty_otp4945_msg2, - pretty_otp4945_msg3, - pretty_otp4945_msg4, - pretty_otp4945_msg5, - pretty_otp4945_msg6, - pretty_otp4949_msg1, - pretty_otp4949_msg2, - pretty_otp4949_msg3, - pretty_otp5042_msg1, - pretty_otp5068_msg1, - pretty_otp5085_msg1, - pretty_otp5085_msg2, - pretty_otp5085_msg3, - pretty_otp5085_msg4, - pretty_otp5085_msg5, - pretty_otp5085_msg6, - pretty_otp5085_msg7, - pretty_otp5085_msg8, - pretty_otp5600_msg1, - pretty_otp5600_msg2, - pretty_otp5601_msg1, - pretty_otp5793_msg01, - pretty_otp5803_msg01, - pretty_otp5803_msg02, - pretty_otp5805_msg01, - pretty_otp5836_msg01, - pretty_otp5882_msg01, - pretty_otp6490_msg01, - pretty_otp6490_msg02, - pretty_otp6490_msg03, - pretty_otp6490_msg04, - pretty_otp6490_msg05, - pretty_otp6490_msg06, - pretty_otp7671_msg01, - pretty_otp7671_msg02, - pretty_otp7671_msg03, - pretty_otp7671_msg04, - pretty_otp7671_msg05, - pretty_otp8114_msg01 - ]. +%% ---- -flex_pretty_tickets(suite) -> - {req, [], - {conf, flex_pretty_init, flex_pretty_tickets_cases(), - flex_pretty_finish}}. - -flex_pretty_tickets_cases() -> - [ - flex_pretty_otp5042_msg1, - flex_pretty_otp5085_msg1, - flex_pretty_otp5085_msg2, - flex_pretty_otp5085_msg3, - flex_pretty_otp5085_msg4, - flex_pretty_otp5085_msg5, - flex_pretty_otp5085_msg6, - flex_pretty_otp5085_msg7, - flex_pretty_otp5085_msg8, - flex_pretty_otp5600_msg1, - flex_pretty_otp5600_msg2, - flex_pretty_otp5601_msg1, - flex_pretty_otp5793_msg01, - flex_pretty_otp5803_msg01, - flex_pretty_otp5803_msg02, - flex_pretty_otp5805_msg01, - flex_pretty_otp5836_msg01, - flex_pretty_otp7431_msg01, - flex_pretty_otp7431_msg02, - flex_pretty_otp7431_msg03, - flex_pretty_otp7431_msg04, - flex_pretty_otp7431_msg05, - flex_pretty_otp7431_msg06, - flex_pretty_otp7431_msg07 - ]. +tickets() -> + Flag = process_flag(trap_exit, true), + Cases = expand(tickets), + Fun = fun(Case) -> + C = init_per_testcase(Case, [{tc_timeout, + timer:minutes(10)}]), + io:format("Eval ~w~n", [Case]), + Result = + case (catch apply(?MODULE, Case, [C])) of + {'EXIT', Reason} -> + io:format("~n~p exited:~n ~p~n", + [Case, Reason]), + {error, {Case, Reason}}; + Res -> + Res + end, + end_per_testcase(Case, C), + Result + end, + process_flag(trap_exit, Flag), + lists:map(Fun, Cases). %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/lib/megaco/test/megaco_codec_prev3c_test.erl b/lib/megaco/test/megaco_codec_prev3c_test.erl index 813d0cf57d..7f9c0fe4e7 100644 --- a/lib/megaco/test/megaco_codec_prev3c_test.erl +++ b/lib/megaco/test/megaco_codec_prev3c_test.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2006-2009. All Rights Reserved. +%% Copyright Ericsson AB 2006-2010. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -37,22 +37,17 @@ -export([t/0, t/1]). --export([all/1, - - text/1, - - pretty/1, +-export([all/0,groups/0,init_per_group/2,end_per_group/2, + pretty_test_msgs/1, - - compact/1, + compact_test_msgs/1, - - flex_pretty/1, + flex_pretty_init/1, flex_pretty_finish/1, flex_pretty_test_msgs/1, - flex_compact/1, + flex_compact_init/1, flex_compact_finish/1, flex_compact_test_msgs/1, @@ -65,32 +60,21 @@ flex_compact_dm_timers6/1, flex_compact_dm_timers7/1, flex_compact_dm_timers8/1, - - binary/1, - bin/1, bin_test_msgs/1, - - ber/1, + ber_test_msgs/1, - - ber_bin/1, + ber_bin_test_msgs/1, - - per/1, + per_test_msgs/1, - - per_bin/1, + per_bin_test_msgs/1, - - erl_dist/1, - erl_dist_m/1, + erl_dist_m_test_msgs/1, tickets/0, - tickets/1, - - compact_tickets/1, + compact_otp4011_msg1/1, compact_otp4011_msg2/1, compact_otp4011_msg3/1, @@ -133,8 +117,7 @@ compact_otp6017_msg01/1, compact_otp6017_msg02/1, compact_otp6017_msg03/1, - - flex_compact_tickets/1, + flex_compact_otp4299_msg1/1, flex_compact_otp7431_msg01/1, flex_compact_otp7431_msg02/1, @@ -143,8 +126,7 @@ flex_compact_otp7431_msg05/1, flex_compact_otp7431_msg06/1, flex_compact_otp7431_msg07/1, - - pretty_tickets/1, + pretty_otp4632_msg1/1, pretty_otp4632_msg2/1, pretty_otp4632_msg3/1, @@ -191,8 +173,7 @@ pretty_otp7671_msg04/1, pretty_otp7671_msg05/1, pretty_otp8114_msg01/1, - - flex_pretty_tickets/1, + flex_pretty_otp5042_msg1/1, flex_pretty_otp5085_msg1/1, flex_pretty_otp5085_msg2/1, @@ -218,7 +199,7 @@ flex_pretty_otp7431_msg06/1, flex_pretty_otp7431_msg07/1, - init_per_testcase/2, fin_per_testcase/2]). + init_per_testcase/2, end_per_testcase/2]). -export([display_text_messages/0, generate_text_messages/0]). @@ -286,32 +267,6 @@ expand([Case|Cases], Acc) -> expand(Cases, [Case|Acc]) end. - -%% ---- - -tickets() -> - Flag = process_flag(trap_exit, true), - Cases = expand(tickets), - Fun = fun(Case) -> - C = init_per_testcase(Case, [{tc_timeout, - timer:minutes(10)}]), - io:format("Eval ~w~n", [Case]), - Result = - case (catch apply(?MODULE, Case, [C])) of - {'EXIT', Reason} -> - io:format("~n~p exited:~n ~p~n", - [Case, Reason]), - {error, {Case, Reason}}; - Res -> - Res - end, - fin_per_testcase(Case, C), - Result - end, - process_flag(trap_exit, Flag), - lists:map(Fun, Cases). - - %% ---- t() -> megaco_test_lib:t(?MODULE). @@ -329,279 +284,169 @@ init_per_testcase(Case, Config) -> end, megaco_test_lib:init_per_testcase(Case, C). -fin_per_testcase(Case, Config) -> +end_per_testcase(Case, Config) -> erase(verbosity), - megaco_test_lib:fin_per_testcase(Case, Config). + megaco_test_lib:end_per_testcase(Case, Config). %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %% Top test case -all(suite) -> - [ - text, - binary, - erl_dist, - tickets - ]. - -text(suite) -> - [ - pretty, - flex_pretty, - compact, - flex_compact - ]. - -binary(suite) -> - [ - bin, - ber, - ber_bin, - per, - per_bin - ]. - -erl_dist(suite) -> - [ - erl_dist_m - ]. - -pretty(suite) -> - [ - pretty_test_msgs - ]. - - -compact(suite) -> - [ - compact_test_msgs - ]. - - -flex_pretty(suite) -> - {req, [], - {conf, flex_pretty_init, flex_pretty_cases(), flex_pretty_finish}}. - -flex_pretty_cases() -> - [ - flex_pretty_test_msgs - ]. - -flex_compact(suite) -> - {req, [], - {conf, flex_compact_init, flex_compact_cases(), flex_compact_finish}}. - -flex_compact_cases() -> - [ - flex_compact_test_msgs, - flex_compact_dm_timers1, - flex_compact_dm_timers2, - flex_compact_dm_timers3, - flex_compact_dm_timers4, - flex_compact_dm_timers5, - flex_compact_dm_timers6, - flex_compact_dm_timers7, - flex_compact_dm_timers8 - ]. - - -bin(suite) -> - [ - bin_test_msgs - ]. - - -ber(suite) -> - [ - ber_test_msgs - ]. - - -ber_bin(suite) -> - [ - ber_bin_test_msgs - ]. - - -per(suite) -> - [ - per_test_msgs - ]. - +all() -> + [{group, text}, {group, binary}, {group, erl_dist}, + {group, tickets}]. + +groups() -> + [{text, [], + [{group, pretty}, {group, flex_pretty}, + {group, compact}, {group, flex_compact}]}, + {binary, [], + [{group, bin}, {group, ber}, {group, ber_bin}, + {group, per}, {group, per_bin}]}, + {erl_dist, [], [{group, erl_dist_m}]}, + {pretty, [], [pretty_test_msgs]}, + {compact, [], [compact_test_msgs]}, + {flex_pretty, [], flex_pretty_cases()}, + {flex_compact, [], flex_compact_cases()}, + {bin, [], [bin_test_msgs]}, {ber, [], [ber_test_msgs]}, + {ber_bin, [], [ber_bin_test_msgs]}, + {per, [], [per_test_msgs]}, + {per_bin, [], [per_bin_test_msgs]}, + {erl_dist_m, [], [erl_dist_m_test_msgs]}, + {tickets, [], + [{group, compact_tickets}, + {group, flex_compact_tickets}, {group, pretty_tickets}, + {group, flex_pretty_tickets}]}, + {compact_tickets, [], + [compact_otp4011_msg1, compact_otp4011_msg2, + compact_otp4011_msg3, compact_otp4013_msg1, + compact_otp4085_msg1, compact_otp4085_msg2, + compact_otp4280_msg1, compact_otp4299_msg1, + compact_otp4359_msg1, compact_otp4920_msg0, + compact_otp4920_msg1, compact_otp4920_msg2, + compact_otp4920_msg3, compact_otp4920_msg4, + compact_otp4920_msg5, compact_otp4920_msg6, + compact_otp4920_msg7, compact_otp4920_msg8, + compact_otp4920_msg9, compact_otp4920_msg10, + compact_otp4920_msg11, compact_otp4920_msg12, + compact_otp4920_msg20, compact_otp4920_msg21, + compact_otp4920_msg22, compact_otp4920_msg23, + compact_otp4920_msg24, compact_otp4920_msg25, + compact_otp5186_msg01, compact_otp5186_msg02, + compact_otp5186_msg03, compact_otp5186_msg04, + compact_otp5186_msg05, compact_otp5186_msg06, + compact_otp5793_msg01, compact_otp5836_msg01, + compact_otp5993_msg01, compact_otp5993_msg02, + compact_otp5993_msg03, compact_otp6017_msg01, + compact_otp6017_msg02, compact_otp6017_msg03]}, + {flex_compact_tickets, [], + flex_compact_tickets_cases()}, + {pretty_tickets, [], + [pretty_otp4632_msg1, pretty_otp4632_msg2, + pretty_otp4632_msg3, pretty_otp4632_msg4, + pretty_otp4710_msg1, pretty_otp4710_msg2, + pretty_otp4945_msg1, pretty_otp4945_msg2, + pretty_otp4945_msg3, pretty_otp4945_msg4, + pretty_otp4945_msg5, pretty_otp4945_msg6, + pretty_otp4949_msg1, pretty_otp4949_msg2, + pretty_otp4949_msg3, pretty_otp5042_msg1, + pretty_otp5068_msg1, pretty_otp5085_msg1, + pretty_otp5085_msg2, pretty_otp5085_msg3, + pretty_otp5085_msg4, pretty_otp5085_msg5, + pretty_otp5085_msg6, pretty_otp5085_msg7, + pretty_otp5085_msg8, pretty_otp5600_msg1, + pretty_otp5600_msg2, pretty_otp5601_msg1, + pretty_otp5793_msg01, pretty_otp5803_msg01, + pretty_otp5803_msg02, pretty_otp5805_msg01, + pretty_otp5836_msg01, pretty_otp5882_msg01, + pretty_otp6490_msg01, pretty_otp6490_msg02, + pretty_otp6490_msg03, pretty_otp6490_msg04, + pretty_otp6490_msg05, pretty_otp6490_msg06, + pretty_otp7671_msg01, pretty_otp7671_msg02, + pretty_otp7671_msg03, pretty_otp7671_msg04, + pretty_otp7671_msg05, pretty_otp8114_msg01]}, + {flex_pretty_tickets, [], flex_pretty_tickets_cases()}]. + +init_per_group(flex_pretty_tickets, Config) -> + flex_pretty_init(Config); +init_per_group(flex_compact_tickets, Config) -> + flex_compact_init(Config); +init_per_group(flex_compact, Config) -> + flex_compact_init(Config); +init_per_group(flex_pretty, Config) -> + flex_pretty_init(Config); +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(flex_pretty_tickets, Config) -> + flex_pretty_finish(Config); +end_per_group(flex_compact_tickets, Config) -> + flex_compact_finish(Config); +end_per_group(flex_compact, Config) -> + flex_compact_finish(Config); +end_per_group(flex_pretty, Config) -> + flex_pretty_finish(Config); +end_per_group(_GroupName, Config) -> + Config. + +flex_pretty_cases() -> + [flex_pretty_test_msgs]. + +flex_compact_cases() -> + [flex_compact_test_msgs, flex_compact_dm_timers1, + flex_compact_dm_timers2, flex_compact_dm_timers3, + flex_compact_dm_timers4, flex_compact_dm_timers5, + flex_compact_dm_timers6, flex_compact_dm_timers7, + flex_compact_dm_timers8]. %% Support for per_bin was added to ASN.1 as of version %% 1.3.2 (R8). And later merged into 1.3.1.3 (R7). These %% releases are identical (as far as I know). %% -per_bin(suite) -> - [ - per_bin_test_msgs - ]. - - -erl_dist_m(suite) -> - [ - erl_dist_m_test_msgs - ]. - -tickets(suite) -> - [ - compact_tickets, - flex_compact_tickets, - pretty_tickets, - flex_pretty_tickets - ]. - - -compact_tickets(suite) -> - [ - compact_otp4011_msg1, - compact_otp4011_msg2, - compact_otp4011_msg3, - compact_otp4013_msg1, - compact_otp4085_msg1, - compact_otp4085_msg2, - compact_otp4280_msg1, - compact_otp4299_msg1, - compact_otp4359_msg1, - compact_otp4920_msg0, - compact_otp4920_msg1, - compact_otp4920_msg2, - compact_otp4920_msg3, - compact_otp4920_msg4, - compact_otp4920_msg5, - compact_otp4920_msg6, - compact_otp4920_msg7, - compact_otp4920_msg8, - compact_otp4920_msg9, - compact_otp4920_msg10, - compact_otp4920_msg11, - compact_otp4920_msg12, - compact_otp4920_msg20, - compact_otp4920_msg21, - compact_otp4920_msg22, - compact_otp4920_msg23, - compact_otp4920_msg24, - compact_otp4920_msg25, - compact_otp5186_msg01, - compact_otp5186_msg02, - compact_otp5186_msg03, - compact_otp5186_msg04, - compact_otp5186_msg05, - compact_otp5186_msg06, - compact_otp5793_msg01, - compact_otp5836_msg01, - compact_otp5993_msg01, - compact_otp5993_msg02, - compact_otp5993_msg03, - compact_otp6017_msg01, - compact_otp6017_msg02, - compact_otp6017_msg03 - ]. - - -flex_compact_tickets(suite) -> - {req, [], - {conf, flex_compact_init, flex_compact_tickets_cases(), - flex_compact_finish}}. -flex_compact_tickets_cases() -> - [ - flex_compact_otp4299_msg1, - flex_compact_otp7431_msg01, - flex_compact_otp7431_msg02, - flex_compact_otp7431_msg03, - flex_compact_otp7431_msg04, - flex_compact_otp7431_msg05, - flex_compact_otp7431_msg06, - flex_compact_otp7431_msg07 - ]. - - -pretty_tickets(suite) -> - [ - pretty_otp4632_msg1, - pretty_otp4632_msg2, - pretty_otp4632_msg3, - pretty_otp4632_msg4, - pretty_otp4710_msg1, - pretty_otp4710_msg2, - pretty_otp4945_msg1, - pretty_otp4945_msg2, - pretty_otp4945_msg3, - pretty_otp4945_msg4, - pretty_otp4945_msg5, - pretty_otp4945_msg6, - pretty_otp4949_msg1, - pretty_otp4949_msg2, - pretty_otp4949_msg3, - pretty_otp5042_msg1, - pretty_otp5068_msg1, - pretty_otp5085_msg1, - pretty_otp5085_msg2, - pretty_otp5085_msg3, - pretty_otp5085_msg4, - pretty_otp5085_msg5, - pretty_otp5085_msg6, - pretty_otp5085_msg7, - pretty_otp5085_msg8, - pretty_otp5600_msg1, - pretty_otp5600_msg2, - pretty_otp5601_msg1, - pretty_otp5793_msg01, - pretty_otp5803_msg01, - pretty_otp5803_msg02, - pretty_otp5805_msg01, - pretty_otp5836_msg01, - pretty_otp5882_msg01, - pretty_otp6490_msg01, - pretty_otp6490_msg02, - pretty_otp6490_msg03, - pretty_otp6490_msg04, - pretty_otp6490_msg05, - pretty_otp6490_msg06, - pretty_otp7671_msg01, - pretty_otp7671_msg02, - pretty_otp7671_msg03, - pretty_otp7671_msg04, - pretty_otp7671_msg05, - pretty_otp8114_msg01 - ]. +flex_compact_tickets_cases() -> + [flex_compact_otp4299_msg1, flex_compact_otp7431_msg01, + flex_compact_otp7431_msg02, flex_compact_otp7431_msg03, + flex_compact_otp7431_msg04, flex_compact_otp7431_msg05, + flex_compact_otp7431_msg06, flex_compact_otp7431_msg07]. + +flex_pretty_tickets_cases() -> + [flex_pretty_otp5042_msg1, flex_pretty_otp5085_msg1, + flex_pretty_otp5085_msg2, flex_pretty_otp5085_msg3, + flex_pretty_otp5085_msg4, flex_pretty_otp5085_msg5, + flex_pretty_otp5085_msg6, flex_pretty_otp5085_msg7, + flex_pretty_otp5085_msg8, flex_pretty_otp5600_msg1, + flex_pretty_otp5600_msg2, flex_pretty_otp5601_msg1, + flex_pretty_otp5793_msg01, flex_pretty_otp5803_msg01, + flex_pretty_otp5803_msg02, flex_pretty_otp5805_msg01, + flex_pretty_otp5836_msg01, flex_pretty_otp7431_msg01, + flex_pretty_otp7431_msg02, flex_pretty_otp7431_msg03, + flex_pretty_otp7431_msg04, flex_pretty_otp7431_msg05, + flex_pretty_otp7431_msg06, flex_pretty_otp7431_msg07]. +%% ---- -flex_pretty_tickets(suite) -> - {req, [], - {conf, flex_pretty_init, flex_pretty_tickets_cases(), - flex_pretty_finish}}. - -flex_pretty_tickets_cases() -> - [ - flex_pretty_otp5042_msg1, - flex_pretty_otp5085_msg1, - flex_pretty_otp5085_msg2, - flex_pretty_otp5085_msg3, - flex_pretty_otp5085_msg4, - flex_pretty_otp5085_msg5, - flex_pretty_otp5085_msg6, - flex_pretty_otp5085_msg7, - flex_pretty_otp5085_msg8, - flex_pretty_otp5600_msg1, - flex_pretty_otp5600_msg2, - flex_pretty_otp5601_msg1, - flex_pretty_otp5793_msg01, - flex_pretty_otp5803_msg01, - flex_pretty_otp5803_msg02, - flex_pretty_otp5805_msg01, - flex_pretty_otp5836_msg01, - flex_pretty_otp7431_msg01, - flex_pretty_otp7431_msg02, - flex_pretty_otp7431_msg03, - flex_pretty_otp7431_msg04, - flex_pretty_otp7431_msg05, - flex_pretty_otp7431_msg06, - flex_pretty_otp7431_msg07 - ]. +tickets() -> + Flag = process_flag(trap_exit, true), + Cases = expand(tickets), + Fun = fun(Case) -> + C = init_per_testcase(Case, [{tc_timeout, + timer:minutes(10)}]), + io:format("Eval ~w~n", [Case]), + Result = + case (catch apply(?MODULE, Case, [C])) of + {'EXIT', Reason} -> + io:format("~n~p exited:~n ~p~n", + [Case, Reason]), + {error, {Case, Reason}}; + Res -> + Res + end, + end_per_testcase(Case, C), + Result + end, + process_flag(trap_exit, Flag), + lists:map(Fun, Cases). %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/lib/megaco/test/megaco_codec_test.erl b/lib/megaco/test/megaco_codec_test.erl index d247959cc5..8391024c3f 100644 --- a/lib/megaco/test/megaco_codec_test.erl +++ b/lib/megaco/test/megaco_codec_test.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2003-2009. All Rights Reserved. +%% Copyright Ericsson AB 2003-2010. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -36,8 +36,8 @@ t(Case) -> megaco_test_lib:t({?MODULE, Case}). init_per_testcase(Case, Config) -> megaco_test_lib:init_per_testcase(Case, Config). -fin_per_testcase(Case, Config) -> - megaco_test_lib:fin_per_testcase(Case, Config). +end_per_testcase(Case, Config) -> + megaco_test_lib:end_per_testcase(Case, Config). init() -> process_flag(trap_exit, true), @@ -47,17 +47,24 @@ init() -> %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %% Top test case -all(suite) -> - [ - codec - ]. - -codec(suite) -> - [{megaco_codec_mini_test, all}, - {megaco_codec_v1_test, all}, - {megaco_codec_v2_test, all}, - {megaco_codec_prev3a_test, all}, - {megaco_codec_prev3b_test, all}, - {megaco_codec_prev3c_test, all}, - {megaco_codec_v3_test, all}]. +all() -> + [{group, codec}]. + +groups() -> + [{codec, [], + [{megaco_codec_mini_test, all}, + {megaco_codec_v1_test, all}, + {megaco_codec_v2_test, all}, + {megaco_codec_prev3a_test, all}, + {megaco_codec_prev3b_test, all}, + {megaco_codec_prev3c_test, all}, + {megaco_codec_v3_test, all}]}]. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + + diff --git a/lib/megaco/test/megaco_codec_test_lib.erl b/lib/megaco/test/megaco_codec_test_lib.erl index 66e8a52a24..0a903f5617 100644 --- a/lib/megaco/test/megaco_codec_test_lib.erl +++ b/lib/megaco/test/megaco_codec_test_lib.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2004-2009. All Rights Reserved. +%% Copyright Ericsson AB 2004-2010. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in diff --git a/lib/megaco/test/megaco_codec_v1_test.erl b/lib/megaco/test/megaco_codec_v1_test.erl index 7f2af37282..3a548c4d9e 100644 --- a/lib/megaco/test/megaco_codec_v1_test.erl +++ b/lib/megaco/test/megaco_codec_v1_test.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2003-2009. All Rights Reserved. +%% Copyright Ericsson AB 2003-2011. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -26,6 +26,10 @@ %% ---- +-compile({no_auto_import,[error/1]}). + +%% ---- + -include_lib("megaco/include/megaco.hrl"). -include_lib("megaco/include/megaco_message_v1.hrl"). -include("megaco_test_lib.hrl"). @@ -38,22 +42,16 @@ -export([t/0, t/1]). --export([all/1, - - text/1, - - pretty/1, +-export([all/0,groups/0,init_per_group/2,end_per_group/2, + pretty_test_msgs/1, - - compact/1, + compact_test_msgs/1, - - flex_pretty/1, + flex_pretty_init/1, flex_pretty_finish/1, flex_pretty_test_msgs/1, - - flex_compact/1, + flex_compact_init/1, flex_compact_finish/1, flex_compact_test_msgs/1, @@ -63,32 +61,21 @@ flex_compact_dm_timers4/1, flex_compact_dm_timers5/1, flex_compact_dm_timers6/1, - - binary/1, - bin/1, bin_test_msgs/1, - - ber/1, + ber_test_msgs/1, - - ber_bin/1, + ber_bin_test_msgs/1, - - per/1, + per_test_msgs/1, - - per_bin/1, + per_bin_test_msgs/1, - - erl_dist/1, - erl_dist_m/1, + erl_dist_m_test_msgs/1, tickets/0, - tickets/1, - - compact_tickets/1, + compact_otp4011_msg1/1, compact_otp4011_msg2/1, compact_otp4011_msg3/1, @@ -131,8 +118,7 @@ compact_otp6017_msg01/1, compact_otp6017_msg02/1, compact_otp6017_msg03/1, - - flex_compact_tickets/1, + flex_compact_otp7431_msg01a/1, flex_compact_otp7431_msg01b/1, flex_compact_otp7431_msg02/1, @@ -141,8 +127,7 @@ flex_compact_otp7431_msg05/1, flex_compact_otp7431_msg06/1, flex_compact_otp7431_msg07/1, - - pretty_tickets/1, + pretty_otp4632_msg1/1, pretty_otp4632_msg2/1, pretty_otp4632_msg3/1, @@ -184,7 +169,6 @@ pretty_otp7671_msg04/1, pretty_otp7671_msg05/1, - flex_pretty_tickets/1, flex_pretty_otp5042_msg1/1, flex_pretty_otp5085_msg1/1, flex_pretty_otp5085_msg2/1, @@ -205,7 +189,7 @@ flex_pretty_otp7431_msg06/1, flex_pretty_otp7431_msg07/1, - init_per_testcase/2, fin_per_testcase/2]). + init_per_testcase/2, end_per_testcase/2]). -export([display_text_messages/0, generate_text_messages/0]). @@ -451,31 +435,6 @@ expand([Case|Cases], Acc) -> expand(Cases, [Case|Acc]) end. - -%% ---- - -tickets() -> - Flag = process_flag(trap_exit, true), - Cases = expand(tickets), - Fun = fun(Case) -> - C = init_per_testcase(Case, [{tc_timeout, - timer:minutes(10)}]), - io:format("Eval ~w~n", [Case]), - Result = - case (catch apply(?MODULE, Case, [C])) of - {'EXIT', Reason} -> - io:format("~n~p exited:~n ~p~n", - [Case, Reason]), - {error, {Case, Reason}}; - Res -> - Res - end, - fin_per_testcase(Case, C), - Result - end, - process_flag(trap_exit, Flag), - lists:map(Fun, Cases). - %% ---- @@ -494,265 +453,210 @@ init_per_testcase(Case, Config) -> end, megaco_test_lib:init_per_testcase(Case, C). -fin_per_testcase(Case, Config) -> +end_per_testcase(Case, Config) -> erase(verbosity), - megaco_test_lib:fin_per_testcase(Case, Config). + megaco_test_lib:end_per_testcase(Case, Config). %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %% Top test case -all(suite) -> - [ - text, - binary, - erl_dist, - tickets - ]. - -text(suite) -> - [ - pretty, - flex_pretty, - compact, - flex_compact - ]. - -binary(suite) -> - [ - bin, - ber, - ber_bin, - per, - per_bin - ]. - -erl_dist(suite) -> - [ - erl_dist_m - ]. - -pretty(suite) -> - [ - pretty_test_msgs - ]. - - -compact(suite) -> - [ - compact_test_msgs - ]. - - -flex_pretty(suite) -> - {req, [], - {conf, flex_pretty_init, flex_pretty_cases(), flex_pretty_finish}}. - -flex_pretty_cases() -> - [ - flex_pretty_test_msgs - ]. - - -flex_compact(suite) -> - {req, [], - {conf, flex_compact_init, flex_compact_cases(), flex_compact_finish}}. - -flex_compact_cases() -> - [ - flex_compact_test_msgs, - - flex_compact_dm_timers1, - flex_compact_dm_timers2, - flex_compact_dm_timers3, - flex_compact_dm_timers4, - flex_compact_dm_timers5, - flex_compact_dm_timers6 - ]. - - -bin(suite) -> - [ - bin_test_msgs - ]. - - -ber(suite) -> +all() -> [ - ber_test_msgs - ]. - - -ber_bin(suite) -> - [ - ber_bin_test_msgs - ]. - - -per(suite) -> - [ - per_test_msgs + {group, text}, + {group, binary}, + {group, erl_dist}, + {group, tickets} ]. +groups() -> + [{text, [], [{group, pretty}, + {group, flex_pretty}, + {group, compact}, + {group, flex_compact}]}, + {binary, [], [{group, bin}, + {group, ber}, + {group, ber_bin}, + {group, per}, + {group, per_bin}]}, + {erl_dist, [], [{group, erl_dist_m}]}, + {pretty, [], [pretty_test_msgs]}, + {compact, [], [compact_test_msgs]}, + {flex_pretty, [], flex_pretty_cases()}, + {flex_compact, [], flex_compact_cases()}, + {bin, [], [bin_test_msgs]}, + {ber, [], [ber_test_msgs]}, + {ber_bin, [], [ber_bin_test_msgs]}, + {per, [], [per_test_msgs]}, + {per_bin, [], [per_bin_test_msgs]}, + {erl_dist_m, [], [erl_dist_m_test_msgs]}, + {tickets, [], [{group, compact_tickets}, + {group, pretty_tickets}, + {group, flex_compact_tickets}, + {group, flex_pretty_tickets}]}, + {compact_tickets, [], [compact_otp4011_msg1, + compact_otp4011_msg2, + compact_otp4011_msg3, + compact_otp4013_msg1, + compact_otp4085_msg1, + compact_otp4085_msg2, + compact_otp4280_msg1, + compact_otp4299_msg1, + compact_otp4299_msg2, + compact_otp4359_msg1, + compact_otp4920_msg0, + compact_otp4920_msg1, + compact_otp4920_msg2, + compact_otp4920_msg3, + compact_otp4920_msg4, + compact_otp4920_msg5, + compact_otp4920_msg6, + compact_otp4920_msg7, + compact_otp4920_msg8, + compact_otp4920_msg9, + compact_otp4920_msg10, + compact_otp4920_msg11, + compact_otp4920_msg12, + compact_otp4920_msg20, + compact_otp4920_msg21, + compact_otp4920_msg22, + compact_otp4920_msg23, + compact_otp4920_msg24, + compact_otp4920_msg25, + compact_otp5186_msg01, + compact_otp5186_msg02, + compact_otp5186_msg03, + compact_otp5186_msg04, + compact_otp5186_msg05, + compact_otp5186_msg06, + compact_otp5793_msg01, + compact_otp5993_msg01, + compact_otp5993_msg02, + compact_otp5993_msg03, + compact_otp6017_msg01, + compact_otp6017_msg02, + compact_otp6017_msg03]}, + {flex_compact_tickets, [], flex_compact_tickets_cases()}, + {pretty_tickets, [], [pretty_otp4632_msg1, + pretty_otp4632_msg2, + pretty_otp4632_msg3, + pretty_otp4632_msg4, + pretty_otp4710_msg1, + pretty_otp4710_msg2, + pretty_otp4945_msg1, + pretty_otp4945_msg2, + pretty_otp4945_msg3, + pretty_otp4945_msg4, + pretty_otp4945_msg5, + pretty_otp4945_msg6, + pretty_otp4949_msg1, + pretty_otp4949_msg2, + pretty_otp4949_msg3, + pretty_otp5042_msg1, + pretty_otp5068_msg1, + pretty_otp5085_msg1, + pretty_otp5085_msg2, + pretty_otp5085_msg3, + pretty_otp5085_msg4, + pretty_otp5085_msg5, + pretty_otp5085_msg6, + pretty_otp5085_msg7, + pretty_otp5600_msg1, + pretty_otp5600_msg2, + pretty_otp5601_msg1, + pretty_otp5793_msg01, + pretty_otp5882_msg01, + pretty_otp6490_msg01, + pretty_otp6490_msg02, + pretty_otp6490_msg03, + pretty_otp6490_msg04, + pretty_otp6490_msg05, + pretty_otp6490_msg06, + pretty_otp7671_msg01, + pretty_otp7671_msg02, + pretty_otp7671_msg03, + pretty_otp7671_msg04, + pretty_otp7671_msg05]}, + {flex_pretty_tickets, [], flex_pretty_tickets_cases()}]. + +init_per_group(flex_pretty_tickets, Config) -> + flex_pretty_init(Config); +init_per_group(flex_compact_tickets, Config) -> + flex_compact_init(Config); +init_per_group(flex_compact, Config) -> + flex_compact_init(Config); +init_per_group(flex_pretty, Config) -> + flex_pretty_init(Config); +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(flex_pretty_tickets, Config) -> + flex_pretty_finish(Config); +end_per_group(flex_compact_tickets, Config) -> + flex_compact_finish(Config); +end_per_group(flex_compact, Config) -> + flex_compact_finish(Config); +end_per_group(flex_pretty, Config) -> + flex_pretty_finish(Config); +end_per_group(_GroupName, Config) -> + Config. + +flex_pretty_cases() -> + [flex_pretty_test_msgs]. + +flex_compact_cases() -> + [flex_compact_test_msgs, flex_compact_dm_timers1, + flex_compact_dm_timers2, flex_compact_dm_timers3, + flex_compact_dm_timers4, flex_compact_dm_timers5, + flex_compact_dm_timers6]. %% Support for per_bin was added to ASN.1 as of version %% 1.3.2 (R8). And later merged into 1.3.1.3 (R7). These %% releases are identical (as far as I know). %% -per_bin(suite) -> - [ - per_bin_test_msgs - ]. - -erl_dist_m(suite) -> - [ - erl_dist_m_test_msgs - ]. -tickets(suite) -> - [ - compact_tickets, - pretty_tickets, - flex_compact_tickets, - flex_pretty_tickets - ]. +flex_compact_tickets_cases() -> + [flex_compact_otp7431_msg01a, + flex_compact_otp7431_msg01b, flex_compact_otp7431_msg02, + flex_compact_otp7431_msg03, flex_compact_otp7431_msg04, + flex_compact_otp7431_msg05, flex_compact_otp7431_msg06, + flex_compact_otp7431_msg07]. + +flex_pretty_tickets_cases() -> + [flex_pretty_otp5042_msg1, flex_pretty_otp5085_msg1, + flex_pretty_otp5085_msg2, flex_pretty_otp5085_msg3, + flex_pretty_otp5085_msg4, flex_pretty_otp5085_msg5, + flex_pretty_otp5085_msg6, flex_pretty_otp5085_msg7, + flex_pretty_otp5600_msg1, flex_pretty_otp5600_msg2, + flex_pretty_otp5601_msg1, flex_pretty_otp5793_msg01, + flex_pretty_otp7431_msg01, flex_pretty_otp7431_msg02, + flex_pretty_otp7431_msg03, flex_pretty_otp7431_msg04, + flex_pretty_otp7431_msg05, flex_pretty_otp7431_msg06, + flex_pretty_otp7431_msg07]. +%% ---- -compact_tickets(suite) -> - [ - compact_otp4011_msg1, - compact_otp4011_msg2, - compact_otp4011_msg3, - compact_otp4013_msg1, - compact_otp4085_msg1, - compact_otp4085_msg2, - compact_otp4280_msg1, - compact_otp4299_msg1, - compact_otp4299_msg2, - compact_otp4359_msg1, - compact_otp4920_msg0, - compact_otp4920_msg1, - compact_otp4920_msg2, - compact_otp4920_msg3, - compact_otp4920_msg4, - compact_otp4920_msg5, - compact_otp4920_msg6, - compact_otp4920_msg7, - compact_otp4920_msg8, - compact_otp4920_msg9, - compact_otp4920_msg10, - compact_otp4920_msg11, - compact_otp4920_msg12, - compact_otp4920_msg20, - compact_otp4920_msg21, - compact_otp4920_msg22, - compact_otp4920_msg23, - compact_otp4920_msg24, - compact_otp4920_msg25, - compact_otp5186_msg01, - compact_otp5186_msg02, - compact_otp5186_msg03, - compact_otp5186_msg04, - compact_otp5186_msg05, - compact_otp5186_msg06, - compact_otp5793_msg01, - compact_otp5993_msg01, - compact_otp5993_msg02, - compact_otp5993_msg03, - compact_otp6017_msg01, - compact_otp6017_msg02, - compact_otp6017_msg03 - ]. - -flex_compact_tickets(suite) -> - {req, [], - {conf, flex_compact_init, flex_compact_tickets_cases(), - flex_compact_finish}}. - -flex_compact_tickets_cases() -> - [ - flex_compact_otp7431_msg01a, - flex_compact_otp7431_msg01b, - flex_compact_otp7431_msg02, - flex_compact_otp7431_msg03, - flex_compact_otp7431_msg04, - flex_compact_otp7431_msg05, - flex_compact_otp7431_msg06, - flex_compact_otp7431_msg07 - ]. - - -pretty_tickets(suite) -> - [ - pretty_otp4632_msg1, - pretty_otp4632_msg2, - pretty_otp4632_msg3, - pretty_otp4632_msg4, - pretty_otp4710_msg1, - pretty_otp4710_msg2, - pretty_otp4945_msg1, - pretty_otp4945_msg2, - pretty_otp4945_msg3, - pretty_otp4945_msg4, - pretty_otp4945_msg5, - pretty_otp4945_msg6, - pretty_otp4949_msg1, - pretty_otp4949_msg2, - pretty_otp4949_msg3, - pretty_otp5042_msg1, - pretty_otp5068_msg1, - pretty_otp5085_msg1, - pretty_otp5085_msg2, - pretty_otp5085_msg3, - pretty_otp5085_msg4, - pretty_otp5085_msg5, - pretty_otp5085_msg6, - pretty_otp5085_msg7, - pretty_otp5600_msg1, - pretty_otp5600_msg2, - pretty_otp5601_msg1, - pretty_otp5793_msg01, - pretty_otp5882_msg01, - pretty_otp6490_msg01, - pretty_otp6490_msg02, - pretty_otp6490_msg03, - pretty_otp6490_msg04, - pretty_otp6490_msg05, - pretty_otp6490_msg06, - pretty_otp7671_msg01, - pretty_otp7671_msg02, - pretty_otp7671_msg03, - pretty_otp7671_msg04, - pretty_otp7671_msg05 - ]. - -flex_pretty_tickets(suite) -> - {req, [], - {conf, flex_pretty_init, flex_pretty_tickets_cases(), - flex_pretty_finish}}. - -flex_pretty_tickets_cases() -> - [ - flex_pretty_otp5042_msg1, - flex_pretty_otp5085_msg1, - flex_pretty_otp5085_msg2, - flex_pretty_otp5085_msg3, - flex_pretty_otp5085_msg4, - flex_pretty_otp5085_msg5, - flex_pretty_otp5085_msg6, - flex_pretty_otp5085_msg7, - flex_pretty_otp5600_msg1, - flex_pretty_otp5600_msg2, - flex_pretty_otp5601_msg1, - flex_pretty_otp5793_msg01, - flex_pretty_otp7431_msg01, - flex_pretty_otp7431_msg02, - flex_pretty_otp7431_msg03, - flex_pretty_otp7431_msg04, - flex_pretty_otp7431_msg05, - flex_pretty_otp7431_msg06, - flex_pretty_otp7431_msg07 - ]. +tickets() -> + Flag = process_flag(trap_exit, true), + Cases = expand(tickets), + Fun = fun(Case) -> + C = init_per_testcase(Case, [{tc_timeout, + timer:minutes(10)}]), + io:format("Eval ~w~n", [Case]), + Result = + case (catch apply(?MODULE, Case, [C])) of + {'EXIT', Reason} -> + io:format("~n~p exited:~n ~p~n", + [Case, Reason]), + {error, {Case, Reason}}; + Res -> + Res + end, + end_per_testcase(Case, C), + Result + end, + process_flag(trap_exit, Flag), + lists:map(Fun, Cases). %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/lib/megaco/test/megaco_codec_v2_test.erl b/lib/megaco/test/megaco_codec_v2_test.erl index 1df1c6c93b..c3a80febba 100644 --- a/lib/megaco/test/megaco_codec_v2_test.erl +++ b/lib/megaco/test/megaco_codec_v2_test.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2003-2009. All Rights Reserved. +%% Copyright Ericsson AB 2003-2010. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -37,22 +37,16 @@ -export([t/0, t/1]). --export([all/1, +-export([all/0,groups/0,init_per_group/2,end_per_group/2, - text/1, - - pretty/1, pretty_test_msgs/1, - compact/1, compact_test_msgs/1, - - flex_pretty/1, + flex_pretty_init/1, flex_pretty_finish/1, flex_pretty_test_msgs/1, - - flex_compact/1, + flex_compact_init/1, flex_compact_finish/1, flex_compact_test_msgs/1, @@ -65,32 +59,21 @@ flex_compact_dm_timers6/1, flex_compact_dm_timers7/1, flex_compact_dm_timers8/1, - - binary/1, - bin/1, bin_test_msgs/1, - ber/1, ber_test_msgs/1, - - ber_bin/1, + ber_bin_test_msgs/1, - - per/1, + per_test_msgs/1, - - per_bin/1, + per_bin_test_msgs/1, - - erl_dist/1, - erl_dist_m/1, + erl_dist_m_test_msgs/1, tickets/0, - tickets/1, - - compact_tickets/1, + compact_otp4011_msg1/1, compact_otp4011_msg2/1, compact_otp4011_msg3/1, @@ -143,8 +126,7 @@ compact_otp7534_msg01/1, compact_otp7576_msg01/1, compact_otp7671_msg01/1, - - flex_compact_tickets/1, + flex_compact_otp7138_msg01/1, flex_compact_otp7138_msg02/1, flex_compact_otp7431_msg01/1, @@ -160,8 +142,7 @@ flex_compact_otp7534_msg01/1, flex_compact_otp7573_msg01/1, flex_compact_otp7576_msg01/1, - - pretty_tickets/1, + pretty_otp4632_msg1/1, pretty_otp4632_msg2/1, pretty_otp4632_msg3/1, @@ -204,7 +185,6 @@ pretty_otp7671_msg04/1, pretty_otp7671_msg05/1, - flex_pretty_tickets/1, flex_pretty_otp5042_msg1/1, flex_pretty_otp5085_msg1/1, flex_pretty_otp5085_msg2/1, @@ -225,7 +205,7 @@ flex_pretty_otp7431_msg06/1, flex_pretty_otp7431_msg07/1, - init_per_testcase/2, fin_per_testcase/2]). + init_per_testcase/2, end_per_testcase/2]). -export([display_text_messages/0, generate_text_messages/0]). @@ -431,31 +411,7 @@ expand([Case|Cases], Acc) -> expand(Cases, [Case|Acc]) end. - -%% ---- - -tickets() -> - Flag = process_flag(trap_exit, true), - Cases = expand(tickets), - Fun = fun(Case) -> - C = init_per_testcase(Case, [{tc_timeout, - timer:minutes(10)}]), - io:format("Eval ~w~n", [Case]), - Result = - case (catch apply(?MODULE, Case, [C])) of - {'EXIT', Reason} -> - io:format("~n~p exited:~n ~p~n", - [Case, Reason]), - {error, {Case, Reason}}; - Res -> - Res - end, - fin_per_testcase(Case, C), - Result - end, - process_flag(trap_exit, Flag), - lists:map(Fun, Cases). - + %% ---- @@ -474,284 +430,202 @@ init_per_testcase(Case, Config) -> end, megaco_test_lib:init_per_testcase(Case, C). -fin_per_testcase(Case, Config) -> +end_per_testcase(Case, Config) -> erase(verbosity), - megaco_test_lib:fin_per_testcase(Case, Config). + megaco_test_lib:end_per_testcase(Case, Config). %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %% Top test case -all(suite) -> - [ - text, - binary, - erl_dist, - tickets - ]. - -text(suite) -> - [ - pretty, - flex_pretty, - compact, - flex_compact - ]. - -binary(suite) -> - [ - bin, - ber, - ber_bin, - per, - per_bin - ]. - -erl_dist(suite) -> - [ - erl_dist_m - ]. - -pretty(suite) -> - [ - pretty_test_msgs - ]. - - -compact(suite) -> - [ - compact_test_msgs - ]. +all() -> +[{group, text}, {group, binary}, {group, erl_dist}, + {group, tickets}]. + +groups() -> + [{text, [], + [{group, pretty}, {group, flex_pretty}, + {group, compact}, {group, flex_compact}]}, + {binary, [], + [{group, bin}, {group, ber}, {group, ber_bin}, + {group, per}, {group, per_bin}]}, + {erl_dist, [], [{group, erl_dist_m}]}, + {pretty, [], [pretty_test_msgs]}, + {compact, [], [compact_test_msgs]}, + {flex_pretty, [], flex_pretty_cases()}, + {flex_compact, [], flex_compact_cases()}, + {bin, [], [bin_test_msgs]}, {ber, [], [ber_test_msgs]}, + {ber_bin, [], [ber_bin_test_msgs]}, + {per, [], [per_test_msgs]}, + {per_bin, [], [per_bin_test_msgs]}, + {erl_dist_m, [], [erl_dist_m_test_msgs]}, + {tickets, [], + [{group, compact_tickets}, {group, pretty_tickets}, + {group, flex_compact_tickets}, + {group, flex_pretty_tickets}]}, + {compact_tickets, [], + [compact_otp4011_msg1, compact_otp4011_msg2, + compact_otp4011_msg3, compact_otp4013_msg1, + compact_otp4085_msg1, compact_otp4085_msg2, + compact_otp4280_msg1, compact_otp4299_msg1, + compact_otp4299_msg2, compact_otp4359_msg1, + compact_otp4920_msg0, compact_otp4920_msg1, + compact_otp4920_msg2, compact_otp4920_msg3, + compact_otp4920_msg4, compact_otp4920_msg5, + compact_otp4920_msg6, compact_otp4920_msg7, + compact_otp4920_msg8, compact_otp4920_msg9, + compact_otp4920_msg10, compact_otp4920_msg11, + compact_otp4920_msg12, compact_otp4920_msg20, + compact_otp4920_msg21, compact_otp4920_msg22, + compact_otp4920_msg23, compact_otp4920_msg24, + compact_otp4920_msg25, compact_otp5186_msg01, + compact_otp5186_msg02, compact_otp5186_msg03, + compact_otp5186_msg04, compact_otp5186_msg05, + compact_otp5186_msg06, compact_otp5290_msg01, + compact_otp5290_msg02, compact_otp5793_msg01, + compact_otp5993_msg01, compact_otp5993_msg02, + compact_otp5993_msg03, compact_otp6017_msg01, + compact_otp6017_msg02, compact_otp6017_msg03, + compact_otp7138_msg01, compact_otp7138_msg02, + compact_otp7457_msg01, compact_otp7457_msg02, + compact_otp7457_msg03, compact_otp7534_msg01, + compact_otp7576_msg01, compact_otp7671_msg01]}, + {flex_compact_tickets, [], + flex_compact_tickets_cases()}, + {pretty_tickets, [], + [pretty_otp4632_msg1, pretty_otp4632_msg2, + pretty_otp4632_msg3, pretty_otp4632_msg4, + pretty_otp4710_msg1, pretty_otp4710_msg2, + pretty_otp4945_msg1, pretty_otp4945_msg2, + pretty_otp4945_msg3, pretty_otp4945_msg4, + pretty_otp4945_msg5, pretty_otp4945_msg6, + pretty_otp4949_msg1, pretty_otp4949_msg2, + pretty_otp4949_msg3, pretty_otp5042_msg1, + pretty_otp5068_msg1, pretty_otp5085_msg1, + pretty_otp5085_msg2, pretty_otp5085_msg3, + pretty_otp5085_msg4, pretty_otp5085_msg5, + pretty_otp5085_msg6, pretty_otp5085_msg7, + pretty_otp5600_msg1, pretty_otp5600_msg2, + pretty_otp5601_msg1, pretty_otp5793_msg01, + pretty_otp5882_msg01, pretty_otp6490_msg01, + pretty_otp6490_msg02, pretty_otp6490_msg03, + pretty_otp6490_msg04, pretty_otp6490_msg05, + pretty_otp6490_msg06, pretty_otp7249_msg01, + pretty_otp7671_msg01, pretty_otp7671_msg02, + pretty_otp7671_msg03, pretty_otp7671_msg04, + pretty_otp7671_msg05]}, + {flex_pretty_tickets, [], flex_pretty_tickets_cases()}]. + +init_per_group(flex_pretty_tickets, Config) -> + flex_pretty_init(Config); +init_per_group(flex_compact_tickets, Config) -> + flex_compact_init(Config); +init_per_group(flex_compact, Config) -> + flex_compact_init(Config); +init_per_group(flex_pretty, Config) -> + flex_pretty_init(Config); +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(flex_pretty_tickets, Config) -> + flex_pretty_finish(Config); +end_per_group(flex_compact_tickets, Config) -> + flex_compact_finish(Config); +end_per_group(flex_compact, Config) -> + flex_compact_finish(Config); +end_per_group(flex_pretty, Config) -> + flex_pretty_finish(Config); +end_per_group(_GroupName, Config) -> + Config. + + + + + + + + + + +flex_pretty_cases() -> +[flex_pretty_test_msgs]. + + +flex_compact_cases() -> +[flex_compact_test_msgs, flex_compact_dm_timers1, + flex_compact_dm_timers2, flex_compact_dm_timers3, + flex_compact_dm_timers4, flex_compact_dm_timers5, + flex_compact_dm_timers6, flex_compact_dm_timers7, + flex_compact_dm_timers8]. -flex_pretty(suite) -> - {req, [], - {conf, flex_pretty_init, flex_pretty_cases(), flex_pretty_finish}}. -flex_pretty_cases() -> - [ - flex_pretty_test_msgs - ]. -flex_compact(suite) -> - {req, [], - {conf, flex_compact_init, flex_compact_cases(), flex_compact_finish}}. -flex_compact_cases() -> - [ - flex_compact_test_msgs, - flex_compact_dm_timers1, - flex_compact_dm_timers2, - flex_compact_dm_timers3, - flex_compact_dm_timers4, - flex_compact_dm_timers5, - flex_compact_dm_timers6, - flex_compact_dm_timers7, - flex_compact_dm_timers8 - ]. -bin(suite) -> - [ - bin_test_msgs - ]. -ber(suite) -> - [ - ber_test_msgs - ]. - - -ber_bin(suite) -> - [ - ber_bin_test_msgs - ]. - - -per(suite) -> - [ - per_test_msgs - ]. - %% Support for per_bin was added to ASN.1 as of version %% 1.3.2 (R8). And later merged into 1.3.1.3 (R7). These %% releases are identical (as far as I know). %% -per_bin(suite) -> - [ - per_bin_test_msgs - ]. -erl_dist_m(suite) -> - [ - erl_dist_m_test_msgs - ]. -tickets(suite) -> - [ - compact_tickets, - pretty_tickets, - flex_compact_tickets, - flex_pretty_tickets - ]. -compact_tickets(suite) -> - [ - compact_otp4011_msg1, - compact_otp4011_msg2, - compact_otp4011_msg3, - compact_otp4013_msg1, - compact_otp4085_msg1, - compact_otp4085_msg2, - compact_otp4280_msg1, - compact_otp4299_msg1, - compact_otp4299_msg2, - compact_otp4359_msg1, - compact_otp4920_msg0, - compact_otp4920_msg1, - compact_otp4920_msg2, - compact_otp4920_msg3, - compact_otp4920_msg4, - compact_otp4920_msg5, - compact_otp4920_msg6, - compact_otp4920_msg7, - compact_otp4920_msg8, - compact_otp4920_msg9, - compact_otp4920_msg10, - compact_otp4920_msg11, - compact_otp4920_msg12, - compact_otp4920_msg20, - compact_otp4920_msg21, - compact_otp4920_msg22, - compact_otp4920_msg23, - compact_otp4920_msg24, - compact_otp4920_msg25, - compact_otp5186_msg01, - compact_otp5186_msg02, - compact_otp5186_msg03, - compact_otp5186_msg04, - compact_otp5186_msg05, - compact_otp5186_msg06, - compact_otp5290_msg01, - compact_otp5290_msg02, - compact_otp5793_msg01, - compact_otp5993_msg01, - compact_otp5993_msg02, - compact_otp5993_msg03, - compact_otp6017_msg01, - compact_otp6017_msg02, - compact_otp6017_msg03, - compact_otp7138_msg01, - compact_otp7138_msg02, - compact_otp7457_msg01, - compact_otp7457_msg02, - compact_otp7457_msg03, - compact_otp7534_msg01, - compact_otp7576_msg01, - compact_otp7671_msg01 - ]. -flex_compact_tickets(suite) -> - {req, [], - {conf, flex_compact_init, flex_compact_tickets_cases(), - flex_compact_finish}}. -flex_compact_tickets_cases() -> - [ - flex_compact_otp7138_msg01, - flex_compact_otp7138_msg02, - flex_compact_otp7431_msg01, - flex_compact_otp7431_msg02, - flex_compact_otp7431_msg03, - flex_compact_otp7431_msg04, - flex_compact_otp7431_msg05, - flex_compact_otp7431_msg06, - flex_compact_otp7431_msg07, - flex_compact_otp7138_msg02, - flex_compact_otp7457_msg01, - flex_compact_otp7457_msg02, - flex_compact_otp7457_msg03, - flex_compact_otp7534_msg01, - flex_compact_otp7573_msg01, - flex_compact_otp7576_msg01 - ]. +flex_compact_tickets_cases() -> +[flex_compact_otp7138_msg01, flex_compact_otp7138_msg02, + flex_compact_otp7431_msg01, flex_compact_otp7431_msg02, + flex_compact_otp7431_msg03, flex_compact_otp7431_msg04, + flex_compact_otp7431_msg05, flex_compact_otp7431_msg06, + flex_compact_otp7431_msg07, flex_compact_otp7138_msg02, + flex_compact_otp7457_msg01, flex_compact_otp7457_msg02, + flex_compact_otp7457_msg03, flex_compact_otp7534_msg01, + flex_compact_otp7573_msg01, flex_compact_otp7576_msg01]. -pretty_tickets(suite) -> - [ - pretty_otp4632_msg1, - pretty_otp4632_msg2, - pretty_otp4632_msg3, - pretty_otp4632_msg4, - pretty_otp4710_msg1, - pretty_otp4710_msg2, - pretty_otp4945_msg1, - pretty_otp4945_msg2, - pretty_otp4945_msg3, - pretty_otp4945_msg4, - pretty_otp4945_msg5, - pretty_otp4945_msg6, - pretty_otp4949_msg1, - pretty_otp4949_msg2, - pretty_otp4949_msg3, - pretty_otp5042_msg1, - pretty_otp5068_msg1, - pretty_otp5085_msg1, - pretty_otp5085_msg2, - pretty_otp5085_msg3, - pretty_otp5085_msg4, - pretty_otp5085_msg5, - pretty_otp5085_msg6, - pretty_otp5085_msg7, - pretty_otp5600_msg1, - pretty_otp5600_msg2, - pretty_otp5601_msg1, - pretty_otp5793_msg01, - pretty_otp5882_msg01, - pretty_otp6490_msg01, - pretty_otp6490_msg02, - pretty_otp6490_msg03, - pretty_otp6490_msg04, - pretty_otp6490_msg05, - pretty_otp6490_msg06, - pretty_otp7249_msg01, - pretty_otp7671_msg01, - pretty_otp7671_msg02, - pretty_otp7671_msg03, - pretty_otp7671_msg04, - pretty_otp7671_msg05 - ]. -flex_pretty_tickets(suite) -> - {req, [], - {conf, flex_pretty_init, flex_pretty_tickets_cases(), - flex_pretty_finish}}. -flex_pretty_tickets_cases() -> - [ - flex_pretty_otp5042_msg1, - flex_pretty_otp5085_msg1, - flex_pretty_otp5085_msg2, - flex_pretty_otp5085_msg3, - flex_pretty_otp5085_msg4, - flex_pretty_otp5085_msg5, - flex_pretty_otp5085_msg6, - flex_pretty_otp5085_msg7, - flex_pretty_otp5600_msg1, - flex_pretty_otp5600_msg2, - flex_pretty_otp5601_msg1, - flex_pretty_otp5793_msg01, - flex_pretty_otp7431_msg01, - flex_pretty_otp7431_msg02, - flex_pretty_otp7431_msg03, - flex_pretty_otp7431_msg04, - flex_pretty_otp7431_msg05, - flex_pretty_otp7431_msg06, - flex_pretty_otp7431_msg07 - ]. +flex_pretty_tickets_cases() -> +[flex_pretty_otp5042_msg1, flex_pretty_otp5085_msg1, + flex_pretty_otp5085_msg2, flex_pretty_otp5085_msg3, + flex_pretty_otp5085_msg4, flex_pretty_otp5085_msg5, + flex_pretty_otp5085_msg6, flex_pretty_otp5085_msg7, + flex_pretty_otp5600_msg1, flex_pretty_otp5600_msg2, + flex_pretty_otp5601_msg1, flex_pretty_otp5793_msg01, + flex_pretty_otp7431_msg01, flex_pretty_otp7431_msg02, + flex_pretty_otp7431_msg03, flex_pretty_otp7431_msg04, + flex_pretty_otp7431_msg05, flex_pretty_otp7431_msg06, + flex_pretty_otp7431_msg07]. + +%% ---- + +tickets() -> + Flag = process_flag(trap_exit, true), + Cases = expand(tickets), + Fun = fun(Case) -> + C = init_per_testcase(Case, [{tc_timeout, + timer:minutes(10)}]), + io:format("Eval ~w~n", [Case]), + Result = + case (catch apply(?MODULE, Case, [C])) of + {'EXIT', Reason} -> + io:format("~n~p exited:~n ~p~n", + [Case, Reason]), + {error, {Case, Reason}}; + Res -> + Res + end, + end_per_testcase(Case, C), + Result + end, + process_flag(trap_exit, Flag), + lists:map(Fun, Cases). + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/lib/megaco/test/megaco_codec_v3_test.erl b/lib/megaco/test/megaco_codec_v3_test.erl index f49c3a677a..2c35ce13b3 100644 --- a/lib/megaco/test/megaco_codec_v3_test.erl +++ b/lib/megaco/test/megaco_codec_v3_test.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2006-2009. All Rights Reserved. +%% Copyright Ericsson AB 2006-2010. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -37,26 +37,15 @@ -export([t/0, t/1]). --export([all/1, - - text/1, - - pretty/1, +-export([all/0,groups/0,init_per_group/2,end_per_group/2, pretty_test_msgs/1, - - compact/1, compact_test_msgs/1, - - flex_pretty/1, flex_pretty_init/1, flex_pretty_finish/1, flex_pretty_test_msgs/1, - - flex_compact/1, flex_compact_init/1, flex_compact_finish/1, flex_compact_test_msgs/1, - flex_compact_dm_timers1/1, flex_compact_dm_timers2/1, flex_compact_dm_timers3/1, @@ -65,32 +54,15 @@ flex_compact_dm_timers6/1, flex_compact_dm_timers7/1, flex_compact_dm_timers8/1, - - binary/1, - - bin/1, bin_test_msgs/1, - - ber/1, ber_test_msgs/1, - - ber_bin/1, ber_bin_test_msgs/1, - - per/1, per_test_msgs/1, - - per_bin/1, per_bin_test_msgs/1, - - erl_dist/1, - erl_dist_m/1, erl_dist_m_test_msgs/1, tickets/0, - tickets/1, - - compact_tickets/1, + compact_otp4011_msg1/1, compact_otp4011_msg2/1, compact_otp4011_msg3/1, @@ -133,8 +105,7 @@ compact_otp6017_msg01/1, compact_otp6017_msg02/1, compact_otp6017_msg03/1, - - flex_compact_tickets/1, + flex_compact_otp4299_msg1/1, flex_compact_otp7431_msg01/1, flex_compact_otp7431_msg02/1, @@ -143,9 +114,7 @@ flex_compact_otp7431_msg05/1, flex_compact_otp7431_msg06/1, flex_compact_otp7431_msg07/1, - - - pretty_tickets/1, + pretty_otp4632_msg1/1, pretty_otp4632_msg2/1, pretty_otp4632_msg3/1, @@ -192,8 +161,7 @@ pretty_otp7671_msg04/1, pretty_otp7671_msg05/1, pretty_otp8114_msg01/1, - - flex_pretty_tickets/1, + flex_pretty_otp5042_msg1/1, flex_pretty_otp5085_msg1/1, flex_pretty_otp5085_msg2/1, @@ -219,7 +187,7 @@ flex_pretty_otp7431_msg06/1, flex_pretty_otp7431_msg07/1, - init_per_testcase/2, fin_per_testcase/2]). + init_per_testcase/2, end_per_testcase/2]). -export([display_text_messages/0, generate_text_messages/0]). @@ -285,31 +253,6 @@ expand([Case|Cases], Acc) -> expand(Cases, [Case|Acc]) end. - -%% ---- - -tickets() -> - Flag = process_flag(trap_exit, true), - Cases = expand(tickets), - Fun = fun(Case) -> - C = init_per_testcase(Case, [{tc_timeout, - timer:minutes(10)}]), - io:format("Eval ~w~n", [Case]), - Result = - case (catch apply(?MODULE, Case, [C])) of - {'EXIT', Reason} -> - io:format("~n~p exited:~n ~p~n", - [Case, Reason]), - {error, {Case, Reason}}; - Res -> - Res - end, - fin_per_testcase(Case, C), - Result - end, - process_flag(trap_exit, Flag), - lists:map(Fun, Cases). - %% ---- @@ -328,279 +271,174 @@ init_per_testcase(Case, Config) -> end, megaco_test_lib:init_per_testcase(Case, C). -fin_per_testcase(Case, Config) -> +end_per_testcase(Case, Config) -> erase(verbosity), - megaco_test_lib:fin_per_testcase(Case, Config). + megaco_test_lib:end_per_testcase(Case, Config). %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %% Top test case -all(suite) -> - [ - text, - binary, - erl_dist, - tickets - ]. - -text(suite) -> - [ - pretty, - flex_pretty, - compact, - flex_compact - ]. - -binary(suite) -> - [ - bin, - ber, - ber_bin, - per, - per_bin - ]. - -erl_dist(suite) -> - [ - erl_dist_m - ]. - -pretty(suite) -> - [ - pretty_test_msgs - ]. - - -compact(suite) -> - [ - compact_test_msgs - ]. - - -flex_pretty(suite) -> - {req, [], - {conf, flex_pretty_init, flex_pretty_cases(), flex_pretty_finish}}. +all() -> + [{group, text}, {group, binary}, {group, erl_dist}, + {group, tickets}]. + +groups() -> + [{text, [], + [{group, pretty}, {group, flex_pretty}, + {group, compact}, {group, flex_compact}]}, + {binary, [], + [{group, bin}, {group, ber}, {group, ber_bin}, + {group, per}, {group, per_bin}]}, + {erl_dist, [], [{group, erl_dist_m}]}, + {pretty, [], [pretty_test_msgs]}, + {compact, [], [compact_test_msgs]}, + {flex_pretty, [], flex_pretty_cases()}, + {flex_compact, [], flex_compact_cases()}, + {bin, [], [bin_test_msgs]}, {ber, [], [ber_test_msgs]}, + {ber_bin, [], [ber_bin_test_msgs]}, + {per, [], [per_test_msgs]}, + {per_bin, [], [per_bin_test_msgs]}, + {erl_dist_m, [], [erl_dist_m_test_msgs]}, + {tickets, [], + [{group, compact_tickets}, + {group, flex_compact_tickets}, {group, pretty_tickets}, + {group, flex_pretty_tickets}]}, + {compact_tickets, [], + [compact_otp4011_msg1, compact_otp4011_msg2, + compact_otp4011_msg3, compact_otp4013_msg1, + compact_otp4085_msg1, compact_otp4085_msg2, + compact_otp4280_msg1, compact_otp4299_msg1, + compact_otp4359_msg1, compact_otp4920_msg0, + compact_otp4920_msg1, compact_otp4920_msg2, + compact_otp4920_msg3, compact_otp4920_msg4, + compact_otp4920_msg5, compact_otp4920_msg6, + compact_otp4920_msg7, compact_otp4920_msg8, + compact_otp4920_msg9, compact_otp4920_msg10, + compact_otp4920_msg11, compact_otp4920_msg12, + compact_otp4920_msg20, compact_otp4920_msg21, + compact_otp4920_msg22, compact_otp4920_msg23, + compact_otp4920_msg24, compact_otp4920_msg25, + compact_otp5186_msg01, compact_otp5186_msg02, + compact_otp5186_msg03, compact_otp5186_msg04, + compact_otp5186_msg05, compact_otp5186_msg06, + compact_otp5793_msg01, compact_otp5836_msg01, + compact_otp5993_msg01, compact_otp5993_msg02, + compact_otp5993_msg03, compact_otp6017_msg01, + compact_otp6017_msg02, compact_otp6017_msg03]}, + {flex_compact_tickets, [], + flex_compact_tickets_cases()}, + {pretty_tickets, [], + [pretty_otp4632_msg1, pretty_otp4632_msg2, + pretty_otp4632_msg3, pretty_otp4632_msg4, + pretty_otp4710_msg1, pretty_otp4710_msg2, + pretty_otp4945_msg1, pretty_otp4945_msg2, + pretty_otp4945_msg3, pretty_otp4945_msg4, + pretty_otp4945_msg5, pretty_otp4945_msg6, + pretty_otp4949_msg1, pretty_otp4949_msg2, + pretty_otp4949_msg3, pretty_otp5042_msg1, + pretty_otp5068_msg1, pretty_otp5085_msg1, + pretty_otp5085_msg2, pretty_otp5085_msg3, + pretty_otp5085_msg4, pretty_otp5085_msg5, + pretty_otp5085_msg6, pretty_otp5085_msg7, + pretty_otp5085_msg8, pretty_otp5600_msg1, + pretty_otp5600_msg2, pretty_otp5601_msg1, + pretty_otp5793_msg01, pretty_otp5803_msg01, + pretty_otp5803_msg02, pretty_otp5805_msg01, + pretty_otp5836_msg01, pretty_otp5882_msg01, + pretty_otp6490_msg01, pretty_otp6490_msg02, + pretty_otp6490_msg03, pretty_otp6490_msg04, + pretty_otp6490_msg05, pretty_otp6490_msg06, + pretty_otp7671_msg01, pretty_otp7671_msg02, + pretty_otp7671_msg03, pretty_otp7671_msg04, + pretty_otp7671_msg05, pretty_otp8114_msg01]}, + {flex_pretty_tickets, [], flex_pretty_tickets_cases()}]. + +init_per_group(flex_pretty_tickets, Config) -> + flex_pretty_init(Config); +init_per_group(flex_compact_tickets, Config) -> + flex_compact_init(Config); +init_per_group(flex_compact, Config) -> + flex_compact_init(Config); +init_per_group(flex_pretty, Config) -> + flex_pretty_init(Config); +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(flex_pretty_tickets, Config) -> + flex_pretty_finish(Config); +end_per_group(flex_compact_tickets, Config) -> + flex_compact_finish(Config); +end_per_group(flex_compact, Config) -> + flex_compact_finish(Config); +end_per_group(flex_pretty, Config) -> + flex_pretty_finish(Config); +end_per_group(_GroupName, Config) -> + Config. + + +flex_pretty_cases() -> + [flex_pretty_test_msgs]. + + +flex_compact_cases() -> + [flex_compact_test_msgs, flex_compact_dm_timers1, + flex_compact_dm_timers2, flex_compact_dm_timers3, + flex_compact_dm_timers4, flex_compact_dm_timers5, + flex_compact_dm_timers6, flex_compact_dm_timers7, + flex_compact_dm_timers8]. -flex_pretty_cases() -> - [ - flex_pretty_test_msgs - ]. - -flex_compact(suite) -> - {req, [], - {conf, flex_compact_init, flex_compact_cases(), flex_compact_finish}}. - -flex_compact_cases() -> - [ - flex_compact_test_msgs, - flex_compact_dm_timers1, - flex_compact_dm_timers2, - flex_compact_dm_timers3, - flex_compact_dm_timers4, - flex_compact_dm_timers5, - flex_compact_dm_timers6, - flex_compact_dm_timers7, - flex_compact_dm_timers8 - ]. - - -bin(suite) -> - [ - bin_test_msgs - ]. - - -ber(suite) -> - [ - ber_test_msgs - ]. - - -ber_bin(suite) -> - [ - ber_bin_test_msgs - ]. - - -per(suite) -> - [ - per_test_msgs - ]. %% Support for per_bin was added to ASN.1 as of version %% 1.3.2 (R8). And later merged into 1.3.1.3 (R7). These %% releases are identical (as far as I know). %% -per_bin(suite) -> - [ - per_bin_test_msgs - ]. - - -erl_dist_m(suite) -> - [ - erl_dist_m_test_msgs - ]. - -tickets(suite) -> - [ - compact_tickets, - flex_compact_tickets, - pretty_tickets, - flex_pretty_tickets - ]. - - -compact_tickets(suite) -> - [ - compact_otp4011_msg1, - compact_otp4011_msg2, - compact_otp4011_msg3, - compact_otp4013_msg1, - compact_otp4085_msg1, - compact_otp4085_msg2, - compact_otp4280_msg1, - compact_otp4299_msg1, - compact_otp4359_msg1, - compact_otp4920_msg0, - compact_otp4920_msg1, - compact_otp4920_msg2, - compact_otp4920_msg3, - compact_otp4920_msg4, - compact_otp4920_msg5, - compact_otp4920_msg6, - compact_otp4920_msg7, - compact_otp4920_msg8, - compact_otp4920_msg9, - compact_otp4920_msg10, - compact_otp4920_msg11, - compact_otp4920_msg12, - compact_otp4920_msg20, - compact_otp4920_msg21, - compact_otp4920_msg22, - compact_otp4920_msg23, - compact_otp4920_msg24, - compact_otp4920_msg25, - compact_otp5186_msg01, - compact_otp5186_msg02, - compact_otp5186_msg03, - compact_otp5186_msg04, - compact_otp5186_msg05, - compact_otp5186_msg06, - compact_otp5793_msg01, - compact_otp5836_msg01, - compact_otp5993_msg01, - compact_otp5993_msg02, - compact_otp5993_msg03, - compact_otp6017_msg01, - compact_otp6017_msg02, - compact_otp6017_msg03 - ]. -flex_compact_tickets(suite) -> - {req, [], - {conf, flex_compact_init, flex_compact_tickets_cases(), - flex_compact_finish}}. - -flex_compact_tickets_cases() -> - [ - flex_compact_otp4299_msg1, - flex_compact_otp7431_msg01, - flex_compact_otp7431_msg02, - flex_compact_otp7431_msg03, - flex_compact_otp7431_msg04, - flex_compact_otp7431_msg05, - flex_compact_otp7431_msg06, - flex_compact_otp7431_msg07 - ]. - - -pretty_tickets(suite) -> - [ - pretty_otp4632_msg1, - pretty_otp4632_msg2, - pretty_otp4632_msg3, - pretty_otp4632_msg4, - pretty_otp4710_msg1, - pretty_otp4710_msg2, - pretty_otp4945_msg1, - pretty_otp4945_msg2, - pretty_otp4945_msg3, - pretty_otp4945_msg4, - pretty_otp4945_msg5, - pretty_otp4945_msg6, - pretty_otp4949_msg1, - pretty_otp4949_msg2, - pretty_otp4949_msg3, - pretty_otp5042_msg1, - pretty_otp5068_msg1, - pretty_otp5085_msg1, - pretty_otp5085_msg2, - pretty_otp5085_msg3, - pretty_otp5085_msg4, - pretty_otp5085_msg5, - pretty_otp5085_msg6, - pretty_otp5085_msg7, - pretty_otp5085_msg8, - pretty_otp5600_msg1, - pretty_otp5600_msg2, - pretty_otp5601_msg1, - pretty_otp5793_msg01, - pretty_otp5803_msg01, - pretty_otp5803_msg02, - pretty_otp5805_msg01, - pretty_otp5836_msg01, - pretty_otp5882_msg01, - pretty_otp6490_msg01, - pretty_otp6490_msg02, - pretty_otp6490_msg03, - pretty_otp6490_msg04, - pretty_otp6490_msg05, - pretty_otp6490_msg06, - pretty_otp7671_msg01, - pretty_otp7671_msg02, - pretty_otp7671_msg03, - pretty_otp7671_msg04, - pretty_otp7671_msg05, - pretty_otp8114_msg01 - ]. +flex_compact_tickets_cases() -> + [flex_compact_otp4299_msg1, flex_compact_otp7431_msg01, + flex_compact_otp7431_msg02, flex_compact_otp7431_msg03, + flex_compact_otp7431_msg04, flex_compact_otp7431_msg05, + flex_compact_otp7431_msg06, flex_compact_otp7431_msg07]. + +flex_pretty_tickets_cases() -> + [flex_pretty_otp5042_msg1, flex_pretty_otp5085_msg1, + flex_pretty_otp5085_msg2, flex_pretty_otp5085_msg3, + flex_pretty_otp5085_msg4, flex_pretty_otp5085_msg5, + flex_pretty_otp5085_msg6, flex_pretty_otp5085_msg7, + flex_pretty_otp5085_msg8, flex_pretty_otp5600_msg1, + flex_pretty_otp5600_msg2, flex_pretty_otp5601_msg1, + flex_pretty_otp5793_msg01, flex_pretty_otp5803_msg01, + flex_pretty_otp5803_msg02, flex_pretty_otp5805_msg01, + flex_pretty_otp5836_msg01, flex_pretty_otp7431_msg01, + flex_pretty_otp7431_msg02, flex_pretty_otp7431_msg03, + flex_pretty_otp7431_msg04, flex_pretty_otp7431_msg05, + flex_pretty_otp7431_msg06, flex_pretty_otp7431_msg07]. +%% ---- -flex_pretty_tickets(suite) -> - {req, [], - {conf, flex_pretty_init, flex_pretty_tickets_cases(), - flex_pretty_finish}}. - -flex_pretty_tickets_cases() -> - [ - flex_pretty_otp5042_msg1, - flex_pretty_otp5085_msg1, - flex_pretty_otp5085_msg2, - flex_pretty_otp5085_msg3, - flex_pretty_otp5085_msg4, - flex_pretty_otp5085_msg5, - flex_pretty_otp5085_msg6, - flex_pretty_otp5085_msg7, - flex_pretty_otp5085_msg8, - flex_pretty_otp5600_msg1, - flex_pretty_otp5600_msg2, - flex_pretty_otp5601_msg1, - flex_pretty_otp5793_msg01, - flex_pretty_otp5803_msg01, - flex_pretty_otp5803_msg02, - flex_pretty_otp5805_msg01, - flex_pretty_otp5836_msg01, - flex_pretty_otp7431_msg01, - flex_pretty_otp7431_msg02, - flex_pretty_otp7431_msg03, - flex_pretty_otp7431_msg04, - flex_pretty_otp7431_msg05, - flex_pretty_otp7431_msg06, - flex_pretty_otp7431_msg07 - ]. +tickets() -> + Flag = process_flag(trap_exit, true), + Cases = expand(tickets), + Fun = fun(Case) -> + C = init_per_testcase(Case, [{tc_timeout, + timer:minutes(10)}]), + io:format("Eval ~w~n", [Case]), + Result = + case (catch apply(?MODULE, Case, [C])) of + {'EXIT', Reason} -> + io:format("~n~p exited:~n ~p~n", + [Case, Reason]), + {error, {Case, Reason}}; + Res -> + Res + end, + end_per_testcase(Case, C), + Result + end, + process_flag(trap_exit, Flag), + lists:map(Fun, Cases). %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/lib/megaco/test/megaco_config_test.erl b/lib/megaco/test/megaco_config_test.erl index 9ab1a7d90d..1fc4d09d3b 100644 --- a/lib/megaco/test/megaco_config_test.erl +++ b/lib/megaco/test/megaco_config_test.erl @@ -44,9 +44,9 @@ do_init_per_testcase(Case, Config) -> process_flag(trap_exit, true), megaco_test_lib:init_per_testcase(Case, Config). -fin_per_testcase(Case, Config) -> +end_per_testcase(Case, Config) -> process_flag(trap_exit, false), - megaco_test_lib:fin_per_testcase(Case, Config). + megaco_test_lib:end_per_testcase(Case, Config). -record(command, {id, desc, cmd, verify}). @@ -58,25 +58,21 @@ fin_per_testcase(Case, Config) -> %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %% Top test case -all(suite) -> - [ - config, - transaction_id_counter, - tickets - ]. - -transaction_id_counter(suite) -> - [ - transaction_id_counter_mg, - transaction_id_counter_mgc - ]. - -tickets(suite) -> - [ - otp_7216, - otp_8167, - otp_8183 - ]. +all() -> + [config, {group, transaction_id_counter}, + {group, tickets}]. + +groups() -> + [{transaction_id_counter, [], + [transaction_id_counter_mg, + transaction_id_counter_mgc]}, + {tickets, [], [otp_7216, otp_8167, otp_8183]}]. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/lib/megaco/test/megaco_digit_map_test.erl b/lib/megaco/test/megaco_digit_map_test.erl index 22e115278f..d16fb679ae 100644 --- a/lib/megaco/test/megaco_digit_map_test.erl +++ b/lib/megaco/test/megaco_digit_map_test.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2005-2009. All Rights Reserved. +%% Copyright Ericsson AB 2005-2010. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -36,54 +36,39 @@ t(Case) -> megaco_test_lib:t({?MODULE, Case}). init_per_testcase(Case, Config) -> megaco_test_lib:init_per_testcase(Case, Config). -fin_per_testcase(Case, Config) -> - megaco_test_lib:fin_per_testcase(Case, Config). +end_per_testcase(Case, Config) -> + megaco_test_lib:end_per_testcase(Case, Config). %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -all(suite) -> - Cases = - [ - tickets - ], - Cases. +all() -> + [{group, tickets}]. + +groups() -> + [{tickets, [], + [{group, otp_5750}, {group, otp_5799}, + {group, otp_5826}, {group, otp_7449}]}, + {otp_5750, [], [otp_5750_01, otp_5750_02]}, + {otp_5799, [], [otp_5799_01]}, + {otp_5826, [], [otp_5826_01, otp_5826_02, otp_5826_03]}, + {otp_7449, [], [otp_7449_1, otp_7449_2]}]. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -tickets(suite) -> - [ - otp_5750, - otp_5799, - otp_5826, - otp_7449 - ]. - - -otp_5750(suite) -> - [ - otp_5750_01, - otp_5750_02 - ]. - -otp_5799(suite) -> - [ - otp_5799_01 - ]. - -otp_5826(suite) -> - [ - otp_5826_01, - otp_5826_02, - otp_5826_03 - ]. - -otp_7449(suite) -> - [ - otp_7449_1, - otp_7449_2 - ]. + + + + + diff --git a/lib/megaco/test/megaco_examples_test.erl b/lib/megaco/test/megaco_examples_test.erl index ef15cb1bde..528b61c2af 100644 --- a/lib/megaco/test/megaco_examples_test.erl +++ b/lib/megaco/test/megaco_examples_test.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2001-2009. All Rights Reserved. +%% Copyright Ericsson AB 2001-2010. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -41,11 +41,11 @@ init_per_testcase(Case, Config) -> megaco:enable_trace(max, io), megaco_test_lib:init_per_testcase(Case, Config). -fin_per_testcase(Case, Config) -> +end_per_testcase(Case, Config) -> purge_examples(), erase(dbg), megaco:disable_trace(), - megaco_test_lib:fin_per_testcase(Case, Config). + megaco_test_lib:end_per_testcase(Case, Config). example_modules() -> [megaco_simple_mg, megaco_simple_mgc]. @@ -70,13 +70,18 @@ purge_examples() -> %% Top test case %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -all(doc) -> - ["Run all examples mentioned in the documentation", - "Are really all examples covered?"]; -all(suite) -> - [ - simple - ]. +all() -> + [simple]. + +groups() -> + []. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + simple(suite) -> []; diff --git a/lib/megaco/test/megaco_flex_test.erl b/lib/megaco/test/megaco_flex_test.erl index 3dbcf53e7a..d7fc8eacb5 100644 --- a/lib/megaco/test/megaco_flex_test.erl +++ b/lib/megaco/test/megaco_flex_test.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2008-2009. All Rights Reserved. +%% Copyright Ericsson AB 2008-2010. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -32,10 +32,10 @@ -export([ t/0, t/1, - init_per_testcase/2, fin_per_testcase/2, + init_per_testcase/2, end_per_testcase/2, - all/1, - flex_init/1, flex_fin/1, + all/0,groups/0,init_per_group/2,end_per_group/2, + init_per_suite/1, end_per_suite/1, plain/1, port_exit/1, @@ -55,26 +55,31 @@ t(Case) -> megaco_test_lib:t({?MODULE, Case}). init_per_testcase(Case, Config) -> megaco_test_lib:init_per_testcase(Case, Config). -fin_per_testcase(Case, Config) -> - megaco_test_lib:fin_per_testcase(Case, Config). +end_per_testcase(Case, Config) -> + megaco_test_lib:end_per_testcase(Case, Config). %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -all(suite) -> - Cases = - [ - plain, - port_exit, - garbage_in - ], - {req, [], {conf, flex_init, Cases, flex_fin}}. +all() -> + [plain, port_exit, garbage_in]. -flex_init(suite) -> + +groups() -> + []. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + + +init_per_suite(suite) -> []; -flex_init(doc) -> +init_per_suite(doc) -> []; -flex_init(Config) when is_list(Config) -> +init_per_suite(Config) when is_list(Config) -> case megaco_flex_scanner:is_enabled() of true -> Config; @@ -82,9 +87,9 @@ flex_init(Config) when is_list(Config) -> ?SKIP(flex_scanner_not_enabled) end. -flex_fin(suite) -> []; -flex_fin(doc) -> []; -flex_fin(Config) when is_list(Config) -> +end_per_suite(suite) -> []; +end_per_suite(doc) -> []; +end_per_suite(Config) when is_list(Config) -> Config. diff --git a/lib/megaco/test/megaco_load_test.erl b/lib/megaco/test/megaco_load_test.erl index 5a22b7b4ee..5519ca15c6 100644 --- a/lib/megaco/test/megaco_load_test.erl +++ b/lib/megaco/test/megaco_load_test.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2003-2009. All Rights Reserved. +%% Copyright Ericsson AB 2003-2010. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -99,26 +99,29 @@ do_init_per_testcase(Case, Config) -> process_flag(trap_exit, true), megaco_test_lib:init_per_testcase(Case, Config). -fin_per_testcase(Case, Config) -> +end_per_testcase(Case, Config) -> process_flag(trap_exit, false), - megaco_test_lib:fin_per_testcase(Case, Config). + megaco_test_lib:end_per_testcase(Case, Config). %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -all(suite) -> - Cases = - [ - single_user_light_load, - single_user_medium_load, - single_user_heavy_load, - single_user_extreme_load, - multi_user_light_load, - multi_user_medium_load, - multi_user_heavy_load, - multi_user_extreme_load - ], - Cases. +all() -> + [single_user_light_load, + single_user_medium_load, single_user_heavy_load, + single_user_extreme_load, multi_user_light_load, + multi_user_medium_load, multi_user_heavy_load, + multi_user_extreme_load]. + +groups() -> + []. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/lib/megaco/test/megaco_mess_otp8212_test.erl b/lib/megaco/test/megaco_mess_otp8212_test.erl index 109886ebc4..e074e2f0b3 100644 --- a/lib/megaco/test/megaco_mess_otp8212_test.erl +++ b/lib/megaco/test/megaco_mess_otp8212_test.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2009. All Rights Reserved. +%% Copyright Ericsson AB 2010. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in diff --git a/lib/megaco/test/megaco_mess_test.erl b/lib/megaco/test/megaco_mess_test.erl index 368800fa54..ded1506271 100644 --- a/lib/megaco/test/megaco_mess_test.erl +++ b/lib/megaco/test/megaco_mess_test.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 1999-2009. All Rights Reserved. +%% Copyright Ericsson AB 1999-2010. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -34,13 +34,13 @@ %% -compile(export_all). -export([ - all/1, + all/0,groups/0,init_per_group/2,end_per_group/2, init_per_testcase/2, - fin_per_testcase/2, + end_per_testcase/2, connect/1, - request_and_reply/1, + request_and_reply_plain/1, request_and_no_reply/1, request_and_reply_pending_ack_no_pending/1, @@ -52,13 +52,13 @@ request_and_reply_and_late_ack/1, trans_req_and_reply_and_req/1, - pending_ack/1, + pending_ack_plain/1, request_and_pending_and_late_reply/1, dist/1, - tickets/1, + otp_4359/1, otp_4836/1, otp_5805/1, @@ -67,18 +67,18 @@ otp_6253/1, otp_6275/1, otp_6276/1, - otp_6442/1, + otp_6442_resend_request1/1, otp_6442_resend_request2/1, otp_6442_resend_reply1/1, otp_6442_resend_reply2/1, - otp_6865/1, + otp_6865_request_and_reply_plain_extra1/1, otp_6865_request_and_reply_plain_extra2/1, otp_7189/1, otp_7259/1, otp_7713/1, - otp_8183/1, + otp_8183_request1/1, otp_8212/1 ]). @@ -337,83 +337,50 @@ init_per_testcase(Case, Config) -> C = lists:keydelete(tc_timeout, 1, Config), megaco_test_lib:init_per_testcase(Case, [{tc_timeout, min(1)} |C]). -% fin_per_testcase(pending_ack = Case, Config) -> +% end_per_testcase(pending_ack = Case, Config) -> % erase(dbg), -% megaco_test_lib:fin_per_testcase(Case, Config); -fin_per_testcase(Case, Config) -> - megaco_test_lib:fin_per_testcase(Case, Config). +% megaco_test_lib:end_per_testcase(Case, Config); +end_per_testcase(Case, Config) -> + megaco_test_lib:end_per_testcase(Case, Config). %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -all(suite) -> - [ - connect, - request_and_reply, - pending_ack, - dist, - - %% Tickets last - tickets - ]. - -request_and_reply(suite) -> - [ - request_and_reply_plain, - request_and_no_reply, - request_and_reply_pending_ack_no_pending, - request_and_reply_pending_ack_one_pending, - single_trans_req_and_reply, - single_trans_req_and_reply_sendopts, - request_and_reply_and_ack, - request_and_reply_and_no_ack, - request_and_reply_and_late_ack, - trans_req_and_reply_and_req - ]. - -pending_ack(suite) -> - [ - pending_ack_plain, - request_and_pending_and_late_reply - ]. - -tickets(suite) -> - [ - otp_4359, - otp_4836, - otp_5805, - otp_5881, - otp_5887, - otp_6253, - otp_6275, - otp_6276, - otp_6442, - otp_6865, - otp_7189, - otp_7259, - otp_7713, - otp_8183, - otp_8212 - ]. - -otp_6442(suite) -> - [ - otp_6442_resend_request1, - otp_6442_resend_request2, - otp_6442_resend_reply1, - otp_6442_resend_reply2 - ]. - -otp_6865(suite) -> - [ - otp_6865_request_and_reply_plain_extra1, - otp_6865_request_and_reply_plain_extra2 - ]. - -otp_8183(suite) -> - [ - otp_8183_request1 - ]. +all() -> + [connect, {group, request_and_reply}, + {group, pending_ack}, dist, {group, tickets}]. + +groups() -> + [{request_and_reply, [], + [request_and_reply_plain, request_and_no_reply, + request_and_reply_pending_ack_no_pending, + request_and_reply_pending_ack_one_pending, + single_trans_req_and_reply, + single_trans_req_and_reply_sendopts, + request_and_reply_and_ack, request_and_reply_and_no_ack, + request_and_reply_and_late_ack, + trans_req_and_reply_and_req]}, + {pending_ack, [], + [pending_ack_plain, + request_and_pending_and_late_reply]}, + {tickets, [], + [otp_4359, otp_4836, otp_5805, otp_5881, otp_5887, + otp_6253, otp_6275, otp_6276, {group, otp_6442}, + {group, otp_6865}, otp_7189, otp_7259, otp_7713, + {group, otp_8183}, otp_8212]}, + {otp_6442, [], + [otp_6442_resend_request1, otp_6442_resend_request2, + otp_6442_resend_reply1, otp_6442_resend_reply2]}, + {otp_6865, [], + [otp_6865_request_and_reply_plain_extra1, + otp_6865_request_and_reply_plain_extra2]}, + {otp_8183, [], [otp_8183_request1]}]. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/lib/megaco/test/megaco_mess_user_test.erl b/lib/megaco/test/megaco_mess_user_test.erl index 50284be549..ce682c167b 100644 --- a/lib/megaco/test/megaco_mess_user_test.erl +++ b/lib/megaco/test/megaco_mess_user_test.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2000-2009. All Rights Reserved. +%% Copyright Ericsson AB 2000-2010. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in diff --git a/lib/megaco/test/megaco_mib_test.erl b/lib/megaco/test/megaco_mib_test.erl index 2da6aa3bf3..52d99d1442 100644 --- a/lib/megaco/test/megaco_mib_test.erl +++ b/lib/megaco/test/megaco_mib_test.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2002-2009. All Rights Reserved. +%% Copyright Ericsson AB 2002-2010. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -63,21 +63,25 @@ init_per_testcase(Case, Config) -> megaco_test_lib:init_per_testcase(Case, Config) end. -fin_per_testcase(Case, Config) -> +end_per_testcase(Case, Config) -> process_flag(trap_exit, false), - megaco_test_lib:fin_per_testcase(Case, Config). + megaco_test_lib:end_per_testcase(Case, Config). %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -all(suite) -> - Cases = - [ - plain, - connect, - traffic - ], - Cases. +all() -> + [plain, connect, traffic]. + +groups() -> + []. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/lib/megaco/test/megaco_mreq_test.erl b/lib/megaco/test/megaco_mreq_test.erl index 676acd8a12..1d3f38d50d 100644 --- a/lib/megaco/test/megaco_mreq_test.erl +++ b/lib/megaco/test/megaco_mreq_test.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2003-2009. All Rights Reserved. +%% Copyright Ericsson AB 2003-2010. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -69,20 +69,24 @@ init_per_testcase(Case, Config) -> process_flag(trap_exit, true), megaco_test_lib:init_per_testcase(Case, Config). -fin_per_testcase(Case, Config) -> +end_per_testcase(Case, Config) -> process_flag(trap_exit, false), - megaco_test_lib:fin_per_testcase(Case, Config). + megaco_test_lib:end_per_testcase(Case, Config). %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -all(suite) -> - Cases = - [ - req_and_rep, - req_and_pending, - req_and_cancel - ], - Cases. +all() -> + [req_and_rep, req_and_pending, req_and_cancel]. + +groups() -> + []. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/lib/megaco/test/megaco_pending_limit_test.erl b/lib/megaco/test/megaco_pending_limit_test.erl index 1ca29c195c..233c22f4d2 100644 --- a/lib/megaco/test/megaco_pending_limit_test.erl +++ b/lib/megaco/test/megaco_pending_limit_test.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2003-2009. All Rights Reserved. +%% Copyright Ericsson AB 2003-2010. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -26,22 +26,16 @@ -module(megaco_pending_limit_test). -export([t/0, t/1]). --export([init_per_testcase/2, fin_per_testcase/2]). --export([all/1, - - sent/1, +-export([init_per_testcase/2, end_per_testcase/2]). +-export([all/0,groups/0,init_per_group/2,end_per_group/2, sent_timer_late_reply/1, sent_timer_exceeded/1, sent_timer_exceeded_long/1, sent_resend_late_reply/1, sent_resend_exceeded/1, sent_resend_exceeded_long/1, - - recv/1, recv_limit_exceeded1/1, recv_limit_exceeded2/1, - - tickets/1, otp_4956/1, otp_5310/1, otp_5619/1 @@ -139,45 +133,29 @@ init_per_testcase(Case, Config) -> process_flag(trap_exit, true), megaco_test_lib:init_per_testcase(Case, Config). -fin_per_testcase(Case, Config) -> +end_per_testcase(Case, Config) -> process_flag(trap_exit, false), - megaco_test_lib:fin_per_testcase(Case, Config). + megaco_test_lib:end_per_testcase(Case, Config). %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -all(suite) -> - [ - sent, - recv, - - %% Tickets last - tickets - ]. - -sent(suite) -> - [ - sent_timer_late_reply, - sent_timer_exceeded, - sent_timer_exceeded_long, - sent_resend_late_reply, - sent_resend_exceeded, - sent_resend_exceeded_long - - ]. +all() -> + [{group, sent}, {group, recv}, {group, tickets}]. -recv(suite) -> - [ - recv_limit_exceeded1, - recv_limit_exceeded2 - ]. +groups() -> + [{sent, [], + [sent_timer_late_reply, sent_timer_exceeded, + sent_timer_exceeded_long, sent_resend_late_reply, + sent_resend_exceeded, sent_resend_exceeded_long]}, + {recv, [], + [recv_limit_exceeded1, recv_limit_exceeded2]}, + {tickets, [], [otp_4956, otp_5310, otp_5619]}]. -tickets(suite) -> - [ - otp_4956, - otp_5310, - otp_5619 - ]. +init_per_group(_GroupName, Config) -> + Config. +end_per_group(_GroupName, Config) -> + Config. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%% %%% diff --git a/lib/megaco/test/megaco_profile.erl b/lib/megaco/test/megaco_profile.erl index 01fa0b5a14..d0b62610e1 100644 --- a/lib/megaco/test/megaco_profile.erl +++ b/lib/megaco/test/megaco_profile.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2008-2009. All Rights Reserved. +%% Copyright Ericsson AB 2008-2010. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in diff --git a/lib/megaco/test/megaco_sdp_test.erl b/lib/megaco/test/megaco_sdp_test.erl index e9bd550518..796a956f23 100644 --- a/lib/megaco/test/megaco_sdp_test.erl +++ b/lib/megaco/test/megaco_sdp_test.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2001-2009. All Rights Reserved. +%% Copyright Ericsson AB 2001-2010. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -24,13 +24,12 @@ -module(megaco_sdp_test). --export([all/1, +-export([all/0,groups/0,init_per_group/2,end_per_group/2, decode_encode/1, - tickets/1, otp8123/1, - init_per_testcase/2, fin_per_testcase/2, + init_per_testcase/2, end_per_testcase/2, t/0, t/1]). @@ -46,8 +45,8 @@ t(Case) -> megaco_test_lib:t({?MODULE, Case}). init_per_testcase(Case, Config) -> megaco_test_lib:init_per_testcase(Case, Config). -fin_per_testcase(Case, Config) -> - megaco_test_lib:fin_per_testcase(Case, Config). +end_per_testcase(Case, Config) -> + megaco_test_lib:end_per_testcase(Case, Config). %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% @@ -55,16 +54,19 @@ fin_per_testcase(Case, Config) -> %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -all(suite) -> - [ - decode_encode, - tickets - ]. +all() -> + [decode_encode, {group, tickets}]. + +groups() -> + [{tickets, [], [otp8123]}]. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + -tickets(suite) -> - [ - otp8123 - ]. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/lib/megaco/test/megaco_segment_test.erl b/lib/megaco/test/megaco_segment_test.erl index ef07ee54b1..e4b568119d 100644 --- a/lib/megaco/test/megaco_segment_test.erl +++ b/lib/megaco/test/megaco_segment_test.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2006-2009. All Rights Reserved. +%% Copyright Ericsson AB 2006-2010. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -24,10 +24,10 @@ -module(megaco_segment_test). -export([t/0, t/1]). --export([init_per_testcase/2, fin_per_testcase/2]). --export([all/1, +-export([init_per_testcase/2, end_per_testcase/2]). +-export([all/0,groups/0,init_per_group/2,end_per_group/2, - send/1, + send_segmented_msg_plain1/1, send_segmented_msg_plain2/1, send_segmented_msg_plain3/1, @@ -36,13 +36,11 @@ send_segmented_msg_missing_seg_reply1/1, send_segmented_msg_missing_seg_reply2/1, - recv/1, + recv_segmented_msg_plain/1, recv_segmented_msg_ooo_seg/1, recv_segmented_msg_missing_seg1/1, - recv_segmented_msg_missing_seg2/1, - - tickets/1 + recv_segmented_msg_missing_seg2/1 ]). @@ -66,45 +64,33 @@ init_per_testcase(Case, Config) -> process_flag(trap_exit, true), megaco_test_lib:init_per_testcase(Case, Config). -fin_per_testcase(Case, Config) -> +end_per_testcase(Case, Config) -> process_flag(trap_exit, false), - megaco_test_lib:fin_per_testcase(Case, Config). + megaco_test_lib:end_per_testcase(Case, Config). %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -all(suite) -> - [ - send, - recv - - %% Tickets last - %% tickets - ]. - -send(suite) -> - [ - send_segmented_msg_plain1, - send_segmented_msg_plain2, - send_segmented_msg_plain3, - send_segmented_msg_plain4, - send_segmented_msg_ooo1, - send_segmented_msg_missing_seg_reply1, - send_segmented_msg_missing_seg_reply2 - ]. - -recv(suite) -> - [ - recv_segmented_msg_plain, - recv_segmented_msg_ooo_seg, - recv_segmented_msg_missing_seg1, - recv_segmented_msg_missing_seg2 - ]. - -tickets(suite) -> - [ - ]. - +all() -> + [{group, send}, {group, recv}]. + +groups() -> + [{send, [], + [send_segmented_msg_plain1, send_segmented_msg_plain2, + send_segmented_msg_plain3, send_segmented_msg_plain4, + send_segmented_msg_ooo1, + send_segmented_msg_missing_seg_reply1, + send_segmented_msg_missing_seg_reply2]}, + {recv, [], + [recv_segmented_msg_plain, recv_segmented_msg_ooo_seg, + recv_segmented_msg_missing_seg1, + recv_segmented_msg_missing_seg2]}]. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/lib/megaco/test/megaco_tc_controller.erl b/lib/megaco/test/megaco_tc_controller.erl index dedf45e321..458bff55e8 100644 --- a/lib/megaco/test/megaco_tc_controller.erl +++ b/lib/megaco/test/megaco_tc_controller.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2006-2009. All Rights Reserved. +%% Copyright Ericsson AB 2006-2010. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in diff --git a/lib/megaco/test/megaco_tcp_test.erl b/lib/megaco/test/megaco_tcp_test.erl index 31c88489fe..013096c385 100644 --- a/lib/megaco/test/megaco_tcp_test.erl +++ b/lib/megaco/test/megaco_tcp_test.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2000-2009. All Rights Reserved. +%% Copyright Ericsson AB 2000-2010. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -36,25 +36,19 @@ %% External exports %%---------------------------------------------------------------------- -export([ - all/1, - - start/1, + all/0,groups/0,init_per_group/2,end_per_group/2, start_normal/1, start_invalid_opt/1, start_and_stop/1, - - sending/1, sendreceive/1, block_unblock/1, - - errors/1, socket_failure/1, accept_process/1, accept_supervisor/1, connection_supervisor/1, tcp_server/1, - init_per_testcase/2, fin_per_testcase/2, + init_per_testcase/2, end_per_testcase/2, t/0, t/1 ]). @@ -111,44 +105,32 @@ init_per_testcase(Case, Config) -> %%---------------------------------------------------------------------- -%% Function: fin_per_testcase/2 +%% Function: end_per_testcase/2 %% Description: %%---------------------------------------------------------------------- -fin_per_testcase(Case, Config) -> - megaco_test_lib:fin_per_testcase(Case, Config). +end_per_testcase(Case, Config) -> + megaco_test_lib:end_per_testcase(Case, Config). %%====================================================================== %% Test case definitions %%====================================================================== -all(suite) -> - [ - start, - sending, - errors - ]. - -start(suite) -> - [ - start_normal, - start_invalid_opt, - start_and_stop - ]. - -sending(suite) -> - [ - sendreceive, - block_unblock - ]. - -errors(suite) -> - [ - socket_failure, - accept_process, - accept_supervisor, - connection_supervisor, - tcp_server - ]. +all() -> + [{group, start}, {group, sending}, {group, errors}]. + +groups() -> + [{start, [], + [start_normal, start_invalid_opt, start_and_stop]}, + {sending, [], [sendreceive, block_unblock]}, + {errors, [], + [socket_failure, accept_process, accept_supervisor, + connection_supervisor, tcp_server]}]. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. %% ------------------ start ------------------------ diff --git a/lib/megaco/test/megaco_test_deliver.erl b/lib/megaco/test/megaco_test_deliver.erl index 2d0f0c1cbe..ece0a48015 100644 --- a/lib/megaco/test/megaco_test_deliver.erl +++ b/lib/megaco/test/megaco_test_deliver.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2007-2009. All Rights Reserved. +%% Copyright Ericsson AB 2007-2010. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in diff --git a/lib/megaco/test/megaco_test_generator.erl b/lib/megaco/test/megaco_test_generator.erl index 8bbc60e6cd..4fbc86262e 100644 --- a/lib/megaco/test/megaco_test_generator.erl +++ b/lib/megaco/test/megaco_test_generator.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2007-2009. All Rights Reserved. +%% Copyright Ericsson AB 2007-2011. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -26,6 +26,10 @@ -behaviour(gen_server). +-compile({no_auto_import,[error/2]}). + +%% ---- + -export([ start_link/3, start_link/4, diff --git a/lib/megaco/test/megaco_test_generator_lib.erl b/lib/megaco/test/megaco_test_generator_lib.erl index cf0dcaf722..1584605913 100644 --- a/lib/megaco/test/megaco_test_generator_lib.erl +++ b/lib/megaco/test/megaco_test_generator_lib.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2007-2009. All Rights Reserved. +%% Copyright Ericsson AB 2007-2010. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in diff --git a/lib/megaco/test/megaco_test_generic_transport.erl b/lib/megaco/test/megaco_test_generic_transport.erl index 10afa45baa..7a3dbc5317 100644 --- a/lib/megaco/test/megaco_test_generic_transport.erl +++ b/lib/megaco/test/megaco_test_generic_transport.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2007-2009. All Rights Reserved. +%% Copyright Ericsson AB 2007-2010. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in diff --git a/lib/megaco/test/megaco_test_lib.erl b/lib/megaco/test/megaco_test_lib.erl index 03c04831e8..41f6c2c4cb 100644 --- a/lib/megaco/test/megaco_test_lib.erl +++ b/lib/megaco/test/megaco_test_lib.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 1999-2009. All Rights Reserved. +%% Copyright Ericsson AB 1999-2011. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -146,28 +146,28 @@ tickets(Mod, Func, Config) -> end, lists:map(Map, Cases); - {req, _, {conf, Init, Cases, Finish}} -> - case (catch Mod:Init(Config)) of - Conf when is_list(Conf) -> - io:format("Expand: ~p:~p ...~n", [Mod, Func]), - Map = fun({M,_}) when is_atom(M) -> - tickets(M, tickets, Config); - (F) when is_atom(F) -> - tickets(Mod, F, Config); - (Case) -> Case - end, - Res = lists:map(Map, Cases), - (catch Mod:Finish(Conf)), - Res; +%% {req, _, {conf, Init, Cases, Finish}} -> +%% case (catch Mod:Init(Config)) of +%% Conf when is_list(Conf) -> +%% io:format("Expand: ~p:~p ...~n", [Mod, Func]), +%% Map = fun({M,_}) when is_atom(M) -> +%% tickets(M, tickets, Config); +%% (F) when is_atom(F) -> +%% tickets(Mod, F, Config); +%% (Case) -> Case +%% end, +%% Res = lists:map(Map, Cases), +%% (catch Mod:Finish(Conf)), +%% Res; - {'EXIT', {skipped, Reason}} -> - io:format(" => skipping: ~p~n", [Reason]), - [{skipped, {Mod, Func}, Reason}]; +%% {'EXIT', {skipped, Reason}} -> +%% io:format(" => skipping: ~p~n", [Reason]), +%% [{skipped, {Mod, Func}, Reason}]; - Error -> - io:format(" => init failed: ~p~n", [Error]), - [{failed, {Mod, Func}, Error}] - end; +%% Error -> +%% io:format(" => init failed: ~p~n", [Error]), +%% [{failed, {Mod, Func}, Error}] +%% end; {'EXIT', {undef, _}} -> io:format("Undefined: ~p~n", [{Mod, Func}]), @@ -252,6 +252,8 @@ alloc_instance_mem_info(Key, InstanceInfo) -> end. +t([Case]) when is_atom(Case) -> + t(Case); t(Case) -> process_flag(trap_exit, true), MEM = fun() -> case (catch erlang:memory()) of @@ -266,11 +268,65 @@ t(Case) -> Res = lists:flatten(t(Case, default_config())), Alloc2 = alloc_info(), Mem2 = MEM(), - %% io:format("Res: ~p~n", [Res]), display_result(Res, Alloc1, Mem1, Alloc2, Mem2), Res. -t({Mod, Fun}, Config) when is_atom(Mod) andalso is_atom(Fun) -> + +groups(Mod) when is_atom(Mod) -> + try Mod:groups() of + Groups when is_list(Groups) -> + Groups; + BadGroups -> + exit({bad_groups, Mod, BadGroups}) + catch + _:_ -> + [] + end. + +init_suite(Mod, Config) -> + Mod:init_per_suite(Config). + +end_suite(Mod, Config) -> + Mod:end_per_suite(Config). + +init_group(Mod, Group, Config) -> + Mod:init_per_group(Group, Config). + +end_group(Mod, Group, Config) -> + Mod:init_per_group(Group, Config). + +%% This is for sub-SUITEs +t({_Mod, {NewMod, all}, _Groups}, _Config) when is_atom(NewMod) -> + t(NewMod); +t({Mod, {group, Name} = Group, Groups}, Config) + when is_atom(Mod) andalso is_atom(Name) andalso is_list(Groups) -> + case lists:keysearch(Name, 1, Groups) of + {value, {Name, _Props, GroupsAndCases}} -> + try init_group(Mod, Name, Config) of + Config2 when is_list(Config2) -> + Res = [t({Mod, Case, Groups}, Config2) || + Case <- GroupsAndCases], + (catch end_group(Mod, Name, Config2)), + Res; + Error -> + io:format(" => group (~w) init failed: ~p~n", + [Name, Error]), + [{failed, {Mod, Group}, Error}] + catch + exit:{skipped, SkipReason} -> + io:format(" => skipping group: ~p~n", [SkipReason]), + [{skipped, {Mod, Group}, SkipReason, 0}]; + exit:{undef, _} -> + [t({Mod, Case, Groups}, Config) || + Case <- GroupsAndCases]; + T:E -> + [{failed, {Mod, Group}, {T,E}, 0}] + end; + false -> + exit({unknown_group, Mod, Name, Groups}) + end; +t({Mod, Fun, _}, Config) + when is_atom(Mod) andalso is_atom(Fun) -> case catch apply(Mod, Fun, [suite]) of [] -> io:format("Eval: ~p:", [{Mod, Fun}]), @@ -286,26 +342,6 @@ t({Mod, Fun}, Config) when is_atom(Mod) andalso is_atom(Fun) -> end, t(lists:map(Map, Cases), Config); - {req, _, {conf, Init, Cases, Finish}} -> - case (catch apply(Mod, Init, [Config])) of - Conf when is_list(Conf) -> - io:format("Expand: ~p ...~n", [{Mod, Fun}]), - Map = fun(Case) when is_atom(Case) -> {Mod, Case}; - (Case) -> Case - end, - Res = t(lists:map(Map, Cases), Conf), - (catch apply(Mod, Finish, [Conf])), - Res; - - {'EXIT', {skipped, Reason}} -> - io:format(" => skipping: ~p~n", [Reason]), - [{skipped, {Mod, Fun}, Reason, 0}]; - - Error -> - io:format(" => failed: ~p~n", [Error]), - [{failed, {Mod, Fun}, Error, 0}] - end; - {'EXIT', {undef, _}} -> io:format("Undefined: ~p~n", [{Mod, Fun}]), [{nyi, {Mod, Fun}, ok, 0}]; @@ -315,10 +351,38 @@ t({Mod, Fun}, Config) when is_atom(Mod) andalso is_atom(Fun) -> [{failed, {Mod, Fun}, Error, 0}] end; t(Mod, Config) when is_atom(Mod) -> - Res = t({Mod, all}, Config), - Res; -t(Cases, Config) when is_list(Cases) -> - [t(Case, Config) || Case <- Cases]; + %% This is assumed to be a test suite, so we start by calling + %% the top test suite function(s) (all/0 and groups/0). + case (catch Mod:all()) of + Cases when is_list(Cases) -> + %% The list may contain atoms (actual test cases) and + %% group-tuples (a tuple naming a group of test cases). + %% A group is defined by the (optional) groups/0 function. + Groups = groups(Mod), + try init_suite(Mod, Config) of + Config2 when is_list(Config2) -> + Res = [t({Mod, Case, Groups}, Config2) || Case <- Cases], + (catch end_suite(Mod, Config2)), + Res; + Error -> + io:format(" => suite init failed: ~p~n", [Error]), + [{failed, {Mod, init_per_suite}, Error}] + catch + exit:{skipped, SkipReason} -> + io:format(" => skipping suite: ~p~n", [SkipReason]), + [{skipped, {Mod, init_per_suite}, SkipReason, 0}]; + exit:{undef, _} -> + [t({Mod, Case, Groups}, Config) || Case <- Cases]; + T:E -> + [{failed, {Mod, init_per_suite}, {T,E}, 0}] + end; + {'EXIT', {undef, _}} -> + io:format("Undefined: ~p~n", [{Mod, all}]), + [{nyi, {Mod, all}, ok, 0}]; + + Crap -> + Crap + end; t(Bad, _Config) -> [{badarg, Bad, ok, 0}]. @@ -333,7 +397,7 @@ eval(Mod, Fun, Config) -> Config2 = Mod:init_per_testcase(Fun, Config), Pid = spawn_link(?MODULE, do_eval, [self(), Mod, Fun, Config2]), R = wait_for_evaluator(Pid, Mod, Fun, Config2, []), - Mod:fin_per_testcase(Fun, Config2), + Mod:end_per_testcase(Fun, Config2), erase(megaco_test_server), global:unregister_name(megaco_test_case_sup), process_flag(trap_exit, Flag), @@ -495,28 +559,56 @@ do_display_memory([{Key, Mem1}|MemInfo1], MemInfo2) -> display_result([]) -> io:format("OK~n", []); display_result(Res) when is_list(Res) -> - Ok = [{MF, Time} || {ok, MF, _, Time} <- Res], - Nyi = [MF || {nyi, MF, _, _Time} <- Res], - Skipped = [{MF, Reason} || {skipped, MF, Reason, _Time} <- Res], - Failed = [{MF, Reason} || {failed, MF, Reason, _Time} <- Res], - Crashed = [{MF, Reason} || {crashed, MF, Reason, _Time} <- Res], - display_summery(Ok, Nyi, Skipped, Failed, Crashed), + Ok = [{MF, Time} || {ok, MF, _, Time} <- Res], + Nyi = [MF || {nyi, MF, _, _Time} <- Res], + SkippedGrps = [{{M,G}, Reason} || + {skipped, {M, {group, G}}, Reason, _Time} <- Res], + SkippedCases = [{MF, Reason} || + {skipped, {_M, F} = MF, Reason, _Time} <- Res, + is_atom(F)], + FailedGrps = [{{M,G}, Reason} || + {failed, {M, {group, G}}, Reason, _Time} <- Res], + FailedCases = [{MF, Reason} || + {failed, {_M, F} = MF, Reason, _Time} <- Res, + is_atom(F)], + Crashed = [{MF, Reason} || {crashed, MF, Reason, _Time} <- Res], + display_summery(Ok, Nyi, + SkippedGrps, SkippedCases, + FailedGrps, FailedCases, + Crashed), display_ok(Ok), - display_skipped(Skipped), - display_failed(Failed), + display_skipped("groups", SkippedGrps), + display_skipped("test cases", SkippedCases), + display_failed("groups", FailedGrps), + display_failed("test cases", FailedCases), display_crashed(Crashed). -display_summery(Ok, Nyi, Skipped, Failed, Crashed) -> +display_summery(Ok, Nyi, + SkippedGrps, SkippedCases, + FailedGrps, FailedCases, + Crashed) -> io:format("~nTest case summery:~n", []), - display_summery(Ok, "successfull"), - display_summery(Nyi, "not yet implemented"), - display_summery(Skipped, "skipped"), - display_summery(Failed, "failed"), - display_summery(Crashed, "crashed"), + display_summery(Ok, "test case", "successfull"), + display_summery(Nyi, "test case", "not yet implemented"), + display_summery(SkippedGrps, "group", "skipped"), + display_summery(SkippedCases, "test case", "skipped"), + display_summery(FailedGrps, "group", "failed"), + display_summery(FailedCases, "test case", "failed"), + display_summery(Crashed, "test case", "crashed"), io:format("~n", []). -display_summery(Res, Info) -> - io:format(" ~w test cases ~s~n", [length(Res), Info]). + +display_summery(Res, Kind, Info) -> + Len = length(Res), + if + Len =:= 1 -> + display_summery(Len, Kind ++ " " ++ Info); + true -> + display_summery(Len, Kind ++ "s " ++ Info) + end. + +display_summery(Len, Info) -> + io:format(" ~w ~s~n", [Len, Info]). display_ok([]) -> ok; @@ -528,20 +620,20 @@ display_ok(Ok) -> lists:foreach(F, Ok), io:format("~n", []). -display_skipped([]) -> +display_skipped(_, []) -> ok; -display_skipped(Skipped) -> - io:format("Skipped test cases:~n", []), - F = fun({MF, Reason}) -> io:format(" ~p => ~p~n", [MF, Reason]) end, +display_skipped(Pre, Skipped) -> + io:format("Skipped ~s:~n", [Pre]), + F = fun({X, Reason}) -> io:format(" ~p => ~p~n", [X, Reason]) end, lists:foreach(F, Skipped), io:format("~n", []). -display_failed([]) -> +display_failed(_, []) -> ok; -display_failed(Failed) -> - io:format("Failed test cases:~n", []), - F = fun({MF, Reason}) -> io:format(" ~p => ~p~n", [MF, Reason]) end, +display_failed(Pre, Failed) -> + io:format("Failed ~s:~n", [Pre]), + F = fun({X, Reason}) -> io:format(" ~p => ~p~n", [X, Reason]) end, lists:foreach(F, Failed), io:format("~n", []). @@ -677,11 +769,11 @@ init_per_testcase(_Case, Config) -> end, set_kill_timer(Config). -fin_per_testcase(_Case, Config) -> +end_per_testcase(_Case, Config) -> Name = megaco_global_logger, case global:whereis_name(Name) of undefined -> - io:format("~w:fin_per_testcase -> already un-registered~n", + io:format("~w:end_per_testcase -> already un-registered~n", [?MODULE]), ok; Pid when is_pid(Pid) -> @@ -837,5 +929,5 @@ start_nodes([Node | Nodes], File, Line) -> start_nodes([], _File, _Line) -> ok. -p(F,A) -> - io:format("~p" ++ F ++ "~n", [self()|A]). +p(F, A) -> + io:format("~p~w:" ++ F ++ "~n", [self(), ?MODULE |A]). diff --git a/lib/megaco/test/megaco_test_megaco_generator.erl b/lib/megaco/test/megaco_test_megaco_generator.erl index 5ff7162223..f0c723d2cf 100644 --- a/lib/megaco/test/megaco_test_megaco_generator.erl +++ b/lib/megaco/test/megaco_test_megaco_generator.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2007-2009. All Rights Reserved. +%% Copyright Ericsson AB 2007-2011. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -26,6 +26,8 @@ -behaviour(megaco_test_generator). +-compile({no_auto_import,[error/1]}). + %% API -export([ start_link/1, start_link/2, diff --git a/lib/megaco/test/megaco_test_mg.erl b/lib/megaco/test/megaco_test_mg.erl index 22b65a1ac6..ecb3cedc83 100644 --- a/lib/megaco/test/megaco_test_mg.erl +++ b/lib/megaco/test/megaco_test_mg.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2003-2009. All Rights Reserved. +%% Copyright Ericsson AB 2003-2010. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in diff --git a/lib/megaco/test/megaco_test_mgc.erl b/lib/megaco/test/megaco_test_mgc.erl index 05c482f1af..13c1cebe56 100644 --- a/lib/megaco/test/megaco_test_mgc.erl +++ b/lib/megaco/test/megaco_test_mgc.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2003-2009. All Rights Reserved. +%% Copyright Ericsson AB 2003-2010. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in diff --git a/lib/megaco/test/megaco_test_msg_prev3a_lib.erl b/lib/megaco/test/megaco_test_msg_prev3a_lib.erl index 5ce2ec302b..fad7f29831 100644 --- a/lib/megaco/test/megaco_test_msg_prev3a_lib.erl +++ b/lib/megaco/test/megaco_test_msg_prev3a_lib.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2005-2009. All Rights Reserved. +%% Copyright Ericsson AB 2005-2011. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -26,6 +26,10 @@ %% ---- +-compile({no_auto_import,[error/1]}). + +%% ---- + -include_lib("megaco/include/megaco_message_prev3a.hrl"). -include_lib("megaco/include/megaco.hrl"). diff --git a/lib/megaco/test/megaco_test_msg_prev3b_lib.erl b/lib/megaco/test/megaco_test_msg_prev3b_lib.erl index be87dc9a41..2f1a093728 100644 --- a/lib/megaco/test/megaco_test_msg_prev3b_lib.erl +++ b/lib/megaco/test/megaco_test_msg_prev3b_lib.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2005-2009. All Rights Reserved. +%% Copyright Ericsson AB 2005-2011. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -26,6 +26,10 @@ %% ---- +-compile({no_auto_import,[error/1]}). + +%% ---- + -include_lib("megaco/include/megaco_message_prev3b.hrl"). -include_lib("megaco/include/megaco.hrl"). diff --git a/lib/megaco/test/megaco_test_msg_prev3c_lib.erl b/lib/megaco/test/megaco_test_msg_prev3c_lib.erl index 74a05060d0..884e2f2bad 100644 --- a/lib/megaco/test/megaco_test_msg_prev3c_lib.erl +++ b/lib/megaco/test/megaco_test_msg_prev3c_lib.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2006-2009. All Rights Reserved. +%% Copyright Ericsson AB 2006-2011. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -26,6 +26,10 @@ %% ---- +-compile({no_auto_import,[error/1]}). + +%% ---- + -include_lib("megaco/include/megaco_message_prev3c.hrl"). -include_lib("megaco/include/megaco.hrl"). diff --git a/lib/megaco/test/megaco_test_msg_v1_lib.erl b/lib/megaco/test/megaco_test_msg_v1_lib.erl index 638215e8c1..76665cb575 100644 --- a/lib/megaco/test/megaco_test_msg_v1_lib.erl +++ b/lib/megaco/test/megaco_test_msg_v1_lib.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2007-2009. All Rights Reserved. +%% Copyright Ericsson AB 2007-2011. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -28,6 +28,10 @@ %% ---- +-compile({no_auto_import,[error/1]}). + +%% ---- + -include_lib("megaco/include/megaco_message_v1.hrl"). -include_lib("megaco/include/megaco.hrl"). diff --git a/lib/megaco/test/megaco_test_msg_v2_lib.erl b/lib/megaco/test/megaco_test_msg_v2_lib.erl index b680bc869a..66e423284a 100644 --- a/lib/megaco/test/megaco_test_msg_v2_lib.erl +++ b/lib/megaco/test/megaco_test_msg_v2_lib.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2004-2009. All Rights Reserved. +%% Copyright Ericsson AB 2004-2011. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -26,6 +26,10 @@ %% ---- +-compile({no_auto_import,[error/1]}). + +%% ---- + -include_lib("megaco/include/megaco_message_v2.hrl"). -include_lib("megaco/include/megaco.hrl"). diff --git a/lib/megaco/test/megaco_test_msg_v3_lib.erl b/lib/megaco/test/megaco_test_msg_v3_lib.erl index 7b0d4f7d37..24492167ff 100644 --- a/lib/megaco/test/megaco_test_msg_v3_lib.erl +++ b/lib/megaco/test/megaco_test_msg_v3_lib.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2006-2009. All Rights Reserved. +%% Copyright Ericsson AB 2006-2011. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -26,6 +26,10 @@ %% ---- +-compile({no_auto_import,[error/1]}). + +%% ---- + -include_lib("megaco/include/megaco_message_v3.hrl"). -include_lib("megaco/include/megaco.hrl"). diff --git a/lib/megaco/test/megaco_test_tcp_generator.erl b/lib/megaco/test/megaco_test_tcp_generator.erl index e4f27f32f5..3ed4c49bab 100644 --- a/lib/megaco/test/megaco_test_tcp_generator.erl +++ b/lib/megaco/test/megaco_test_tcp_generator.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2007-2009. All Rights Reserved. +%% Copyright Ericsson AB 2007-2011. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -26,6 +26,8 @@ -behaviour(megaco_test_generator). +-compile({no_auto_import,[error/1]}). + %% API -export([ start_link/1, start_link/2, diff --git a/lib/megaco/test/megaco_timer_test.erl b/lib/megaco/test/megaco_timer_test.erl index 8bcfc5a907..9b9103c40b 100644 --- a/lib/megaco/test/megaco_timer_test.erl +++ b/lib/megaco/test/megaco_timer_test.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2007-2009. All Rights Reserved. +%% Copyright Ericsson AB 2007-2011. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -23,22 +23,17 @@ %%---------------------------------------------------------------------- -module(megaco_timer_test). +-compile({no_auto_import,[error/1]}). + -export([ t/0, t/1, - init_per_testcase/2, fin_per_testcase/2, - - all/1, - - simple/1, + init_per_testcase/2, end_per_testcase/2, + all/0,groups/0,init_per_group/2,end_per_group/2, simple_init/1, simple_usage/1, - - integer_timer/1, integer_timer_start_and_expire/1, integer_timer_start_and_stop/1%% , - %% incr_timer/1 - ]). -export([ @@ -71,49 +66,39 @@ do_init_per_testcase(Case, Config) -> {ok, _Pid} = megaco_monitor:start_link(), megaco_test_lib:init_per_testcase(Case, [{monitor_running, true}|Config]). -fin_per_testcase(Case, Config) -> - io:format("fin_per_testcase -> entry with" +end_per_testcase(Case, Config) -> + io:format("end_per_testcase -> entry with" "~n Case: ~p" "~n Config: ~p" "~n", [Case, Config]), process_flag(trap_exit, false), case lists:keydelete(monitor_running, 1, Config) of Config -> - megaco_test_lib:fin_per_testcase(Case, Config); + megaco_test_lib:end_per_testcase(Case, Config); Config2 -> megaco_monitor:stop(), - megaco_test_lib:fin_per_testcase(Case, Config2) + megaco_test_lib:end_per_testcase(Case, Config2) end. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -all(suite) -> - Cases = - [ - simple, - integer_timer%% , -%% incr_timer - ], - Cases. - - -simple(suite) -> - Cases = - [ - simple_init, - simple_usage - ], - Cases. - - -integer_timer(suite) -> - Cases = - [ - integer_timer_start_and_expire, - integer_timer_start_and_stop - ], - Cases. +all() -> + [{group, simple}, {group, integer_timer}]. + +groups() -> + [{simple, [], + [simple_init, simple_usage]}, +%, incr_timer + {integer_timer, [], + [integer_timer_start_and_expire, + integer_timer_start_and_stop]}]. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. %% incr_timer(suite) -> diff --git a/lib/megaco/test/megaco_trans_test.erl b/lib/megaco/test/megaco_trans_test.erl index 44d4b3fff7..5f564e3bf6 100644 --- a/lib/megaco/test/megaco_trans_test.erl +++ b/lib/megaco/test/megaco_trans_test.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2003-2009. All Rights Reserved. +%% Copyright Ericsson AB 2003-2010. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -95,78 +95,49 @@ init_per_testcase(Case, Config) -> process_flag(trap_exit, true), megaco_test_lib:init_per_testcase(Case, Config). -fin_per_testcase(Case, Config) -> +end_per_testcase(Case, Config) -> process_flag(trap_exit, false), - megaco_test_lib:fin_per_testcase(Case, Config). + megaco_test_lib:end_per_testcase(Case, Config). %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -all(suite) -> - [ - ack, - trans_req, - trans_req_and_ack, - pending, - reply, - - tickets - ]. - -ack(suite) -> - [ - single_ack, - multi_ack_timeout, - multi_ack_maxcount - ]. - -trans_req(suite) -> - [ - single_trans_req, - multi_trans_req_timeout, - multi_trans_req_maxcount1, - multi_trans_req_maxcount2, - multi_trans_req_maxsize1, - multi_trans_req_maxsize2 - ]. - -trans_req_and_ack(suite) -> - [ - single_trans_req_and_ack, - multi_trans_req_and_ack_timeout, - multi_trans_req_and_ack_ackmaxcount, - multi_trans_req_and_ack_reqmaxcount, - multi_trans_req_and_ack_maxsize1, - multi_trans_req_and_ack_maxsize2 - ]. - -pending(suite) -> - [ - single_trans_req_and_pending, - multi_trans_req_and_pending, - multi_trans_req_and_ack_and_pending, - multi_ack_and_pending - ]. - -reply(suite) -> - [ - multi_trans_req_and_reply, - multi_trans_req_and_ack_and_reply, - multi_ack_and_reply - ]. - -tickets(suite) -> - [ - otp_7192 - ]. - -otp_7192(suite) -> - [ - otp_7192_1, - otp_7192_2, - otp_7192_3 - ]. - +all() -> + [{group, ack}, {group, trans_req}, + {group, trans_req_and_ack}, {group, pending}, + {group, reply}, {group, tickets}]. + +groups() -> + [{ack, [], + [single_ack, multi_ack_timeout, multi_ack_maxcount]}, + {trans_req, [], + [single_trans_req, multi_trans_req_timeout, + multi_trans_req_maxcount1, multi_trans_req_maxcount2, + multi_trans_req_maxsize1, multi_trans_req_maxsize2]}, + {trans_req_and_ack, [], + [single_trans_req_and_ack, + multi_trans_req_and_ack_timeout, + multi_trans_req_and_ack_ackmaxcount, + multi_trans_req_and_ack_reqmaxcount, + multi_trans_req_and_ack_maxsize1, + multi_trans_req_and_ack_maxsize2]}, + {pending, [], + [single_trans_req_and_pending, + multi_trans_req_and_pending, + multi_trans_req_and_ack_and_pending, + multi_ack_and_pending]}, + {reply, [], + [multi_trans_req_and_reply, + multi_trans_req_and_ack_and_reply, + multi_ack_and_reply]}, + {tickets, [], [{group, otp_7192}]}, + {otp_7192, [], [otp_7192_1, otp_7192_2, otp_7192_3]}]. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/lib/megaco/test/megaco_udp_test.erl b/lib/megaco/test/megaco_udp_test.erl index 2e2f5465dd..ffbff9b762 100644 --- a/lib/megaco/test/megaco_udp_test.erl +++ b/lib/megaco/test/megaco_udp_test.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2000-2009. All Rights Reserved. +%% Copyright Ericsson AB 2000-2010. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -34,22 +34,14 @@ %% External exports %%---------------------------------------------------------------------- -export([ - all/1, - - start/1, + all/0,groups/0,init_per_group/2,end_per_group/2, start_normal/1, start_invalid_opt/1, start_and_stop/1, - - sending/1, sendreceive/1, block_unblock/1, - - errors/1, socket_failure/1, - - init_per_testcase/2, fin_per_testcase/2, - + init_per_testcase/2, end_per_testcase/2, t/0, t/1 ]). @@ -104,42 +96,31 @@ init_per_testcase(Case, Config) -> %%---------------------------------------------------------------------- -%% Function: fin_per_testcase/2 +%% Function: end_per_testcase/2 %% Description: %%---------------------------------------------------------------------- -fin_per_testcase(Case, Config) -> - megaco_test_lib:fin_per_testcase(Case, Config). +end_per_testcase(Case, Config) -> + megaco_test_lib:end_per_testcase(Case, Config). %%====================================================================== %% Test case definitions %%====================================================================== -all(suite) -> - [ - start, - sending, - errors - ]. - -start(suite) -> - [ - start_normal, - start_invalid_opt, - start_and_stop - ]. +all() -> + [{group, start}, {group, sending}, {group, errors}]. -sending(suite) -> - [ - sendreceive, - block_unblock +groups() -> + [{start, [], + [start_normal, start_invalid_opt, start_and_stop]}, + {sending, [], [sendreceive, block_unblock]}, + {errors, [], [socket_failure]}]. - ]. +init_per_group(_GroupName, Config) -> + Config. -errors(suite) -> - [ - socket_failure - ]. +end_per_group(_GroupName, Config) -> + Config. %% ================================================= diff --git a/lib/megaco/vsn.mk b/lib/megaco/vsn.mk index 9fc0e0f2fa..5f71712360 100644 --- a/lib/megaco/vsn.mk +++ b/lib/megaco/vsn.mk @@ -1,4 +1,23 @@ +#-*-makefile-*- ; force emacs to enter makefile-mode + +# %CopyrightBegin% +# +# Copyright Ericsson AB 1997-2011. All Rights Reserved. +# +# The contents of this file are subject to the Erlang Public License, +# Version 1.1, (the "License"); you may not use this file except in +# compliance with the License. You should have received a copy of the +# Erlang Public License along with this software. If not, it can be +# retrieved online at http://www.erlang.org/. +# +# Software distributed under the License is distributed on an "AS IS" +# basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See +# the License for the specific language governing rights and limitations +# under the License. +# +# %CopyrightEnd% + APPLICATION = megaco -MEGACO_VSN = 3.15 -PRE_VSN = -APP_VSN = "$(APPLICATION)-$(MEGACO_VSN)$(PRE_VSN)" +MEGACO_VSN = 3.15.1 +PRE_VSN = +APP_VSN = "$(APPLICATION)-$(MEGACO_VSN)$(PRE_VSN)" |