File Exchange

image thumbnail

Code Coverage Tool

version 1.5 (96.5 KB) by

Code Coverage Tool measures C statement coverage in generated code.

9 Ratings



View License

The Code Coverage Tool (CCT) measures C statement coverage in code built as a Real-Time Workshop S-Function. It operates in conjunction with lcc (the C-Compiler that ships with the standard MATLAB installation). CCT inserts instrumentation code into the assembly source generated by lcc during a normal compile. This additional code logs when a line is executed in memory on the PC. When a simulation completes, the line execution counts are sent to the MATLAB base workspace.

A full description of CCT and installation instructions are included in the download. See the file readme.html.

Comments and Ratings (9)

Krishan Kumar

It gives the coverage of the last run, it doesn't give coverage for the cumulative run as in model coverage.

srikantan kc

good -i'll try

Marcelo Estrella

Venkata Chittem

This tool is giving line coverage information. But code coverage will be incomplete without a mention of MC/DC (Multiple conditions and Decision coverage) information!

pranesh selvarangan


Abhay Bhisikar


saytu rachim

fa fa

very well

kong sopheak



cct_setup so build works when there are spaces in the path.
Added the html files in for a typical build.
cct_setup now forces "Generate Report" on, so there is a file to put the coverage in.


Compatibility updates with R2008b and R2009a (HTML formatting and data communication with MATLAB workspace). I have added a makefile so that the compiler interceptor executables can now be built by lcc from the supplied sources.

Path bug found in cct_setup.m during testing. A file separator was missing when toolroot was expanded.

MATLAB Release
MATLAB 7.7 (R2008b)

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

» Watch video