diff options
Diffstat (limited to 'lib/reltool/test')
-rw-r--r-- | lib/reltool/test/Makefile | 4 | ||||
-rw-r--r-- | lib/reltool/test/reltool.cover | 2 | ||||
-rw-r--r-- | lib/reltool/test/reltool.spec | 3 | ||||
-rw-r--r-- | lib/reltool/test/reltool_app_SUITE.erl | 47 | ||||
-rw-r--r-- | lib/reltool/test/reltool_server_SUITE.erl | 70 | ||||
-rw-r--r-- | lib/reltool/test/reltool_test_lib.erl | 8 | ||||
-rw-r--r-- | lib/reltool/test/reltool_wx_SUITE.erl | 29 | ||||
-rw-r--r-- | lib/reltool/test/rtt.erl | 2 |
8 files changed, 104 insertions, 61 deletions
diff --git a/lib/reltool/test/Makefile b/lib/reltool/test/Makefile index 7abf4a5947..62fe05238b 100644 --- a/lib/reltool/test/Makefile +++ b/lib/reltool/test/Makefile @@ -1,7 +1,7 @@ # # %CopyrightBegin% # -# Copyright Ericsson AB 2009-2010. All Rights Reserved. +# 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 @@ -73,7 +73,7 @@ release_spec: opt release_tests_spec: opt $(INSTALL_DIR) $(RELSYSDIR) - $(INSTALL_DATA) reltool.spec $(ERL_FILES) $(HRL_FILES) $(RELSYSDIR) + $(INSTALL_DATA) reltool.spec reltool.cover $(ERL_FILES) $(HRL_FILES) $(RELSYSDIR) $(INSTALL_SCRIPT) rtt $(INSTALL_PROGS) $(RELSYSDIR) $(INSTALL_DATA) $(INSTALL_PROGS) $(RELSYSDIR) # chmod -R u+w $(RELSYSDIR) diff --git a/lib/reltool/test/reltool.cover b/lib/reltool/test/reltool.cover new file mode 100644 index 0000000000..ca425b9f98 --- /dev/null +++ b/lib/reltool/test/reltool.cover @@ -0,0 +1,2 @@ +{incl_app,reltool,details}. + diff --git a/lib/reltool/test/reltool.spec b/lib/reltool/test/reltool.spec index 252232e09d..2995720105 100644 --- a/lib/reltool/test/reltool.spec +++ b/lib/reltool/test/reltool.spec @@ -1,2 +1 @@ -{topcase, {dir, "../reltool_test"}}. - +{suites,"../reltool_test",all}. diff --git a/lib/reltool/test/reltool_app_SUITE.erl b/lib/reltool/test/reltool_app_SUITE.erl index f8433f73d0..a6e00cde08 100644 --- a/lib/reltool/test/reltool_app_SUITE.erl +++ b/lib/reltool/test/reltool_app_SUITE.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2010. All Rights Reserved. +%% Copyright Ericsson AB 2010-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 @@ -45,35 +45,36 @@ init_per_suite(Config) -> end_per_suite(Config) -> reltool_test_lib:end_per_suite(Config). +init_per_testcase(undef_funcs=Case, Config) -> + case test_server:is_debug() of + true -> + {skip,"Debug-compiled emulator -- far too slow"}; + false -> + Config2 = [{tc_timeout, timer:minutes(10)} | Config], + reltool_test_lib:init_per_testcase(Case, Config2) + end; init_per_testcase(Case, Config) -> - Config2 = - case Case of - undef_funcs -> - [{tc_timeout, timer:minutes(10)} | Config]; - _ -> - Config - end, - reltool_test_lib:init_per_testcase(Case, Config2). + reltool_test_lib:init_per_testcase(Case, Config). end_per_testcase(Func,Config) -> reltool_test_lib:end_per_testcase(Func,Config). -fin_per_testcase(Case, Config) -> - reltool_test_lib:end_per_testcase(Case, Config). - %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -all() -> - all(suite). - -all(suite) -> - [ - fields, - modules, - export_all, - app_depend, - undef_funcs - ]. +suite() -> [{ct_hooks,[ts_install_cth]}]. + +all() -> + [fields, modules, export_all, app_depend, undef_funcs]. + +groups() -> + []. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/lib/reltool/test/reltool_server_SUITE.erl b/lib/reltool/test/reltool_server_SUITE.erl index faf1bdbba2..b77560db94 100644 --- a/lib/reltool/test/reltool_server_SUITE.erl +++ b/lib/reltool/test/reltool_server_SUITE.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2009-2010. All Rights Reserved. +%% 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 @@ -18,8 +18,9 @@ -module(reltool_server_SUITE). --export([all/0, init_per_suite/1, end_per_suite/1, - init_per_testcase/2, fin_per_testcase/2, end_per_testcase/2]). +-export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2, + init_per_suite/1, end_per_suite/1, + init_per_testcase/2, end_per_testcase/2]). -compile(export_all). @@ -42,25 +43,27 @@ init_per_testcase(Func,Config) -> reltool_test_lib:init_per_testcase(Func,Config). end_per_testcase(Func,Config) -> reltool_test_lib:end_per_testcase(Func,Config). -fin_per_testcase(Func,Config) -> %% For test_server - reltool_test_lib:end_per_testcase(Func,Config). %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %% SUITE specification -all() -> - all(suite). -all(suite) -> - [ - start_server, - set_config, - create_release, - create_script, - create_target, - create_embedded, - create_standalone, - create_old_target - ]. +suite() -> [{ct_hooks,[ts_install_cth]}]. + +all() -> + [start_server, set_config, create_release, + create_script, create_target, create_embedded, + create_standalone, create_old_target, + otp_9135]. + +groups() -> + []. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + %% The test cases @@ -108,6 +111,37 @@ set_config(_Config) -> ok. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%% OTP-9135, test that app_file option can be set to all | keep | strip + +otp_9135(TestInfo) when is_atom(TestInfo) -> + reltool_test_lib:tc_info(TestInfo); +otp_9135(_Config) -> + Libs = lists:sort(erl_libs()), + StrippedDefaultSys = + case Libs of + [] -> []; + _ -> {lib_dirs, Libs} + end, + + Config1 = {sys,[{app_file, keep}]}, % this is the default + {ok, Pid1} = ?msym({ok, _}, reltool:start_server([{config, Config1}])), + ?m({ok, {sys,StrippedDefaultSys}}, reltool:get_config(Pid1)), + ?m(ok, reltool:stop(Pid1)), + + Config2 = {sys,[{app_file, strip}]}, + {ok, Pid2} = ?msym({ok, _}, reltool:start_server([{config, Config2}])), + ExpectedConfig2 = StrippedDefaultSys++[{app_file,strip}], + ?m({ok, {sys,ExpectedConfig2}}, reltool:get_config(Pid2)), + ?m(ok, reltool:stop(Pid2)), + + Config3 = {sys,[{app_file, all}]}, + {ok, Pid3} = ?msym({ok, _}, reltool:start_server([{config, Config3}])), + ExpectedConfig3 = StrippedDefaultSys++[{app_file,all}], + ?m({ok, {sys,ExpectedConfig3}}, reltool:get_config(Pid3)), + ?m(ok, reltool:stop(Pid3)), + ok. + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %% Generate releases create_release(TestInfo) when is_atom(TestInfo) -> diff --git a/lib/reltool/test/reltool_test_lib.erl b/lib/reltool/test/reltool_test_lib.erl index 5390b0a75e..b8bcbcd009 100644 --- a/lib/reltool/test/reltool_test_lib.erl +++ b/lib/reltool/test/reltool_test_lib.erl @@ -97,7 +97,7 @@ wx_init_per_suite(Config) -> exit({skipped, "Can not test on MacOSX"}); {unix, _} -> io:format("DISPLAY ~s~n", [os:getenv("DISPLAY")]), - case proplists:get_value(xserver, Config, none) of + case ct:get_config(xserver, none) of none -> ignore; Server -> os:putenv("DISPLAY", Server) end; @@ -295,7 +295,7 @@ eval_test_case(Mod, Fun, Config) -> test_case_evaluator(Mod, Fun, [Config]) -> NewConfig = Mod:init_per_testcase(Fun, Config), R = apply(Mod, Fun, [NewConfig]), - Mod:fin_per_testcase(Fun, NewConfig), + Mod:end_per_testcase(Fun, NewConfig), exit({test_case_ok, R}). wait_for_evaluator(Pid, Mod, Fun, Config) -> @@ -311,12 +311,12 @@ wait_for_evaluator(Pid, Mod, Fun, Config) -> {'EXIT', Pid, {skipped, Reason}} -> log("<WARNING> Test case ~w skipped, because ~p~n", [{Mod, Fun}, Reason]), - Mod:fin_per_testcase(Fun, Config), + Mod:end_per_testcase(Fun, Config), {skip, {Mod, Fun}, Reason}; {'EXIT', Pid, Reason} -> log("<ERROR> Eval process ~w exited, because\n\t~p~n", [{Mod, Fun}, Reason]), - Mod:fin_per_testcase(Fun, Config), + Mod:end_per_testcase(Fun, Config), {crash, {Mod, Fun}, Reason} end. diff --git a/lib/reltool/test/reltool_wx_SUITE.erl b/lib/reltool/test/reltool_wx_SUITE.erl index 2e2b355e07..424bc7d189 100644 --- a/lib/reltool/test/reltool_wx_SUITE.erl +++ b/lib/reltool/test/reltool_wx_SUITE.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2009. All Rights Reserved. +%% 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 @@ -18,8 +18,9 @@ -module(reltool_wx_SUITE). --export([all/0, init_per_suite/1, end_per_suite/1, - init_per_testcase/2, fin_per_testcase/2, end_per_testcase/2]). +-export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2, + init_per_suite/1, end_per_suite/1, + init_per_testcase/2, end_per_testcase/2]). -compile(export_all). @@ -36,16 +37,22 @@ init_per_testcase(Func,Config) -> reltool_test_lib:init_per_testcase(Func,Config). end_per_testcase(Func,Config) -> reltool_test_lib:end_per_testcase(Func,Config). -fin_per_testcase(Func,Config) -> %% For test_server - reltool_test_lib:end_per_testcase(Func,Config). %% SUITE specification -all() -> - all(suite). -all(suite) -> - [ - start_all_windows - ]. +suite() -> [{ct_hooks,[ts_install_cth]}]. + +all() -> + [start_all_windows]. + +groups() -> + []. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + %% The test cases diff --git a/lib/reltool/test/rtt.erl b/lib/reltool/test/rtt.erl index 6755b8400f..437009e26a 100644 --- a/lib/reltool/test/rtt.erl +++ b/lib/reltool/test/rtt.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2009. All Rights Reserved. +%% Copyright Ericsson AB 2010. 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 |