From a6142c21052ab16c080314aa05d1a30e6631a64c Mon Sep 17 00:00:00 2001 From: Siri Hansen Date: Tue, 27 Nov 2012 18:41:30 +0100 Subject: [test_server] Update documentation about cross cover Add info about cross statement in cover file: {cross,[{Tag,Modules}]}. Add parameter Tests = [{Tag,Dir}] to test_server_ctrl:cross_cover_analyse --- lib/test_server/doc/src/test_server_ctrl.xml | 93 +++++++++++++++++++++------- lib/test_server/doc/src/ts.xml | 4 +- 2 files changed, 74 insertions(+), 23 deletions(-) (limited to 'lib/test_server/doc') diff --git a/lib/test_server/doc/src/test_server_ctrl.xml b/lib/test_server/doc/src/test_server_ctrl.xml index 41bc0bcc75..af96f1fe7e 100644 --- a/lib/test_server/doc/src/test_server_ctrl.xml +++ b/lib/test_server/doc/src/test_server_ctrl.xml @@ -427,11 +427,21 @@ Optional, if not given the test server controller node

A CoverFile can have the following entries:

{exclude, all | ExcludeModuleList}. -{include, IncludeModuleList}. +{include, IncludeModuleList}. +{cross, CrossCoverInfo}.

Note that each line must end with a full stop. ExcludeModuleList and IncludeModuleList are lists of atoms, where each atom is a module name.

+ +

CrossCoverInfo is used when collecting cover data + over multiple tests. Modules listed here are compiled, but + they will not be analysed when the test is finished. See + cross_cover_analyse/2 + for more information about the cross cover mechanism and the + format of CrossCoverInfo. +

If both an Application and a CoverFile is given, all modules in the application are cover compiled, except for the modules listed in ExcludeModuleList. The @@ -467,30 +477,71 @@ Optional, if not given the test server controller node - cross_cover_analyse(Level) -> ok - Analyse cover data collected from all tests + cross_cover_analyse(Level, Tests) -> ok + Analyse cover data collected from multiple tests Level = details | overview + Tests = [{Tag,LogDir}] + Tag = atom() + Test identifier. + LogDir = string() + Log directory for the test identified by Tag. This + can either be the run.<timestamp> directory or + the parent directory of this (in which case the latest + run.<timestamp> directory is chosen. -

Analyse cover data collected from all tests. The modules - analysed are the ones listed in the cross cover file - cross.cover in the current directory of the test - server.

-

The modules listed in the cross.cover file are - modules that are heavily used by other applications than the - one they belong to. This function should be run after all - tests are completed, and the result will be stored in a file - called cross_cover.html in the run.<timestamp> - directory of the application the modules belong to. -

-

The cross.cover file contains elements like this:

-
-{App,Modules}.        
-

where App can be an application name or the atom - all. The application (or all applications) will cover - compile the listed Modules. -

+

Analyse cover data collected from multiple tests. The modules + analysed are the ones listed in cross statements in + the cover files. These are modules that are heavily used by + other tests than the one where they belong or are explicitly + tested. They should then be listed as cross modules in the + cover file for the test where they are used but do not + belong. Se example below.

+

This function should be run after all tests are completed, + and the result will be stored in a file called + cross_cover.html in the run.<timestamp> + directory of the test the modules belong to.

+

Note that the function can be executed on any node, and it + does not require test_server_ctrl to be started first.

+

The cross statement in the cover file must be like this:

+ +{cross,[{Tag,Modules}]}. +

where Tag is the same as Tag in the + Tests parameter to this function and Modules is a + list of module names (atoms).

+

Example:

+

If the module m1 belongs to system s1 but is + heavily used also in the tests for another system s2, + then the cover files for the two systems' tests could be like + this:

+ +s1.cover: + {include,[m1]}. + +s2.cover: + {include,[....]}. % modules belonging to system s2 + {cross,[{s1,[m1]}]}. +

When the tests for both s1 and s2 are completed, run

+ +test_server_ctrl:cross_cover_analyse(Level,[{s1,S1LogDir},{s2,S2LogDir}]) + + +

and the accumulated cover data for m1 will be written to + S1LogDir/[run.<timestamp>/]cross_cover.html.

+

Note that the m1 module will also be presented in the + normal coverage log for s1 (due to the include statement in + s1.cover), but that only includes the coverage achieved by the + s1 test itself.

+

The Tag in the cross statement in the cover file has + no other purpose than mapping the list of modules + ([m1] in the example above) to the correct log + directory where it should be included in the + cross_cover.html file (S1LogDir in the example + above). I.e. the value of Tag has no meaning, it + could be foo as well as s1 above, as long as + the same Tag is used in the cover file and in the + call to this function.

diff --git a/lib/test_server/doc/src/ts.xml b/lib/test_server/doc/src/ts.xml index 4a2c536e96..82ba3a5017 100644 --- a/lib/test_server/doc/src/ts.xml +++ b/lib/test_server/doc/src/ts.xml @@ -5,7 +5,7 @@
2007 - 2011 + 2012 Ericsson AB, All Rights Reserved @@ -450,7 +450,7 @@ This option is mandatory for remote targets

Analyse cover data collected from all tests.

-

See test_server_ctrl:cross_cover_analyse/1 +

See test_server_ctrl:cross_cover_analyse/2

-- cgit v1.2.3