diff options
author | Erlang/OTP <[email protected]> | 2009-11-20 14:54:40 +0000 |
---|---|---|
committer | Erlang/OTP <[email protected]> | 2009-11-20 14:54:40 +0000 |
commit | 84adefa331c4159d432d22840663c38f155cd4c1 (patch) | |
tree | bff9a9c66adda4df2106dfd0e5c053ab182a12bd /lib/kernel/test/application_SUITE_data | |
download | otp-84adefa331c4159d432d22840663c38f155cd4c1.tar.gz otp-84adefa331c4159d432d22840663c38f155cd4c1.tar.bz2 otp-84adefa331c4159d432d22840663c38f155cd4c1.zip |
The R13B03 release.OTP_R13B03
Diffstat (limited to 'lib/kernel/test/application_SUITE_data')
10 files changed, 291 insertions, 0 deletions
diff --git a/lib/kernel/test/application_SUITE_data/Makefile.src b/lib/kernel/test/application_SUITE_data/Makefile.src new file mode 100644 index 0000000000..a237f6badb --- /dev/null +++ b/lib/kernel/test/application_SUITE_data/Makefile.src @@ -0,0 +1,24 @@ +EFLAGS=+debug_info + +all: app_start_error.@EMULATOR@ trans_abnormal_sup.@EMULATOR@ \ + trans_normal_sup.@EMULATOR@ transient.@EMULATOR@ \ + group_leader_sup.@EMULATOR@ group_leader.@EMULATOR@ + +app_start_error.@EMULATOR@: app_start_error.erl + erlc $(EFLAGS) app_start_error.erl + +trans_abnormal_sup.@EMULATOR@: trans_abnormal_sup.erl + erlc $(EFLAGS) trans_abnormal_sup.erl + +trans_normal_sup.@EMULATOR@: trans_normal_sup.erl + erlc $(EFLAGS) trans_normal_sup.erl + +transient.@EMULATOR@: transient.erl + erlc $(EFLAGS) transient.erl + +group_leader.@EMULATOR@: group_leader.erl + erlc $(EFLAGS) group_leader.erl + +group_leader_sup.@EMULATOR@: group_leader_sup.erl + erlc $(EFLAGS) group_leader_sup.erl + diff --git a/lib/kernel/test/application_SUITE_data/app_start_error.erl b/lib/kernel/test/application_SUITE_data/app_start_error.erl new file mode 100644 index 0000000000..cfe3508eb3 --- /dev/null +++ b/lib/kernel/test/application_SUITE_data/app_start_error.erl @@ -0,0 +1,35 @@ +%% +%% %CopyrightBegin% +%% +%% Copyright Ericsson AB 1998-2009. 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(app_start_error). + +%%-compile(export_all). +%%-export([Function/Arity, ...]). + + +-export([start/2, + init/0]). + +start(_,_) -> + Pid = spawn_link(m, foo, []), + {error, 'start error'}. + +init() -> + exit(normal). + diff --git a/lib/kernel/test/application_SUITE_data/group_leader.erl b/lib/kernel/test/application_SUITE_data/group_leader.erl new file mode 100644 index 0000000000..08c5b43808 --- /dev/null +++ b/lib/kernel/test/application_SUITE_data/group_leader.erl @@ -0,0 +1,61 @@ +%% +%% %CopyrightBegin% +%% +%% Copyright Ericsson AB 2005-2009. 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_leader). +-behaviour(gen_server). + +%% External exports +-export([start_link/0, code_change/3]). + +%% Internal exports +-export([init/1, handle_call/3, handle_cast/2, handle_info/2, terminate/2]). + +start_link() -> gen_server:start_link({local,aa}, ?MODULE, [], []). + +%%----------------------------------------------------------------- +%% Callback functions from gen_server +%%----------------------------------------------------------------- +init([]) -> + Self = self(), + Pid = spawn(fun() -> stupid_child(Self) end) , + receive {Pid, registration_done} -> ok end, + process_flag(trap_exit, true), + {ok,state}. + +handle_call(transient, _From, State) -> + X = application:get_all_env(transient), + {reply,X,State}. + +handle_cast(transient, State) -> + {noreply, State}. + +handle_info(_, State) -> + {noreply, State}. + +terminate(_Reason, _State) -> + ok. + +code_change(_OldVsn, State, _Extra) -> + {ok, State}. + +stupid_child(Parent) -> + register(nisse, self()), + Parent ! {self(), registration_done}, + receive + _Msg -> ok + end. diff --git a/lib/kernel/test/application_SUITE_data/group_leader_sup.erl b/lib/kernel/test/application_SUITE_data/group_leader_sup.erl new file mode 100644 index 0000000000..04bb0538fe --- /dev/null +++ b/lib/kernel/test/application_SUITE_data/group_leader_sup.erl @@ -0,0 +1,37 @@ +%% +%% %CopyrightBegin% +%% +%% Copyright Ericsson AB 2005-2009. 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_leader_sup). + +-behaviour(supervisor). + +%% External exports +-export([start/2]). + +%% Internal exports +-export([init/1]). + +start(_, _) -> + supervisor:start_link(group_leader_sup, []). + +init([]) -> + SupFlags = {one_for_one,4,3600}, + Config = {group_leader, + {group_leader,start_link,[]}, + temporary,4000,worker,[group_leader]}, + {ok,{SupFlags,[Config]}}. diff --git a/lib/kernel/test/application_SUITE_data/subdir/t3.config b/lib/kernel/test/application_SUITE_data/subdir/t3.config new file mode 100644 index 0000000000..b7445eacfe --- /dev/null +++ b/lib/kernel/test/application_SUITE_data/subdir/t3.config @@ -0,0 +1 @@ +[{stdlib, [{par5,t3},{par6,t3}]}]. diff --git a/lib/kernel/test/application_SUITE_data/t1.config b/lib/kernel/test/application_SUITE_data/t1.config new file mode 100644 index 0000000000..32838ee6a7 --- /dev/null +++ b/lib/kernel/test/application_SUITE_data/t1.config @@ -0,0 +1,2 @@ +[{stdlib, [{par2,t1},{par3,t1}]}, + {kernel, [{kpar1,kval1}]}]. diff --git a/lib/kernel/test/application_SUITE_data/t2.config b/lib/kernel/test/application_SUITE_data/t2.config new file mode 100644 index 0000000000..953bb6477b --- /dev/null +++ b/lib/kernel/test/application_SUITE_data/t2.config @@ -0,0 +1,2 @@ +%% Intentionally no NL after the line following to make sure it works (OTP-5543). +[{stdlib, [{par4,t2}]}].
\ No newline at end of file diff --git a/lib/kernel/test/application_SUITE_data/trans_abnormal_sup.erl b/lib/kernel/test/application_SUITE_data/trans_abnormal_sup.erl new file mode 100644 index 0000000000..d060347aff --- /dev/null +++ b/lib/kernel/test/application_SUITE_data/trans_abnormal_sup.erl @@ -0,0 +1,39 @@ +%% +%% %CopyrightBegin% +%% +%% Copyright Ericsson AB 1998-2009. 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(trans_abnormal_sup). + + +-behaviour(supervisor). + +%% External exports +-export([start/2]). + +%% Internal exports +-export([init/1]). + +start(_, _) -> + supervisor:start_link({local, trans_abnormal_sup}, trans_abnormal_sup, []), + exit(abnormal). + +init([]) -> + SupFlags = {one_for_one, 4, 3600}, + Config = {transient, + {transient, start_link, []}, + transient, 2000, worker, [transient]}, + {ok, {SupFlags, [Config]}}. diff --git a/lib/kernel/test/application_SUITE_data/trans_normal_sup.erl b/lib/kernel/test/application_SUITE_data/trans_normal_sup.erl new file mode 100644 index 0000000000..48eb52ddcf --- /dev/null +++ b/lib/kernel/test/application_SUITE_data/trans_normal_sup.erl @@ -0,0 +1,38 @@ +%% +%% %CopyrightBegin% +%% +%% Copyright Ericsson AB 1998-2009. 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(trans_normal_sup). + +-behaviour(supervisor). + +%% External exports +-export([start/2]). + +%% Internal exports +-export([init/1]). + +start(_, _) -> + supervisor:start_link({local, trans_normal_sup}, trans_normal_sup, []), + exit(normal). + +init([]) -> + SupFlags = {one_for_one, 4, 3600}, + Config = {transient, + {transient, start_link, []}, + transient, 2000, worker, [transient]}, + {ok, {SupFlags, [Config]}}. diff --git a/lib/kernel/test/application_SUITE_data/transient.erl b/lib/kernel/test/application_SUITE_data/transient.erl new file mode 100644 index 0000000000..1f38b4803a --- /dev/null +++ b/lib/kernel/test/application_SUITE_data/transient.erl @@ -0,0 +1,52 @@ +%% +%% %CopyrightBegin% +%% +%% Copyright Ericsson AB 1998-2009. 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(transient). + + +-behaviour(gen_server). + +%% External exports +-export([start_link/0, transient/0]). +%% Internal exports +-export([init/1, handle_call/3, handle_cast/2, handle_info/2, terminate/2]). + +start_link() -> gen_server:start_link({local, aa}, transient, [], []). + +transient() -> gen_server:call(aa, transient). + +%%----------------------------------------------------------------- +%% Callback functions from gen_server +%%----------------------------------------------------------------- +init([]) -> + process_flag(trap_exit, true), + {ok, state}. + +handle_call(transient, _From, State) -> + X = application:get_all_env(transient), + {reply, X, State}. + +handle_cast(transient, State) -> + {noreply, State}. + +handle_info(_, State) -> + {noreply, State}. + +terminate(_Reason, _State) -> + ok. + |