aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSiri Hansen <[email protected]>2012-10-24 18:48:11 +0200
committerSiri Hansen <[email protected]>2012-10-30 11:19:00 +0100
commitfe9ed2938a02869b1df9554b32e4c4c453e6995c (patch)
tree603b813298853232124574050f54a5730a01d455
parentb6fe934ea73f8eeaaa70b786f53ee6e8f2a52d2c (diff)
downloadotp-fe9ed2938a02869b1df9554b32e4c4c453e6995c.tar.gz
otp-fe9ed2938a02869b1df9554b32e4c4c453e6995c.tar.bz2
otp-fe9ed2938a02869b1df9554b32e4c4c453e6995c.zip
[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.
-rw-r--r--lib/test_server/doc/src/test_server.xml14
-rw-r--r--lib/test_server/src/test_server.erl5
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 @@
<header>
<copyright>
<year>2007</year>
- <year>2011</year>
+ <year>2012</year>
<holder>Ericsson AB, All Rights Reserved</holder>
</copyright>
<legalnotice>
@@ -529,6 +529,18 @@ Only valid for peer nodes. Note that slave nodes always
analogy with <c>os:getenv/1</c>), which removes the
environment variable. Only valid for peer nodes. Not
available on VxWorks.</item>
+ <tag><c>{start_cover, false}</c></tag>
+ <item>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
+ <c>false</c>. 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.</item>
</taglist>
</desc>
</func>
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,