From fe9ed2938a02869b1df9554b32e4c4c453e6995c Mon Sep 17 00:00:00 2001 From: Siri Hansen Date: Wed, 24 Oct 2012 18:48:11 +0200 Subject: [test_server] Add option {start_cover,false} to test_server:start_node By default the test server will start cover on all nodes when the test is run with code coverage analysis. To make sure cover is not started on a new node, this option can be set. This can be useful if the test itself starts cover or if the new node for some reason can not run cover compiled code. --- lib/test_server/doc/src/test_server.xml | 14 +++++++++++++- lib/test_server/src/test_server.erl | 5 ++++- 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/lib/test_server/doc/src/test_server.xml b/lib/test_server/doc/src/test_server.xml index 5bfa42c36f..841cbfbe91 100644 --- a/lib/test_server/doc/src/test_server.xml +++ b/lib/test_server/doc/src/test_server.xml @@ -5,7 +5,7 @@
2007 - 2011 + 2012 Ericsson AB, All Rights Reserved @@ -529,6 +529,18 @@ Only valid for peer nodes. Note that slave nodes always analogy with os:getenv/1), which removes the environment variable. Only valid for peer nodes. Not available on VxWorks. + {start_cover, false} + By default the test server will start cover on all nodes + when the test is run with code coverage analysis. To make + sure cover is not started on a new node, set this option to + false. This can be necessary if the connection to + the node at some point will be broken but the node is + expected to stay alive. The reason is that a remote cover + node can not continue to run without its main node. Another + solution would be to explicitly stop cover on the node + before breaking the connection, but in some situations (if + old code resides in one or more processes) this is not + possible. diff --git a/lib/test_server/src/test_server.erl b/lib/test_server/src/test_server.erl index 2b15d07990..b900c88db4 100644 --- a/lib/test_server/src/test_server.erl +++ b/lib/test_server/src/test_server.erl @@ -2597,7 +2597,10 @@ start_node(Name, Type, Options) -> %% by a shielded node. Cover = case is_cover() of true -> - not is_shielded(Name) andalso same_version(Node); + not is_shielded(Name) + andalso same_version(Node) + andalso proplists:get_value(start_cover,Options, + true); false -> false end, -- cgit v1.2.3