Code covered by the BSD License  

Highlights from
Coverage Report Generator

Be the first to rate this file! 13 Downloads (last 30 days) File Size: 21.8 KB File ID: #33972

Coverage Report Generator

by

 

28 Nov 2011 (Updated )

Generates Cobertura-style XML coverage report

| Watch this File

File Information
Description

This packages uses the profiler to generate a Cobertura-style XML coverage report. We use this report in conjunction with Hudson/Jenkins to track test coverage. The code sample below illustrates how to use the code. See example.m for details.

%add source code to path
addpath('src');

%import classses, functions
import edu.stanford.covert.test.Coverage;

%turn profiler on
profile('on', '-nohistory');

%run code
...

%turn profiler off
profile('off');

%generate coverage report
report = Coverage('src', '..');
report.exportXML(<output file name>);

Acknowledgements

Mlcovr Package, Absolutepath.M, and Absolutepath inspired this file.

MATLAB release MATLAB 7.11 (R2010b)
Other requirements - MATLAB >= 2008a - includes strjoin function from Peter Acklam (http://home.online.no/~pjacklam/matlab/software/util/) - includes absolutepath function inspired by Jochen Lenz (http://www.mathworks.com/matlabcentral/fileexchange/3857-absolutepath-m)
Tags for This File   Please login to tag files.
Please login to add a comment or rating.
Comments and Ratings (4)
26 Jun 2014 Johan Löfberg

Code does work in recent version of MATLAB (r2012,2014 tested) on Windows. The problem is capitalization of drives in which.m vs absolutepath.m.

The first returns C:\... while the second returns c:\...

This causes a failure on line 190 in Coverage.m

Cannot import as done in the example either, so I have to call the method as

report = edu.stanford.covert.test.Coverage('src', '..');

25 Mar 2013 Jonathan Karr

Sorry for the confusion. I don't believe the Control System Toolbox is required.

18 Mar 2013 James

Why is Control System Toolbox required?

18 Jul 2012 Eric Moyer

I'm running R2010b under Ubuntu 12.04 and example.m gives an error on the import line. When I comment out the import and use the full class name to call edu.stanford.covert.test.Coverage, I get a segmentation fault before it even starts running the constructor code. :-(

Updates
05 Dec 2011

Including missing code

25 Mar 2013

Correct required products list.

Contact us