erlang:coverage

Full name:

eu.lindenbaum:maven-erlang-plugin:2.2.0:coverage

Description:

Runs a test coverage analysis on the modules in of the project, optionally printing the result to console. The coverage data is saved as a simple text file (COVERAGE-${project.artifactId}.txt) with simple space separated list of results, with coverage levels for: modules, functions, clauses and lines. See also CoverageReport, i.e. the coverage-report goal.

ISSUE If a test purges or unloads a module to do coverage for, the coverage compilation information will be gone and the coverage report will fail.

Attributes:

  • Requires a Maven project to be executed.
  • Requires dependency resolution of artifacts in scope: test.
  • Since version: 2.1.0.
  • Binds by default to the lifecycle phase: pre-site lifecycle="site".
  • Invokes the execution of the lifecycle phase test-compile prior to executing itself.

Optional Parameters

Name Type Since Description
cookie String 2.1.0 The cookie to use for the java and the backend node.
coverageExclude String[] 2.2.0 An optional list of module source files that should not be included when calculating the test-coverage. This can typically be used for generated or transformed source code, that is hard or impossible to test and cover. Example:
  <coverageExclude>
    <file>foo.erl</file>
    <file>bar.erl</file>
    <file>baz.erl</file>
  </coverageExclude>

details boolean 2.1.0 Setting this to true will print the coverage for each module, and not only the coverage summary.
Default value is: false.
erlCommand String 2.1.0 The erlang command used to start an erlang backend node. The path must exist and the destination must be executable. If the given command does not fullfill these requirements erl is used (assuming the command is part of the hosts PATH). The path must not contain any arguments.
silent boolean 2.1.0 Setting this to true will silent the console output and only generate the coverage output file.
Default value is: false.

Parameter Details

cookie:

The cookie to use for the java and the backend node.
  • Type: java.lang.String
  • Since: 2.1.0
  • Required: No
  • Expression: ${cookie}

coverageExclude:

An optional list of module source files that should not be included when calculating the test-coverage. This can typically be used for generated or transformed source code, that is hard or impossible to test and cover. Example:
  <coverageExclude>
    <file>foo.erl</file>
    <file>bar.erl</file>
    <file>baz.erl</file>
  </coverageExclude>
  • Type: java.lang.String[]
  • Since: 2.2.0
  • Required: No
  • Expression: ${coverageExclude}

details:

Setting this to true will print the coverage for each module, and not only the coverage summary.
  • Type: boolean
  • Since: 2.1.0
  • Required: No
  • Expression: ${details}
  • Default: false

erlCommand:

The erlang command used to start an erlang backend node. The path must exist and the destination must be executable. If the given command does not fullfill these requirements erl is used (assuming the command is part of the hosts PATH). The path must not contain any arguments.
  • Type: java.lang.String
  • Since: 2.1.0
  • Required: No
  • Expression: ${erlCommand}

silent:

Setting this to true will silent the console output and only generate the coverage output file.
  • Type: boolean
  • Since: 2.1.0
  • Required: No
  • Expression: ${silent}
  • Default: false