aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSiri Hansen <[email protected]>2012-10-16 15:32:36 +0200
committerSiri Hansen <[email protected]>2012-10-30 11:18:40 +0100
commit747775d07dc889af675771cb19b9f16e6a44205c (patch)
treec9c9ced64c91a294dbd2193053d5bbefc78d8d2f
parent76795e21ef68e2af29d22deee09a729a14f8a29a (diff)
downloadotp-747775d07dc889af675771cb19b9f16e6a44205c.tar.gz
otp-747775d07dc889af675771cb19b9f16e6a44205c.tar.bz2
otp-747775d07dc889af675771cb19b9f16e6a44205c.zip
[common_test] Start cover on slave nodes if running cover tests
Nodes started with ct_slave should automatically run cover when tests are executed with cover analysis. Nodes must also be flushed for cover data before stopped.
-rw-r--r--lib/common_test/src/ct_slave.erl11
1 files changed, 10 insertions, 1 deletions
diff --git a/lib/common_test/src/ct_slave.erl b/lib/common_test/src/ct_slave.erl
index aa3413fa89..6f7e83d852 100644
--- a/lib/common_test/src/ct_slave.erl
+++ b/lib/common_test/src/ct_slave.erl
@@ -1,7 +1,7 @@
%%--------------------------------------------------------------------
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2010. All Rights Reserved.
+%% Copyright Ericsson AB 2010-2012. 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
@@ -311,6 +311,13 @@ do_start(Host, Node, Options) ->
StartupTimeout = Options#options.startup_timeout,
Result = case wait_for_node_alive(ENode, BootTimeout) of
pong->
+ case test_server:is_cover() of
+ true ->
+ MainCoverNode = cover:get_main_node(),
+ rpc:call(MainCoverNode,cover,start,[ENode]);
+ false ->
+ ok
+ end,
call_functions(ENode, Functions2),
receive
{node_started, ENode}->
@@ -423,6 +430,8 @@ wait_for_node_alive(Node, N) ->
% call init:stop on a remote node
do_stop(ENode) ->
+ MainCoverNode = cover:get_main_node(),
+ rpc:call(MainCoverNode,cover,flush,[ENode]),
spawn(ENode, init, stop, []),
wait_for_node_dead(ENode, 5).