4
%% Copyright Ericsson AB 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(timetrap_2_SUITE).
23
-include_lib("common_test/include/ct.hrl").
25
%%--------------------------------------------------------------------
26
%% Function: suite() -> Info
28
%%--------------------------------------------------------------------
30
[{timetrap,{seconds,3}},
34
%%--------------------------------------------------------------------
35
%% Function: init_per_suite(Config0) ->
36
%% Config1 | {skip,Reason} | {skip_and_save,Reason,Config1}
37
%% Config0 = Config1 = [tuple()]
39
%%--------------------------------------------------------------------
40
init_per_suite(Config) ->
43
%%--------------------------------------------------------------------
44
%% Function: end_per_suite(Config0) -> void() | {save_config,Config1}
45
%% Config0 = Config1 = [tuple()]
46
%%--------------------------------------------------------------------
47
end_per_suite(_Config) ->
50
%%--------------------------------------------------------------------
51
%% Function: init_per_group(GroupName, Config0) ->
52
%% Config1 | {skip,Reason} | {skip_and_save,Reason,Config1}
54
%% Config0 = Config1 = [tuple()]
56
%%--------------------------------------------------------------------
57
init_per_group(_GroupName, Config) ->
60
%%--------------------------------------------------------------------
61
%% Function: end_per_group(GroupName, Config0) ->
62
%% void() | {save_config,Config1}
64
%% Config0 = Config1 = [tuple()]
65
%%--------------------------------------------------------------------
66
end_per_group(_GroupName, _Config) ->
69
%%--------------------------------------------------------------------
70
%% Function: init_per_testcase(TestCase, Config0) ->
71
%% Config1 | {skip,Reason} | {skip_and_save,Reason,Config1}
73
%% Config0 = Config1 = [tuple()]
75
%%--------------------------------------------------------------------
76
init_per_testcase(tc1, Config) ->
77
ct:timetrap({seconds,1}),
80
init_per_testcase(tc3, Config) ->
81
ct:timetrap({seconds,1}),
84
init_per_testcase(_TestCase, Config) ->
87
%%--------------------------------------------------------------------
88
%% Function: end_per_testcase(TestCase, Config0) ->
89
%% void() | {save_config,Config1}
91
%% Config0 = Config1 = [tuple()]
92
%%--------------------------------------------------------------------
93
end_per_testcase(_, Config) ->
96
%%--------------------------------------------------------------------
97
%% Function: groups() -> [Group]
98
%% Group = {GroupName,Properties,GroupsAndTestCases}
100
%% Properties = [parallel | sequence | Shuffle | {RepeatType,N}]
101
%% GroupsAndTestCases = [Group | {group,GroupName} | TestCase]
103
%% Shuffle = shuffle | {shuffle,{integer(),integer(),integer()}}
104
%% RepeatType = repeat | repeat_until_all_ok | repeat_until_all_fail |
105
%% repeat_until_any_ok | repeat_until_any_fail
106
%% N = integer() | forever
107
%%--------------------------------------------------------------------
111
%%--------------------------------------------------------------------
112
%% Function: all() -> GroupsAndTestCases | {skip,Reason}
113
%% GroupsAndTestCases = [{group,GroupName} | TestCase]
114
%% GroupName = atom()
117
%%--------------------------------------------------------------------
122
N = list_to_integer(ct:get_config(multiply)),
123
ct:comment(io_lib:format("TO after ~w sec", [3*N])),
124
ct:sleep({seconds,5}),
128
N =list_to_integer( ct:get_config(multiply)),
129
ct:comment(io_lib:format("TO after ~w sec", [1*N])),
130
ct:sleep({seconds,5}),
134
N = list_to_integer(ct:get_config(multiply)),
135
ct:comment(io_lib:format("TO after ~w sec", [0.5*N])),