4
%% Copyright Ericsson AB 2009-2010. All Rights Reserved.
6
%% The contents of this file are subject to the Erlang Public License,
7
%% Version 1.1, (the "License"); you may not use this file except in
8
%% compliance with the License. You should have received a copy of the
9
%% Erlang Public License along with this software. If not, it can be
10
%% retrieved online at http://www.erlang.org/.
12
%% Software distributed under the License is distributed on an "AS IS"
13
%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
14
%% the License for the specific language governing rights and limitations
19
-module(ts_if_1_SUITE).
23
-include_lib("common_test/include/ct.hrl").
25
%%--------------------------------------------------------------------
26
%% Function: suite() -> Info
28
%%--------------------------------------------------------------------
30
[{timetrap,{seconds,2}}].
32
%%--------------------------------------------------------------------
33
%% Function: init_per_suite(Config0) ->
34
%% Config1 | {skip,Reason} | {skip_and_save,Reason,Config1}
35
%% Config0 = Config1 = [tuple()]
37
%%--------------------------------------------------------------------
38
init_per_suite(Config) ->
41
%%--------------------------------------------------------------------
42
%% Function: end_per_suite(Config0) -> void() | {save_config,Config1}
43
%% Config0 = Config1 = [tuple()]
44
%%--------------------------------------------------------------------
45
end_per_suite(_Config) ->
48
%%--------------------------------------------------------------------
49
%% Function: init_per_group(GroupName, Config0) ->
50
%% Config1 | {skip,Reason} | {skip_and_save,Reason,Config1}
52
%% Config0 = Config1 = [tuple()]
54
%%--------------------------------------------------------------------
55
init_per_group(g1, _Config) ->
56
{skip,g1_got_skipped};
57
init_per_group(g3, _Config) ->
58
{skip,g3_got_skipped};
59
init_per_group(_GroupName, Config) ->
62
%%--------------------------------------------------------------------
63
%% Function: end_per_group(GroupName, Config0) ->
64
%% void() | {save_config,Config1}
66
%% Config0 = Config1 = [tuple()]
67
%%--------------------------------------------------------------------
68
end_per_group(_GroupName, _Config) ->
71
%%--------------------------------------------------------------------
72
%% Function: init_per_testcase(TestCase, Config0) ->
73
%% Config1 | {skip,Reason} | {skip_and_save,Reason,Config1}
75
%% Config0 = Config1 = [tuple()]
77
%%--------------------------------------------------------------------
78
init_per_testcase(tc1, Config) ->
81
init_per_testcase(tc8, _Config) ->
83
init_per_testcase(tc11, Config) ->
85
init_per_testcase(_TestCase, Config) ->
88
%%--------------------------------------------------------------------
89
%% Function: end_per_testcase(TestCase, Config0) ->
90
%% void() | {save_config,Config1}
92
%% Config0 = Config1 = [tuple()]
93
%%--------------------------------------------------------------------
94
end_per_testcase(tc2, Config) ->
96
end_per_testcase(tc12, Config) ->
97
ct:comment("end_per_testcase(tc12) called!"),
98
ct:pal("end_per_testcase(tc12) called!", []),
100
end_per_testcase(_TestCase, _Config) ->
103
%%--------------------------------------------------------------------
104
%% Function: groups() -> [Group]
105
%% Group = {GroupName,Properties,GroupsAndTestCases}
106
%% GroupName = atom()
107
%% Properties = [parallel | sequence | Shuffle | {RepeatType,N}]
108
%% GroupsAndTestCases = [Group | {group,GroupName} | TestCase]
110
%% Shuffle = shuffle | {shuffle,{integer(),integer(),integer()}}
111
%% RepeatType = repeat | repeat_until_all_ok | repeat_until_all_fail |
112
%% repeat_until_any_ok | repeat_until_any_fail
113
%% N = integer() | forever
114
%%--------------------------------------------------------------------
117
{g2,[parallel],[{g3,[],[gtc2]}]},
119
{seq2,[sequence],[tc4,tc5]}].
124
%%--------------------------------------------------------------------
125
%% Function: all() -> GroupsAndTestCases | {skip,Reason}
126
%% GroupsAndTestCases = [{group,GroupName} | TestCase]
127
%% GroupName = atom()
130
%%--------------------------------------------------------------------
143
exit(should_have_been_skipped).
146
exit(should_have_been_skipped).
152
exit(failed_on_purpose).
155
exit(should_have_been_skipped).
160
exit(should_have_been_skipped).
168
exit(should_have_been_skipped).
171
{skip,'tc9 skipped'}.
177
exit(should_have_been_skipped).
181
exit(should_have_been_skipped).
184
exit(should_have_been_skipped).
187
F = fun() -> ct:abort_current_testcase('stopping tc12') end,
190
exit(should_have_been_aborted).