From f6c1c3127f027cd717d01613cd356c5ada35041c Mon Sep 17 00:00:00 2001 From: Siri Hansen Date: Mon, 22 Oct 2012 16:06:32 +0200 Subject: [common_test] Add option cover_stop By default, test_server will always stop cover (and thus load back the non cover compiled original beam files) after a test with code coverage analysis is completed. The new option allows the common_test user to specify that cover shall not be stopped. This can be useful if there are processes still running old code, i.e. processes that have not done any fully qualified function call after the cover compilation, since loading the original code then will kill those processes. This is only recommended if the erlang node is to be stopped after the test run, or if cover can be manually stopped. --- lib/common_test/doc/src/cover_chapter.xml | 27 +++++++++++++++++++++++++++ lib/common_test/doc/src/ct_run.xml | 2 ++ lib/common_test/doc/src/run_test_chapter.xml | 5 +++++ 3 files changed, 34 insertions(+) (limited to 'lib/common_test/doc/src') diff --git a/lib/common_test/doc/src/cover_chapter.xml b/lib/common_test/doc/src/cover_chapter.xml index 803a71de07..b2e64bfff0 100644 --- a/lib/common_test/doc/src/cover_chapter.xml +++ b/lib/common_test/doc/src/cover_chapter.xml @@ -108,6 +108,33 @@ specifications).

+
+ + Stopping the cover tool when tests are completed +

By default the Cover tool is automatically stopped when the + tests are completed. This causes the original (non cover + compiled) modules to be loaded back in to the test node. If a + process at this point is still running old code of any of the + modules that are cover compiled, meaning that it has not done + any fully qualified function call after the cover compilation, + the process will now be killed. To avoid this it is possible to + set the value of the cover_stop option to + false. This means that the modules will stay cover + compiled, and it is therefore only recommended if the erlang + node(s) under test is terminated after the test is completed + or if cover can be manually stopped.

+ +

The option can be set by using the -cover_stop flag with + ct_run, by adding {cover_stop,true|false} to the + Opts argument to ct:run_test/1, or by adding + a cover_stop term in your test specification (see chapter + about test + specifications).

+ +
+
The cover specification file

These are the terms allowed in a cover specification file:

diff --git a/lib/common_test/doc/src/ct_run.xml b/lib/common_test/doc/src/ct_run.xml index 9cc5495af7..da18640df7 100644 --- a/lib/common_test/doc/src/ct_run.xml +++ b/lib/common_test/doc/src/ct_run.xml @@ -104,6 +104,7 @@ [-silent_connections [ConnType1 ConnType2 .. ConnTypeN]] [-stylesheet CSSFile] [-cover CoverCfgFile] + [-cover_stop Bool] [-event_handler EvHandler1 EvHandler2 .. EvHandlerN] | [-event_handler_init EvHandler1 InitArg1 and EvHandler2 InitArg2 and .. EvHandlerN InitArgN] @@ -138,6 +139,7 @@ [-silent_connections [ConnType1 ConnType2 .. ConnTypeN]] [-stylesheet CSSFile] [-cover CoverCfgFile] + [-cover_stop Bool] [-event_handler EvHandler1 EvHandler2 .. EvHandlerN] | [-event_handler_init EvHandler1 InitArg1 and EvHandler2 InitArg2 and .. EvHandlerN InitArgN] diff --git a/lib/common_test/doc/src/run_test_chapter.xml b/lib/common_test/doc/src/run_test_chapter.xml index ea62df27cc..b5b914d506 100644 --- a/lib/common_test/doc/src/run_test_chapter.xml +++ b/lib/common_test/doc/src/run_test_chapter.xml @@ -153,6 +153,8 @@ ]]>, points out a user HTML style sheet (see below). ]]>, to perform code coverage test (see Code Coverage Analysis). + ]]>, to specify if the cover tool shall be stopped after the test is completed (see + Code Coverage Analysis). ]]>, to install event handlers. ]]>, to install @@ -495,6 +497,9 @@ {cover, CoverSpecFile}. {cover, NodeRefs, CoverSpecFile}. + {cover_stop, Bool}. + {cover_stop, NodeRefs, Bool}. + {include, IncludeDirs}. {include, NodeRefs, IncludeDirs}. -- cgit v1.2.3