From 0c5481927c9b187d9f8bdb10bc12fd94f5923691 Mon Sep 17 00:00:00 2001 From: Peter Andersson Date: Tue, 6 Dec 2011 00:10:13 +0100 Subject: Change init/end_per_group/0 -> init/end_per_group/1 --- .../group_require_2_SUITE.erl | 252 +++++++++++++++++++++ .../group_require_3_SUITE.erl | 241 ++++++++++++++++++++ .../group_timetrap_2_SUITE.erl | 184 +++++++++++++++ .../group_timetrap_3_SUITE.erl | 171 ++++++++++++++ 4 files changed, 848 insertions(+) create mode 100644 lib/common_test/test/ct_group_info_SUITE_data/group_require_2_SUITE.erl create mode 100644 lib/common_test/test/ct_group_info_SUITE_data/group_require_3_SUITE.erl create mode 100644 lib/common_test/test/ct_group_info_SUITE_data/group_timetrap_2_SUITE.erl create mode 100644 lib/common_test/test/ct_group_info_SUITE_data/group_timetrap_3_SUITE.erl (limited to 'lib/common_test/test/ct_group_info_SUITE_data') diff --git a/lib/common_test/test/ct_group_info_SUITE_data/group_require_2_SUITE.erl b/lib/common_test/test/ct_group_info_SUITE_data/group_require_2_SUITE.erl new file mode 100644 index 0000000000..adb53ff564 --- /dev/null +++ b/lib/common_test/test/ct_group_info_SUITE_data/group_require_2_SUITE.erl @@ -0,0 +1,252 @@ +%% +%% %CopyrightBegin% +%% +%% Copyright Ericsson AB 2009-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% +%% +-module(group_require_2_SUITE). + +-compile(export_all). + +-include_lib("common_test/include/ct.hrl"). + + +%%%----------------------------------------------------------------- +%%% CONFIG FUNCS +%%%----------------------------------------------------------------- + +init_per_group(G, Config) -> + GrProps = proplists:get_value(tc_group_properties, Config), + _GrProps1 = proplists:delete(name, GrProps), + Info = case catch group(G) of {'EXIT',_} -> []; I -> I end, + ct:comment(io_lib:format("init( ~w ): ~p", [G, Info])), + if Info /= [] -> verify_cfg(G); true -> ok end, + Config. + +end_per_group(G, Config) -> + GrProps = proplists:get_value(tc_group_properties, Config), + _GrProps1 = proplists:delete(name, GrProps), + Info = case catch group(G) of {'EXIT',_} -> []; I -> I end, + ct:comment(io_lib:format("end( ~w )", [G])), + if Info /= [] -> verify_cfg(G); true -> ok end, + ok. + +init_per_testcase(t101, Config) -> + Config; +init_per_testcase(t111, Config) -> + Config; +init_per_testcase(TestCase, Config) -> + GrProps = proplists:get_value(tc_group_properties, Config), + GrProps1 = if GrProps == undefined -> []; true -> GrProps end, + verify_cfg(proplists:get_value(name, GrProps1)), + if TestCase == t72 -> verify_cfg(TestCase); true -> ok end, + Info = case catch apply(?MODULE,TestCase,[]) of + {'EXIT',_} -> []; + I -> I + end, + ct:comment(io_lib:format("init( ~w ): ~p", [TestCase, Info])), + Config. + +end_per_testcase(t101, Config) -> + ok; +end_per_testcase(t111, Config) -> + ok; +end_per_testcase(TestCase, Config) -> + GrProps = proplists:get_value(tc_group_properties, Config), + GrProps1 = if GrProps == undefined -> []; true -> GrProps end, + verify_cfg(proplists:get_value(name, GrProps1)), + if TestCase == t72 -> verify_cfg(TestCase); true -> ok end, + ok. + +verify_cfg(undefined) -> + ok; +verify_cfg(Name) -> + Key = list_to_atom(atom_to_list(Name) ++ "_cfg"), + Alias = list_to_atom(atom_to_list(Name) ++ "_cfg_alias"), + Val = list_to_atom(atom_to_list(Name) ++ "_cfg_val"), + ct:pal("Reading ~p & ~p. Expecting ~p.", [Key,Alias,Val]), + Val = ct:get_config(Key), + Val = ct:get_config(Alias), + suite_cfg_val = ct:get_config(suite_cfg), + suite_cfg_val = ct:get_config(suite_cfg_alias). + + + +%%%------------------------------------------------------------------ +%%% TEST DECLARATIONS +%%%------------------------------------------------------------------ + +groups() -> + [{g1,[],[t11]}, + {g2,[],[t21]}, + {g3,[],[t31]}, + {g4,[],[t41]}, + + {g5,[],[{group,g6},t51,{group,g7}]}, + + {g6,[],[t61]}, + {g7,[],[t71,t72]}, + + {g8,[],[t81]}, + {g9,[],[t91]}, + {g10,[],[t101]}, + {g11,[],[t111]} + ]. + + +all() -> + [t1, + {group,g1}, + {group,g2}, + {group,g3}, + {group,g4}, + {group,g5}, + {group,g8}, + {group,g9}, + {group,g10}, + {group,g11} + ]. + +%%%----------------------------------------------------------------- +%%% INFO FUNCS +%%%----------------------------------------------------------------- + +suite() -> [{require,suite_cfg}, + {require,suite_cfg_alias,suite_cfg}, + {require,common1}, + {default_config,suite_cfg,suite_cfg_val}, + {default_config,common1,common1_val}]. + +group(g1) -> [{require,g1_cfg}, + {require,g1_cfg_alias,g1_cfg}, + {default_config,g1_cfg,g1_cfg_val}]; + +group(g2) -> [{require,g2_cfg}, + {require,g2_cfg_alias,g2_cfg}, + {require,common1}, + {require,common2}, + {default_config,g2_cfg,g2_cfg_val}, + {default_config,common1,common1_val}, + {default_config,common2,common2_val}]; + +group(g3) -> [{require,g3_cfg}, + {require,g3_cfg_alias,g3_cfg}, + {require,common2}, + {require,common2_alias,common2}, + {default_config,g3_cfg,g3_cfg_val}, + {default_config,common2,common2_val}]; + +group(g4) -> [{require,g4_cfg}, + {require,g4_cfg_alias,g4_cfg}, + {require,common2_alias,common3}, + {default_config,g4_cfg,g4_cfg_val}]; + +group(g5) -> [{require,g5_cfg}, + {require,g5_cfg_alias,g5_cfg}, + {default_config,g5_cfg,g5_cfg_val}]; + +group(g6) -> [{require,g6_cfg}, + {require,g6_cfg_alias,g6_cfg}, + {default_config,g6_cfg,g6_cfg_val}]; + +group(g7) -> [{require,g7_cfg}, + {require,g7_cfg_alias,g7_cfg}, + {default_config,g7_cfg,g7_cfg_val}]; + +group(g8) -> [{require,non_existing}]; + +group(g9) -> [{require,g9_cfg}, + {require,g9_cfg_alias,g9_cfg}, + {default_config,g9_cfg,g9_cfg_val}]; + +group(G) when G /= g11 -> []. + +t72() -> [{require,t72_cfg}, + {require,t72_cfg_alias,t72_cfg}, + {default_config,t72_cfg,t72_cfg_val}]. + +t91() -> [{require,non_existing}]. + + +%%%------------------------------------------------------------------ +%%% TEST CASES +%%%------------------------------------------------------------------ + +t1(_) -> + suite_cfg_val = ct:get_config(suite_cfg). + +t11(_) -> + suite_cfg_val = ct:get_config(suite_cfg), + suite_cfg_val = ct:get_config(suite_cfg_alias), + g1_cfg_val = ct:get_config(g1_cfg), + g1_cfg_val = ct:get_config(g1_cfg_alias). + +t21(_) -> + suite_cfg_val = ct:get_config(suite_cfg), + g2_cfg_val = ct:get_config(g2_cfg), + g2_cfg_val = ct:get_config(g2_cfg_alias), + common1_val = ct:get_config(common1), + common2_val = ct:get_config(common2). + +t31(_) -> + suite_cfg_val = ct:get_config(suite_cfg), + g3_cfg_val = ct:get_config(g3_cfg), + g3_cfg_val = ct:get_config(g3_cfg_alias), + common2_val = ct:get_config(common2), + common2_val = ct:get_config(common2_alias). + +t41(_) -> + exit(should_be_skipped). + +t51(_) -> + suite_cfg_val = ct:get_config(suite_cfg), + g5_cfg_val = ct:get_config(g5_cfg), + g5_cfg_val = ct:get_config(g5_cfg_alias). + +t61(_) -> + suite_cfg_val = ct:get_config(suite_cfg), + g5_cfg_val = ct:get_config(g5_cfg), + g5_cfg_val = ct:get_config(g5_cfg_alias), + g6_cfg_val = ct:get_config(g6_cfg), + g6_cfg_val = ct:get_config(g6_cfg_alias). + +t71(_) -> + suite_cfg_val = ct:get_config(suite_cfg), + g5_cfg_val = ct:get_config(g5_cfg), + g5_cfg_val = ct:get_config(g5_cfg_alias), + g7_cfg_val = ct:get_config(g7_cfg), + g7_cfg_val = ct:get_config(g7_cfg_alias). + +t72(_) -> + suite_cfg_val = ct:get_config(suite_cfg), + g5_cfg_val = ct:get_config(g5_cfg), + g5_cfg_val = ct:get_config(g5_cfg_alias), + g7_cfg_val = ct:get_config(g7_cfg), + g7_cfg_val = ct:get_config(g7_cfg_alias), + t72_cfg_val = ct:get_config(t72_cfg). + +t81(_) -> + exit(should_be_skipped). + +t91(_) -> + exit(should_be_skipped). + +t101(_) -> + suite_cfg_val = ct:get_config(suite_cfg). + +t111(_) -> + suite_cfg_val = ct:get_config(suite_cfg). + + diff --git a/lib/common_test/test/ct_group_info_SUITE_data/group_require_3_SUITE.erl b/lib/common_test/test/ct_group_info_SUITE_data/group_require_3_SUITE.erl new file mode 100644 index 0000000000..1f2dfd2a30 --- /dev/null +++ b/lib/common_test/test/ct_group_info_SUITE_data/group_require_3_SUITE.erl @@ -0,0 +1,241 @@ +%% +%% %CopyrightBegin% +%% +%% Copyright Ericsson AB 2009-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% +%% +-module(group_require_3_SUITE). + +-compile(export_all). + +-include_lib("common_test/include/ct.hrl"). + + +%%%----------------------------------------------------------------- +%%% CONFIG FUNCS +%%%----------------------------------------------------------------- + +%% init_per_suite(Config) -> +%% Config. +%% end_per_suite(_) -> +%% ok. + +init_per_testcase(t101, Config) -> + Config; +init_per_testcase(t111, Config) -> + Config; +init_per_testcase(TestCase, Config) -> + GrProps = proplists:get_value(tc_group_properties, Config), + GrProps1 = if GrProps == undefined -> []; true -> GrProps end, + verify_cfg(proplists:get_value(name, GrProps1)), + if TestCase == t72 -> verify_cfg(TestCase); true -> ok end, + Info = case catch apply(?MODULE,TestCase,[]) of + {'EXIT',_} -> []; + I -> I + end, + ct:comment(io_lib:format("init( ~w ): ~p", [TestCase, Info])), + Config. + +end_per_testcase(t101, _Config) -> + ok; +end_per_testcase(t111, _Config) -> + ok; +end_per_testcase(TestCase, Config) -> + GrProps = proplists:get_value(tc_group_properties, Config), + GrProps1 = if GrProps == undefined -> []; true -> GrProps end, + verify_cfg(proplists:get_value(name, GrProps1)), + if TestCase == t72 -> verify_cfg(TestCase); true -> ok end, + ok. + +verify_cfg(undefined) -> + ok; +verify_cfg(Name) -> + Key = list_to_atom(atom_to_list(Name) ++ "_cfg"), + Alias = list_to_atom(atom_to_list(Name) ++ "_cfg_alias"), + Val = list_to_atom(atom_to_list(Name) ++ "_cfg_val"), + ct:pal("Reading ~p & ~p. Expecting ~p.", [Key,Alias,Val]), + Val = ct:get_config(Key), + Val = ct:get_config(Alias), + suite_cfg_val = ct:get_config(suite_cfg), + suite_cfg_val = ct:get_config(suite_cfg_alias). + + + +%%%------------------------------------------------------------------ +%%% TEST DECLARATIONS +%%%------------------------------------------------------------------ + +groups() -> + [{g1,[],[t11]}, + {g2,[],[t21]}, + {g3,[],[t31]}, + {g4,[],[t41]}, + + {g5,[],[{group,g6},t51,{group,g7}]}, + + {g6,[],[t61]}, + {g7,[],[t71,t72]}, + + {g8,[],[t81]}, + {g9,[],[t91]}, + {g10,[],[t101]}, + {g11,[],[t111]} + ]. + + +all() -> + [t1, + {group,g1}, + {group,g2}, + {group,g3}, + {group,g4}, + {group,g5}, + {group,g8}, + {group,g9}, + {group,g10}, + {group,g11} + ]. + +%%%----------------------------------------------------------------- +%%% INFO FUNCS +%%%----------------------------------------------------------------- + +suite() -> [{require,suite_cfg}, + {require,suite_cfg_alias,suite_cfg}, + {require,common1}, + {default_config,suite_cfg,suite_cfg_val}, + {default_config,common1,common1_val}]. + +group(g1) -> [{require,g1_cfg}, + {require,g1_cfg_alias,g1_cfg}, + {default_config,g1_cfg,g1_cfg_val}]; + +group(g2) -> [{require,g2_cfg}, + {require,g2_cfg_alias,g2_cfg}, + {require,common1}, + {require,common2}, + {default_config,g2_cfg,g2_cfg_val}, + {default_config,common1,common1_val}, + {default_config,common2,common2_val}]; + +group(g3) -> [{require,g3_cfg}, + {require,g3_cfg_alias,g3_cfg}, + {require,common2}, + {require,common2_alias,common2}, + {default_config,g3_cfg,g3_cfg_val}, + {default_config,common2,common2_val}]; + +group(g4) -> [{require,g4_cfg}, + {require,g4_cfg_alias,g4_cfg}, + {require,common2_alias,common3}, + {default_config,g4_cfg,g4_cfg_val}]; + +group(g5) -> [{require,g5_cfg}, + {require,g5_cfg_alias,g5_cfg}, + {default_config,g5_cfg,g5_cfg_val}]; + +group(g6) -> [{require,g6_cfg}, + {require,g6_cfg_alias,g6_cfg}, + {default_config,g6_cfg,g6_cfg_val}]; + +group(g7) -> [{require,g7_cfg}, + {require,g7_cfg_alias,g7_cfg}, + {default_config,g7_cfg,g7_cfg_val}]; + +group(g8) -> [{require,non_existing}]; + +group(g9) -> [{require,g9_cfg}, + {require,g9_cfg_alias,g9_cfg}, + {default_config,g9_cfg,g9_cfg_val}]; + +group(G) when G /= g11 -> []. + +t72() -> [{require,t72_cfg}, + {require,t72_cfg_alias,t72_cfg}, + {default_config,t72_cfg,t72_cfg_val}]. + +t91() -> [{require,non_existing}]. + + +%%%------------------------------------------------------------------ +%%% TEST CASES +%%%------------------------------------------------------------------ + +t1(_) -> + suite_cfg_val = ct:get_config(suite_cfg). + +t11(_) -> + suite_cfg_val = ct:get_config(suite_cfg), + suite_cfg_val = ct:get_config(suite_cfg_alias), + g1_cfg_val = ct:get_config(g1_cfg), + g1_cfg_val = ct:get_config(g1_cfg_alias). + +t21(_) -> + suite_cfg_val = ct:get_config(suite_cfg), + g2_cfg_val = ct:get_config(g2_cfg), + g2_cfg_val = ct:get_config(g2_cfg_alias), + common1_val = ct:get_config(common1), + common2_val = ct:get_config(common2). + +t31(_) -> + suite_cfg_val = ct:get_config(suite_cfg), + g3_cfg_val = ct:get_config(g3_cfg), + g3_cfg_val = ct:get_config(g3_cfg_alias), + common2_val = ct:get_config(common2), + common2_val = ct:get_config(common2_alias). + +t41(_) -> + exit(should_be_skipped). + +t51(_) -> + suite_cfg_val = ct:get_config(suite_cfg), + g5_cfg_val = ct:get_config(g5_cfg), + g5_cfg_val = ct:get_config(g5_cfg_alias). + +t61(_) -> + suite_cfg_val = ct:get_config(suite_cfg), + g5_cfg_val = ct:get_config(g5_cfg), + g5_cfg_val = ct:get_config(g5_cfg_alias), + g6_cfg_val = ct:get_config(g6_cfg), + g6_cfg_val = ct:get_config(g6_cfg_alias). + +t71(_) -> + suite_cfg_val = ct:get_config(suite_cfg), + g5_cfg_val = ct:get_config(g5_cfg), + g5_cfg_val = ct:get_config(g5_cfg_alias), + g7_cfg_val = ct:get_config(g7_cfg), + g7_cfg_val = ct:get_config(g7_cfg_alias). + +t72(_) -> + suite_cfg_val = ct:get_config(suite_cfg), + g5_cfg_val = ct:get_config(g5_cfg), + g5_cfg_val = ct:get_config(g5_cfg_alias), + g7_cfg_val = ct:get_config(g7_cfg), + g7_cfg_val = ct:get_config(g7_cfg_alias), + t72_cfg_val = ct:get_config(t72_cfg). + +t81(_) -> + exit(should_be_skipped). + +t91(_) -> + exit(should_be_skipped). + +t101(_) -> + suite_cfg_val = ct:get_config(suite_cfg). + +t111(_) -> + suite_cfg_val = ct:get_config(suite_cfg). + + diff --git a/lib/common_test/test/ct_group_info_SUITE_data/group_timetrap_2_SUITE.erl b/lib/common_test/test/ct_group_info_SUITE_data/group_timetrap_2_SUITE.erl new file mode 100644 index 0000000000..1ebe8bd510 --- /dev/null +++ b/lib/common_test/test/ct_group_info_SUITE_data/group_timetrap_2_SUITE.erl @@ -0,0 +1,184 @@ +%% +%% %CopyrightBegin% +%% +%% Copyright Ericsson AB 2009-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% +%% +-module(group_timetrap_2_SUITE). + +-compile(export_all). + +-include_lib("common_test/include/ct.hrl"). + + +%%%----------------------------------------------------------------- +%%% CONFIG FUNCS +%%%----------------------------------------------------------------- + +init_per_group(G, Config) -> + GrProps = proplists:get_value(tc_group_properties, Config), + _GrProps1 = proplists:delete(name, GrProps), + Info = case catch group(G) of {'EXIT',_} -> []; I -> I end, + ct:comment(io_lib:format("init( ~w ): ~p", [G, Info])), + Config. + +end_per_group(G, Config) -> + GrProps = proplists:get_value(tc_group_properties, Config), + _GrProps1 = proplists:delete(name, GrProps), + ct:comment(io_lib:format("end( ~w )", [G])), + ok. + +init_per_testcase(TestCase, Config) -> + Info = case catch apply(?MODULE,TestCase,[]) of + {'EXIT',_} -> []; + I -> I + end, + ct:comment(io_lib:format("init( ~w ): ~p", [TestCase, Info])), + Config. + +end_per_testcase(_TestCase, _Config) -> + ok. + +%%%------------------------------------------------------------------ +%%% TEST DECLARATIONS +%%%------------------------------------------------------------------ + +groups() -> + [{g1,[],[t11]}, + {g2,[],[t21]}, + {g3,[],[{group,g4},t31,{group,g5}]}, + + {g4,[],[t41]}, + {g5,[],[t51]}, + + {g6,[],[t61]}, + {g7,[],[{group,g8},t71,{group,g9}]}, + + {g8,[],[t81]}, + {g9,[],[t91]}, + + {g10,[],[t101]}, + {g11,[],[t111]} + ]. + + +all() -> + [t1, + {group,g1}, + {group,g2}, + t2, + {group,g3}, + t3, + {group,g6}, + {group,g7}, + {group,g10}, + {group,g11} + ]. + +%%%----------------------------------------------------------------- +%%% INFO FUNCS +%%%----------------------------------------------------------------- + +suite() -> [{timetrap,1000}]. + +group(g1) -> [{timetrap,500}]; + +group(g2) -> [{timetrap,1500}]; + +group(g3) -> [{timetrap,500}]; + +group(g4) -> [{timetrap,250}]; + +group(g5) -> [{timetrap,1500}]; + +group(g6) -> [{timetrap,250}]; + +group(g7) -> [{timetrap,250}]; + +group(g8) -> [{timetrap,250}]; + +group(G) when G /= g11 -> []. + +t3() -> [{timetrap,250}]. + +t61() -> [{timetrap,500}]. + +t71() -> [{timetrap,500}]. + +t81() -> [{timetrap,750}]. + +t91() -> [{timetrap,250}]. + +%%%------------------------------------------------------------------ +%%% TEST CASES +%%%------------------------------------------------------------------ + +t1(_) -> + ct:sleep(3000), + exit(should_timeout). + +t11(_) -> + ct:sleep(750), + exit(should_timeout). + +t21(_) -> + ct:sleep(3000), + exit(should_timeout). + +t2(_) -> + ct:sleep(1250), + exit(should_timeout). + +t31(_) -> + ct:sleep(750), + exit(should_timeout). + +t41(_) -> + ct:sleep(350), + exit(should_timeout). + +t51(_) -> + ct:sleep(2000), + exit(should_timeout). + +t3(_) -> + ct:sleep(500), + exit(should_timeout). + +t61(_) -> + ct:sleep(750), + exit(should_timeout). + +t71(_) -> + ct:sleep(750), + exit(should_timeout). + +t81(_) -> + ct:sleep(1000), + exit(should_timeout). + +t91(_) -> + ct:sleep(350), + exit(should_timeout). + +t101(_) -> + ct:sleep(1500), + exit(should_timeout). + +t111(_) -> + ct:sleep(1500), + exit(should_timeout). + + diff --git a/lib/common_test/test/ct_group_info_SUITE_data/group_timetrap_3_SUITE.erl b/lib/common_test/test/ct_group_info_SUITE_data/group_timetrap_3_SUITE.erl new file mode 100644 index 0000000000..66d29802e2 --- /dev/null +++ b/lib/common_test/test/ct_group_info_SUITE_data/group_timetrap_3_SUITE.erl @@ -0,0 +1,171 @@ +%% +%% %CopyrightBegin% +%% +%% Copyright Ericsson AB 2009-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% +%% +-module(group_timetrap_3_SUITE). + +-compile(export_all). + +-include_lib("common_test/include/ct.hrl"). + + +%%%----------------------------------------------------------------- +%%% CONFIG FUNCS +%%%----------------------------------------------------------------- + +init_per_testcase(TestCase, Config) -> + Info = case catch apply(?MODULE,TestCase,[]) of + {'EXIT',_} -> []; + I -> I + end, + ct:comment(io_lib:format("init( ~w ): ~p", [TestCase, Info])), + Config. + +end_per_testcase(_TestCase, _Config) -> + ok. + +%%%------------------------------------------------------------------ +%%% TEST DECLARATIONS +%%%------------------------------------------------------------------ + +groups() -> + [{g1,[],[t11]}, + {g2,[],[t21]}, + {g3,[],[{group,g4},t31,{group,g5}]}, + + {g4,[],[t41]}, + {g5,[],[t51]}, + + {g6,[],[t61]}, + {g7,[],[{group,g8},t71,{group,g9}]}, + + {g8,[],[t81]}, + {g9,[],[t91]}, + + {g10,[],[t101]}, + {g11,[],[t111]} + ]. + + +all() -> + [t1, + {group,g1}, + {group,g2}, + t2, + {group,g3}, + t3, + {group,g6}, + {group,g7}, + {group,g10}, + {group,g11} + ]. + +%%%----------------------------------------------------------------- +%%% INFO FUNCS +%%%----------------------------------------------------------------- + +suite() -> [{timetrap,1000}]. + +group(g1) -> [{timetrap,500}]; + +group(g2) -> [{timetrap,1500}]; + +group(g3) -> [{timetrap,500}]; + +group(g4) -> [{timetrap,250}]; + +group(g5) -> [{timetrap,1500}]; + +group(g6) -> [{timetrap,250}]; + +group(g7) -> [{timetrap,250}]; + +group(g8) -> [{timetrap,250}]; + +group(G) when G /= g11 -> []. + +t3() -> [{timetrap,250}]. + +t61() -> [{timetrap,500}]. + +t71() -> [{timetrap,500}]. + +t81() -> [{timetrap,750}]. + +t91() -> [{timetrap,250}]. + +%%%------------------------------------------------------------------ +%%% TEST CASES +%%%------------------------------------------------------------------ + +t1(_) -> + ct:sleep(3000), + exit(should_timeout). + +t11(_) -> + ct:sleep(750), + exit(should_timeout). + +t21(_) -> + ct:sleep(3000), + exit(should_timeout). + +t2(_) -> + ct:sleep(1250), + exit(should_timeout). + +t31(_) -> + ct:sleep(750), + exit(should_timeout). + +t41(_) -> + ct:sleep(350), + exit(should_timeout). + +t51(_) -> + ct:sleep(2000), + exit(should_timeout). + +t3(_) -> + ct:sleep(500), + exit(should_timeout). + +t61(_) -> + ct:sleep(750), + exit(should_timeout). + +t71(_) -> + ct:sleep(750), + exit(should_timeout). + +t81(_) -> + ct:sleep(1000), + exit(should_timeout). + +t91(_) -> + ct:sleep(350), + exit(should_timeout). + +t101(_) -> + ct:sleep(1500), + exit(should_timeout). + +t111(_) -> + ct:sleep(1500), + exit(should_timeout). + + -- cgit v1.2.3