GroboUtils

About GroboUtils

Sourceforge
Project

For Developers

GroboCodeCoverage version 1.1.0

CoverageReport: GroboCoverage Ant Tasks

Author:Matt Albrecht

All Tasks

coveragereport

Description

deprecated - use grobo-report instead.

Generates an XML report describing all the coverage tallies for the classes that were logged during runtime execution. The report combines the runtime coverage logs with the post-compilation generated data. One report is created per analysis module. Currently, this task supports all included channel outputs (DirectoryChannelLoggerFactory, CacheDirChannelLoggerFactory, and MinDirChannelLoggerFactory).


Nested Elements

simplestyle

Generates one HTML file for each analysis module, which look something like this.

Parameters

AttributeDescriptionRequired
prefixThe text to prepend all output HTML file names. The output name will look like prefixModuleNamesuffix. Default prefix is CoverageReport-. No
suffixThe text to append to all output HTML file names. The output name will look like prefixModuleNamesuffix. Default prefix is CoverageReport-. Default suffix is .html. No
destdirThe output directory to place the HTML files. Default directory is .. No
removeEmptyA boolean value. This describes whether the output report should remove all methods and classes that don't have any code attributed to them (such as interfaces and abstract methods). Default is false. No

Nested Elements

param

Used to pass a parameter to the underlying XSL stylesheet. The usage is exactly like the param structure for the style Ant task.

Parameters

AttributeDescriptionRequired
nameName of the XSL parameterYes
expressionText value to be placed into the param.Yes
ifThe param will only pass if this property is set.No
ifThe param will only pass unless this property is set.No


sourcestyle

Generates a JavaDoc-like collection of HTML files for all the analysis modules, linking the coverage reports to the source files. This report shows the contents of the source files and highlights whichever lines were not covered.

Parameters

AttributeDescriptionRequired
titleThe title text to be placed on the top of every HTML file. Default is Summary Coverage Report. No
srcdirDirectory containing the source files. Yes
destdirThe output directory to place the HTML files. Default directory is .. No
footertextText to be put at the bottom of every center frame's page (default is an advertisement for GroboUtils).No
footerhrefLink to have the footertext point to (default is an advertisement for GroboUtils).No
stylesheetStylesheet file to use in replacement of the default.No
removeEmptyA boolean value. This describes whether the output report should remove all methods and classes that don't have any code attributed to them (such as interfaces and abstract methods). Default is false. No

Nested Elements

srcdir

In addition to the srcdir attribute, you can include multiple source directories for searching. The first directory containing the source file will be used in the report.

Parameters

AttributeDescriptionRequired
nameThe name of the directory containing a source tree. Yes


Parameters

AttributeDescriptionRequired
datadirThe name of the directory to read the analysis module generated data from. This same directory should be specified in the coveragepostcompiler task's datadir attribute as well. Yes
logDirThe name of the directory to read the log output generated from running the code. This same directory should be specified in the grobocoverage.properties file. Yes
outdirThe name of the directory that will contain the generated XML documents. Yes
reportfileprefixText that will prepend each outputted XML document's file name (default is Coverage-). No
reportfileextensionText that will append each outputted XML document's file name (default is .xml). No
failonerrorBoolean describing if an error in this task should cause the build to fail (default is false). No

Examples

<coveragereport
        datadir="${dirs.test-output}/coverage-data"
        logdir="${dirs.test-output}/coverage-log"
        outdir="${dirs.test-output}">
</coveragereport>
        
The <coveragereport> task generates one .xml file for each analysis module that has data in the ${dirs.test-output}/coverage-data directory, using the runtime log data found in the ${dirs.test-output}/coverage-log directory. It also places in the same directory an .xml file that contains all the analysis module data.
<coveragereport
        datadir="${dirs.test-output}/coverage-data"
        logdir="${dirs.test-output}/coverage-log"
        outdir="${dirs.test-output}">
    <simplestyle destdir="${dirs.test-output}" removeempty="true" />
    <sourcestyle destdir="${dirs.test-output}/source-report"
        removeempty="true" srcdir="src"
        title="Summary Coverage Report of My Code">
        
        <srcdir name="${dirs.temp}/generated-source-1" />
        <srcdir name="${dirs.temp}/generated-source-2" />
    </sourcestyle>
</coveragereport>
        
Same as above, but this also generates two human-readable reports. The first (simplestyle) generates one HTML file in the ${dirs.test-output} directory for each analysis module XML report. The generated file will look something like this.

The second (sourcestyle) generates a directory hierarchy of framed HTML pages in the ${dirs.test-output}/source-report directory. It links the original Java source files into the HTML by looking in the directories src, ${dirs.temp}/generated-source-1, and ${dirs.temp}/generated-source-2 for the source files corresponding to the covered class files, in that order.


All Tasks




SourceForge Logo
This space graciously provided by the SourceForge project
Copyright © 2002-2004 GroboUtils Project.
All rights reserved.