https://public.kitware.com/Wiki/index.php?title=ITK/Code_Coverage_Practices&feed=atom&action=historyITK/Code Coverage Practices - Revision history2024-03-28T12:05:16ZRevision history for this page on the wikiMediaWiki 1.38.6https://public.kitware.com/Wiki/index.php?title=ITK/Code_Coverage_Practices&diff=45779&oldid=prevDaviddoria: moved ITK Code Coverage Practices to ITK/Code Coverage Practices2012-02-11T01:26:57Z<p>moved <a href="/Wiki/ITK_Code_Coverage_Practices" class="mw-redirect" title="ITK Code Coverage Practices">ITK Code Coverage Practices</a> to <a href="/Wiki/ITK/Code_Coverage_Practices" title="ITK/Code Coverage Practices">ITK/Code Coverage Practices</a></p>
<table style="background-color: #fff; color: #202122;" data-mw="interface">
<tr class="diff-title" lang="en">
<td colspan="1" style="background-color: #fff; color: #202122; text-align: center;">← Older revision</td>
<td colspan="1" style="background-color: #fff; color: #202122; text-align: center;">Revision as of 01:26, 11 February 2012</td>
</tr><tr><td colspan="2" class="diff-notice" lang="en"><div class="mw-diff-empty">(No difference)</div>
</td></tr></table>Daviddoriahttps://public.kitware.com/Wiki/index.php?title=ITK/Code_Coverage_Practices&diff=42559&oldid=prevAndinet at 20:42, 29 August 20112011-08-29T20:42:24Z<p></p>
<table style="background-color: #fff; color: #202122;" data-mw="interface">
<col class="diff-marker" />
<col class="diff-content" />
<col class="diff-marker" />
<col class="diff-content" />
<tr class="diff-title" lang="en">
<td colspan="2" style="background-color: #fff; color: #202122; text-align: center;">← Older revision</td>
<td colspan="2" style="background-color: #fff; color: #202122; text-align: center;">Revision as of 20:42, 29 August 2011</td>
</tr><tr><td colspan="2" class="diff-lineno" id="mw-diff-left-l41">Line 41:</td>
<td colspan="2" class="diff-lineno">Line 41:</td></tr>
<tr><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>* For example:</div></td><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>* For example:</div></td></tr>
<tr><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br/></td><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br/></td></tr>
<tr><td class="diff-marker" data-marker="−"></td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div> computeCodeCoverageLocallyForOneTest.sh -R itkHDF5ImageIOTest</div></td><td class="diff-marker" data-marker="+"></td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div> computeCodeCoverageLocallyForOneTest.sh <ins style="font-weight: bold; text-decoration: none;">./Modules/IO/HDF5 </ins>-R itkHDF5ImageIOTest</div></td></tr>
<tr><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br/></td><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br/></td></tr>
<tr><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>* This will run the selected tests in ITK and generate code coverage for the entire toolkit, but only from the test that you have selected. The code coverage report will be generated in HTML and will be presented with Firefox.</div></td><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>* This will run the selected tests in ITK and generate code coverage for the entire toolkit, but only from the test that you have selected. The code coverage report will be generated in HTML and will be presented with Firefox.</div></td></tr>
</table>Andinethttps://public.kitware.com/Wiki/index.php?title=ITK/Code_Coverage_Practices&diff=40424&oldid=prevIbanez: Created page with "__TOC__ = Overview = * The target code coverage is 95% * Historically we have only achieved 84%. * The practices described in this page should help us reach the target. = How ..."2011-06-04T20:50:45Z<p>Created page with "__TOC__ = Overview = * The target code coverage is 95% * Historically we have only achieved 84%. * The practices described in this page should help us reach the target. = How ..."</p>
<p><b>New page</b></p><div>__TOC__<br />
<br />
= Overview =<br />
<br />
* The target code coverage is 95%<br />
* Historically we have only achieved 84%.<br />
* The practices described in this page should help us reach the target.<br />
<br />
= How to compute Code Coverage locally =<br />
<br />
== Step 1 ==<br />
<br />
* Use Linux or Mac<br />
<br />
== Step 2 ==<br />
<br />
* Add the CMake flags:<br />
<br />
CMAKE_CXX_FLAGS:STRING=-g -O0 -fprofile-arcs -ftest-coverage<br />
CMAKE_C_FLAGS:STRING= -g -O0 -fprofile-arcs -ftest-coverage<br />
<br />
== Step 3 ==<br />
<br />
* Configure to compile ITK for Debug<br />
* by setting the CMake variable<br />
<br />
CMAKE_BUILD_TYPE Debug<br />
<br />
== Step 4 ==<br />
<br />
* From the binary directory type the "ctest" expression that select the tests that you want use to generate coverage (Ideally this should only need to be the unit tests of the class in question).<br />
* For example:<br />
<br />
ctest -R itkHDF5ImageIOTest -V -N<br />
<br />
* This will print to the console the command line instructions needed to run the tests (-V option), but without running the tests (-N option).<br />
<br />
== Step 5 ==<br />
<br />
* From the binary directory type the path to this script in the ITK source tree and add the selection expression that you put in front of ctest.<br />
* For example:<br />
<br />
computeCodeCoverageLocallyForOneTest.sh -R itkHDF5ImageIOTest<br />
<br />
* This will run the selected tests in ITK and generate code coverage for the entire toolkit, but only from the test that you have selected. The code coverage report will be generated in HTML and will be presented with Firefox.</div>Ibanez