1: %% 2: %% %CopyrightBegin% 3: %% 4: %% Copyright Ericsson AB 1999-2011. All Rights Reserved. 5: %% 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/. 11: %% 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 15: %% under the License. 16: %% 17: %% %CopyrightEnd% 18: %% 19: -module(erl_internal_SUITE). 20: 21: -export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, 22: init_per_group/2,end_per_group/2]). 23: 24: -export([behav/1]). 25: 26: -export([init_per_testcase/2, end_per_testcase/2]). 27: 28: -include_lib("test_server/include/test_server.hrl"). 29: 30: suite() -> [{ct_hooks,[ts_install_cth]}]. 31: 32: all() -> 33: [behav]. 34: 35: groups() -> 36: []. 37: 38: init_per_suite(Config) -> 39: Config. 40: 41: end_per_suite(_Config) -> 42: ok. 43: 44: init_per_group(_GroupName, Config) -> 45: Config. 46: 47: end_per_group(_GroupName, Config) -> 48: Config. 49: 50: 51: -define(default_timeout, ?t:minutes(2)). 52: 53: init_per_testcase(_Case, Config) -> 54: ?line Dog = test_server:timetrap(?default_timeout), 55: [{watchdog, Dog}|Config]. 56: 57: end_per_testcase(_Case, Config) -> 58: Dog=?config(watchdog, Config), 59: test_server:timetrap_cancel(Dog), 60: ok. 61: 62: behav(suite) -> []; 63: behav(doc) -> 64: ["Check that the behaviour callbacks are correctly defined"]; 65: behav(_) -> 66: ?line check_behav_list([{start,2}, {stop,1}], 67: application:behaviour_info(callbacks)), 68: ?line check_behav_list([{init,1}, {handle_call,3}, {handle_cast,2}, 69: {handle_info,2}, {terminate,2}, {code_change,3}], 70: gen_server:behaviour_info(callbacks)), 71: ?line check_behav_list([{init,1}, {handle_event,3}, {handle_sync_event,4}, 72: {handle_info,3}, {terminate,3}, {code_change,4}], 73: gen_fsm:behaviour_info(callbacks)), 74: ?line check_behav_list([{init,1}, {handle_event,2}, {handle_call,2}, 75: {handle_info,2}, {terminate,2}, {code_change,3}], 76: gen_event:behaviour_info(callbacks)), 77: ?line check_behav_list( [{init,1}, {terminate,2}], 78: supervisor_bridge:behaviour_info(callbacks)), 79: ?line check_behav_list([{init,1}], 80: supervisor:behaviour_info(callbacks)), 81: ok. 82: 83: check_behav_list([], []) -> ok; 84: check_behav_list([L | L1], L2) -> 85: ?line true = lists:member(L, L2), 86: ?line L3 = lists:delete(L, L2), 87: check_behav_list(L1, L3). 88: 89: