Code Coverage Analyzer¶
The Simulator features an option to output
.cc (Code Coverage)
files that represent the use rate of functions of an application. It
traces how the opcodes are really executed.
The Code Coverage Analyzer scans the output
.cc files, and outputs an
HTML report to ease the analysis of methods coverage. The HTML report is
available in a folder named htmlReport in the same folder as the .cc
In order to work properly, the Code Coverage Analyzer should input the
.cc files (See Generate Code Coverage).
.cc files rely on the classpath used during the execution of the Simulator to the Code Coverage Analyzer.
Therefore the classpath is considered to be a dependency of the Code Coverage Analyzer.
This tool is a built-in Architecture tool.
A MicroEJ tool is available to launch the Code Coverage Analyzer tool. The tool name is Code Coverage Analyzer.
Two levels of code analysis are provided, the Java level and the bytecode level. Also provided is a view of the fully or partially covered classes and methods. From the HTML report index, just use hyperlinks to navigate into the report and source / bytecode level code.
./gradlew execTool --name=codeCoverageAnalyzer \
Option: *.cc files folder¶
Specify a folder which contains the cc files to process (*.cc).
Option: Source Folders¶
A list of folders to the source files.
Option: HTML Dir¶
The output directory for the HTML report.
List packages and classes to include to code coverage report. If no package/class is specified, all classes found in the project classpath will be analyzed.
packageA.packageB.*: includes all classes which are in package
packageA.packageB.className: includes the class
List packages and classes to exclude to code coverage report. If no package/class is specified, all classes found in the project classpath will be analyzed.
packageA.packageB.*: excludes all classes which are in package
packageA.packageB.className: excludes the class