File Exchange

image thumbnail

mlcovr Package

version 1.1 (14.3 KB) by

mlcovr provides XML extension to profiling and coverage tools

0 Downloads

Updated

View License

The MLCOVR package provides XML-formatted output that is consistent with the Cobertura Java coverage tool. It uses the MATLAB profile tool along with custom scripts to evaluate lines covered, branches covered, branch types and complexity. It works on a directory and its subdirectories, collecting information as packages for display.

MLCOVR is part of the FAST software. FAST: A Framework for Agile Software Development Copyright (c) 2008-2009 Sandia Corporation. Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains certain rights in this software.

MLCOVR subversion repository is maintained at
https://software.sandia.gov/svn/public/fast/matlab/stable/+mlcovr

Comments and Ratings (3)

Kai Bublitz

I think this is a great piece of work. So far the only working way to add a coverage report for our automated test cases.

While I'm at it: I needed another fix in coveragerptxml.m (line 120) and coveragerpthtml.m (line 162):
Methods.type is no longer a string, but an enumeration type. It can simply be cast to char:
char(myClass.Methods(m).type)

Kai Bublitz

Kai Bublitz

I think there is a problem when using mlcovr with R2013b (and maybe others).
getmfilelist gives an error on line 170 because the Methods returned by getcallinfo don't include the field calllines. The simple fix is to remove this line, since the callines isn't used anywhere.
A second possibility to fix the issue is to change line 84 to
Methods = getcallinfo(mFiles(n).filename,'-v7.8',code);
which will bring the callines field back, but "This option is only for a multi-release conversion of the output is will be removed in a future version." (internal documentation of getcallinfo on the '-v7.8' option)

Updates

1.1

Updated to provide an option for HTML formatted code coverage output.

MATLAB Release
MATLAB 7.7 (R2008b)
Acknowledgements

Inspired: Coverage Report Generator

Download apps, toolboxes, and other File Exchange content using Add-On Explorer in MATLAB.

» Watch video