blob: fa567028ef955655d481cd64b66767d396646e87 [file] [log] [blame]
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>CTestCoverageCollectGCOV &mdash; CMake 3.8.2 Documentation</title>
<link rel="stylesheet" href="../_static/cmake.css" type="text/css" />
<link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT: '../',
VERSION: '3.8.2',
COLLAPSE_INDEX: false,
FILE_SUFFIX: '.html',
HAS_SOURCE: true,
SOURCELINK_SUFFIX: '.txt'
};
</script>
<script type="text/javascript" src="../_static/jquery.js"></script>
<script type="text/javascript" src="../_static/underscore.js"></script>
<script type="text/javascript" src="../_static/doctools.js"></script>
<link rel="shortcut icon" href="../_static/cmake-favicon.ico"/>
<link rel="index" title="Index" href="../genindex.html" />
<link rel="search" title="Search" href="../search.html" />
<link rel="next" title="CTestScriptMode" href="CTestScriptMode.html" />
<link rel="prev" title="CTest" href="CTest.html" />
</head>
<body role="document">
<div class="related" role="navigation" aria-label="related navigation">
<h3>Navigation</h3>
<ul>
<li class="right" style="margin-right: 10px">
<a href="../genindex.html" title="General Index"
accesskey="I">index</a></li>
<li class="right" >
<a href="CTestScriptMode.html" title="CTestScriptMode"
accesskey="N">next</a> |</li>
<li class="right" >
<a href="CTest.html" title="CTest"
accesskey="P">previous</a> |</li>
<li>
<img src="../_static/cmake-logo-16.png" alt=""
style="vertical-align: middle; margin-top: -2px" />
</li>
<li>
<a href="https://cmake.org/">CMake</a> &#187;
</li>
<li>
<a href="../index.html">3.8.2 Documentation</a> &#187;
</li>
<li class="nav-item nav-item-1"><a href="../manual/cmake-modules.7.html" accesskey="U">cmake-modules(7)</a> &#187;</li>
</ul>
</div>
<div class="document">
<div class="documentwrapper">
<div class="bodywrapper">
<div class="body" role="main">
<div class="section" id="ctestcoveragecollectgcov">
<span id="module:CTestCoverageCollectGCOV"></span><h1>CTestCoverageCollectGCOV<a class="headerlink" href="#ctestcoveragecollectgcov" title="Permalink to this headline"></a></h1>
<p>This module provides the <code class="docutils literal"><span class="pre">ctest_coverage_collect_gcov</span></code> function.</p>
<p>This function runs gcov on all .gcda files found in the binary tree
and packages the resulting .gcov files into a tar file.
This tarball also contains the following:</p>
<ul class="simple">
<li><em>data.json</em> defines the source and build directories for use by CDash.</li>
<li><em>Labels.json</em> indicates any <span class="target" id="index-0-prop_sf:LABELS"></span><a class="reference internal" href="../prop_sf/LABELS.html#prop_sf:LABELS" title="LABELS"><code class="xref cmake cmake-prop_sf docutils literal"><span class="pre">LABELS</span></code></a> that have been set on the
source files.</li>
<li>The <em>uncovered</em> directory holds any uncovered files found by
<span class="target" id="index-0-variable:CTEST_EXTRA_COVERAGE_GLOB"></span><a class="reference internal" href="../variable/CTEST_EXTRA_COVERAGE_GLOB.html#variable:CTEST_EXTRA_COVERAGE_GLOB" title="CTEST_EXTRA_COVERAGE_GLOB"><code class="xref cmake cmake-variable docutils literal"><span class="pre">CTEST_EXTRA_COVERAGE_GLOB</span></code></a>.</li>
</ul>
<p>After generating this tar file, it can be sent to CDash for display with the
<span class="target" id="index-0-command:ctest_submit"></span><a class="reference internal" href="../command/ctest_submit.html#command:ctest_submit" title="ctest_submit"><code class="xref cmake cmake-command docutils literal"><span class="pre">ctest_submit(CDASH_UPLOAD)</span></code></a> command.</p>
<dl class="command">
<dt id="command:cdash_coverage_collect_gcov">
<code class="descname">cdash_coverage_collect_gcov</code><a class="headerlink" href="#command:cdash_coverage_collect_gcov" title="Permalink to this definition"></a></dt>
<dd><div class="highlight-default"><div class="highlight"><pre><span></span><span class="n">ctest_coverage_collect_gcov</span><span class="p">(</span><span class="n">TARBALL</span> <span class="o">&lt;</span><span class="n">tarfile</span><span class="o">&gt;</span>
<span class="p">[</span><span class="n">SOURCE</span> <span class="o">&lt;</span><span class="n">source_dir</span><span class="o">&gt;</span><span class="p">][</span><span class="n">BUILD</span> <span class="o">&lt;</span><span class="n">build_dir</span><span class="o">&gt;</span><span class="p">]</span>
<span class="p">[</span><span class="n">GCOV_COMMAND</span> <span class="o">&lt;</span><span class="n">gcov_command</span><span class="o">&gt;</span><span class="p">]</span>
<span class="p">[</span><span class="n">GCOV_OPTIONS</span> <span class="o">&lt;</span><span class="n">options</span><span class="o">&gt;...</span><span class="p">]</span>
<span class="p">)</span>
</pre></div>
</div>
<p>Run gcov and package a tar file for CDash. The options are:</p>
<dl class="docutils">
<dt><code class="docutils literal"><span class="pre">TARBALL</span> <span class="pre">&lt;tarfile&gt;</span></code></dt>
<dd>Specify the location of the <code class="docutils literal"><span class="pre">.tar</span></code> file to be created for later
upload to CDash. Relative paths will be interpreted with respect
to the top-level build directory.</dd>
<dt><code class="docutils literal"><span class="pre">SOURCE</span> <span class="pre">&lt;source_dir&gt;</span></code></dt>
<dd>Specify the top-level source directory for the build.
Default is the value of <span class="target" id="index-0-variable:CTEST_SOURCE_DIRECTORY"></span><a class="reference internal" href="../variable/CTEST_SOURCE_DIRECTORY.html#variable:CTEST_SOURCE_DIRECTORY" title="CTEST_SOURCE_DIRECTORY"><code class="xref cmake cmake-variable docutils literal"><span class="pre">CTEST_SOURCE_DIRECTORY</span></code></a>.</dd>
<dt><code class="docutils literal"><span class="pre">BUILD</span> <span class="pre">&lt;build_dir&gt;</span></code></dt>
<dd>Specify the top-level build directory for the build.
Default is the value of <span class="target" id="index-0-variable:CTEST_BINARY_DIRECTORY"></span><a class="reference internal" href="../variable/CTEST_BINARY_DIRECTORY.html#variable:CTEST_BINARY_DIRECTORY" title="CTEST_BINARY_DIRECTORY"><code class="xref cmake cmake-variable docutils literal"><span class="pre">CTEST_BINARY_DIRECTORY</span></code></a>.</dd>
<dt><code class="docutils literal"><span class="pre">GCOV_COMMAND</span> <span class="pre">&lt;gcov_command&gt;</span></code></dt>
<dd>Specify the full path to the <code class="docutils literal"><span class="pre">gcov</span></code> command on the machine.
Default is the value of <span class="target" id="index-0-variable:CTEST_COVERAGE_COMMAND"></span><a class="reference internal" href="../variable/CTEST_COVERAGE_COMMAND.html#variable:CTEST_COVERAGE_COMMAND" title="CTEST_COVERAGE_COMMAND"><code class="xref cmake cmake-variable docutils literal"><span class="pre">CTEST_COVERAGE_COMMAND</span></code></a>.</dd>
<dt><code class="docutils literal"><span class="pre">GCOV_OPTIONS</span> <span class="pre">&lt;options&gt;...</span></code></dt>
<dd>Specify options to be passed to gcov. The <code class="docutils literal"><span class="pre">gcov</span></code> command
is run as <code class="docutils literal"><span class="pre">gcov</span> <span class="pre">&lt;options&gt;...</span> <span class="pre">-o</span> <span class="pre">&lt;gcov-dir&gt;</span> <span class="pre">&lt;file&gt;.gcda</span></code>.
If not specified, the default option is just <code class="docutils literal"><span class="pre">-b</span></code>.</dd>
<dt><code class="docutils literal"><span class="pre">GLOB</span></code></dt>
<dd>Recursively search for .gcda files in build_dir rather than
determining search locations by reading TargetDirectories.txt.</dd>
<dt><code class="docutils literal"><span class="pre">DELETE</span></code></dt>
<dd>Delete coverage files after they&#8217;ve been packaged into the .tar.</dd>
<dt><code class="docutils literal"><span class="pre">QUIET</span></code></dt>
<dd>Suppress non-error messages that otherwise would have been
printed out by this function.</dd>
</dl>
</dd></dl>
</div>
</div>
</div>
</div>
<div class="sphinxsidebar" role="navigation" aria-label="main navigation">
<div class="sphinxsidebarwrapper">
<h4>Previous topic</h4>
<p class="topless"><a href="CTest.html"
title="previous chapter">CTest</a></p>
<h4>Next topic</h4>
<p class="topless"><a href="CTestScriptMode.html"
title="next chapter">CTestScriptMode</a></p>
<div role="note" aria-label="source link">
<h3>This Page</h3>
<ul class="this-page-menu">
<li><a href="../_sources/module/CTestCoverageCollectGCOV.rst.txt"
rel="nofollow">Show Source</a></li>
</ul>
</div>
<div id="searchbox" style="display: none" role="search">
<h3>Quick search</h3>
<form class="search" action="../search.html" method="get">
<div><input type="text" name="q" /></div>
<div><input type="submit" value="Go" /></div>
<input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" />
</form>
</div>
<script type="text/javascript">$('#searchbox').show(0);</script>
</div>
</div>
<div class="clearer"></div>
</div>
<div class="related" role="navigation" aria-label="related navigation">
<h3>Navigation</h3>
<ul>
<li class="right" style="margin-right: 10px">
<a href="../genindex.html" title="General Index"
>index</a></li>
<li class="right" >
<a href="CTestScriptMode.html" title="CTestScriptMode"
>next</a> |</li>
<li class="right" >
<a href="CTest.html" title="CTest"
>previous</a> |</li>
<li>
<img src="../_static/cmake-logo-16.png" alt=""
style="vertical-align: middle; margin-top: -2px" />
</li>
<li>
<a href="https://cmake.org/">CMake</a> &#187;
</li>
<li>
<a href="../index.html">3.8.2 Documentation</a> &#187;
</li>
<li class="nav-item nav-item-1"><a href="../manual/cmake-modules.7.html" >cmake-modules(7)</a> &#187;</li>
</ul>
</div>
<div class="footer" role="contentinfo">
&#169; Copyright 2000-2017 Kitware, Inc. and Contributors.
Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.5.2.
</div>
</body>
</html>