The module
An executable line contains an Erlang expression such as a matching
or a function call. A blank line or a line containing a comment,
function head or pattern in a
Coverage analysis can be used to verify test cases, making sure all relevant code is covered, and may also be helpful when looking for bottlenecks in the code.
Before any analysis can take place, the involved modules must be
Cover compiled. This means that some extra information is
added to the module before it is compiled into a binary which then
is loaded. The source file of the module is not affected and no
Each time a function in a Cover compiled module is called,
information about the call is added to an internal database of Cover.
The coverage analysis is performed by examining the contents of
the Cover database. The output
Distribution
Cover can be used in a distributed Erlang system. One of the
nodes in the system must then be selected as the main node, and all Cover commands must be executed from this
node. The error reason
Use
To only collect data from remote nodes without stopping
Starts the Cover server which owns the Cover internal database. This function is called automatically by the other functions in the module.
Starts a Cover server on the each of given nodes, and loads all cover compiled modules.
Compiles a module for Cover analysis. The module is given by its
module name
If the module is successfully Cover compiled, the function
returns
Note that the internal database is (re-)initiated during the compilation, meaning any previously collected coverage data for the module will be lost.
Compiles all modules (
The function returns
Does the same as
Note that the existing
Compiles all modules (
The function returns
Performs analysis of a Cover compiled module
If
HINT: It is possible to issue multiple analyse_to_file commands at the same time.
Makes a copy
The output file
If
If the source file and/or the output file cannot be opened using
If the module was cover compiled from the
HINT: It is possible to issue multiple analyse_to_file commands at the same time.
This function works exactly the same way as
Returns a list with all modules that are currently Cover compiled.
Returns a list with all modules for which there are imported data.
Returns a list with all imported files.
Returns a list with all nodes that are part of the coverage analysis. Note that the current node is not returned. This node is always part of the analysis.
Returns
Resets all coverage data for a Cover compiled module
If
Exports the current coverage data for
If
This function is useful if coverage data from different systems is to be merged.
See also
Imports coverage data from the file
Note that when compiling a module all existing coverage data is removed, including imported data. If a module is already compiled when data is imported, the imported data is added to the existing coverage data.
Coverage data from several export files can be imported into one system. The coverage data is then added up when analysing.
Coverage data for a module can not be imported from the same file twice unless the module is first reset or compiled. The check is based on the filename, so you can easily fool the system by renaming your export file.
See also
Stops the Cover server and unloads all Cover compiled code.
Stops the Cover server and unloads all Cover compiled code on the given nodes. Data stored in the Cover database on the remote nodes is fetched and stored on the main node.
Fetch data from the Cover database on the remote nodes and stored on the main node.
code(3), compile(3)