aboutsummaryrefslogtreecommitdiffstats
path: root/lib/reltool/test/reltool_wx_SUITE.erl
diff options
context:
space:
mode:
authorSiri Hansen <[email protected]>2012-01-25 16:24:35 +0100
committerSiri Hansen <[email protected]>2012-03-19 09:48:53 +0100
commit3fef8ee7031a16a038c9f87dc8cf8ea44064e6ed (patch)
tree5734de038d560b1fe2dc92b25789e9eb58e92783 /lib/reltool/test/reltool_wx_SUITE.erl
parentf515a08b3a57c854ee547e6c84c39e2fd14a27da (diff)
downloadotp-3fef8ee7031a16a038c9f87dc8cf8ea44064e6ed.tar.gz
otp-3fef8ee7031a16a038c9f87dc8cf8ea44064e6ed.tar.bz2
otp-3fef8ee7031a16a038c9f87dc8cf8ea44064e6ed.zip
[reltool] Add more GUI tests
OTP-9794 This commit adds a test suite for manual testing of the reltool GUI. By use of test_server:break/1 function, it guides the user through a set of tests in the GUI. Some minor checks are also added to the automatic GUI test, reltool_wx_SUITE.
Diffstat (limited to 'lib/reltool/test/reltool_wx_SUITE.erl')
-rw-r--r--lib/reltool/test/reltool_wx_SUITE.erl37
1 files changed, 34 insertions, 3 deletions
diff --git a/lib/reltool/test/reltool_wx_SUITE.erl b/lib/reltool/test/reltool_wx_SUITE.erl
index 51f433f206..13d71f4fd6 100644
--- a/lib/reltool/test/reltool_wx_SUITE.erl
+++ b/lib/reltool/test/reltool_wx_SUITE.erl
@@ -61,15 +61,46 @@ start_all_windows(TestInfo) when is_atom(TestInfo) ->
reltool_test_lib:tc_info(TestInfo);
start_all_windows(_Config) ->
{ok, SysPid} = ?msym({ok, _}, reltool:start([{trap_exit, false}])),
+ erlang:monitor(process,SysPid),
{ok, AppPid} = ?msym({ok, _}, reltool_sys_win:open_app(SysPid, stdlib)),
- ?msym({ok, _}, reltool_app_win:open_mod(AppPid, escript)),
+ erlang:monitor(process,AppPid),
+ {ok, ModPid} = ?msym({ok, _}, reltool_app_win:open_mod(AppPid, escript)),
+ erlang:monitor(process,ModPid),
+
+ %% Let all windows get started
+ timer:sleep(timer:seconds(10)),
%% Test that server pid can be fetched, and that server is alive
{ok, Server} = ?msym({ok,_}, reltool:get_server(SysPid)),
?m(true, erlang:is_process_alive(Server)),
?m({ok,{sys,[]}}, reltool:get_config(Server)),
- timer:sleep(timer:seconds(10)),
+ %% Terminate
+ check_no_win_crash(),
?m(ok, reltool:stop(SysPid)),
-
+ wait_terminate([{sys,SysPid},{app,AppPid},{mod,ModPid}]),
+
ok.
+
+
+%%%-----------------------------------------------------------------
+%%% Internal functions
+check_no_win_crash() ->
+ receive {'DOWN',_,_,_,_} = Down ->
+ ct:log("Unexpected termination of window:~n~p",[Down]),
+ ct:fail("window crashed")
+ after 0 ->
+ ok
+ end.
+
+wait_terminate([]) ->
+ ok;
+wait_terminate([{Win,P}|Rest]) ->
+ receive
+ {'DOWN',_,process,P,shutdown} ->
+ wait_terminate(Rest);
+ {'DOWN',_,process,P,Reason} ->
+ ct:log("~p window terminated with unexpected reason:~n~p",
+ [Win,Reason]),
+ ct:fail("unexpected exit reason from window")
+ end.