mirror of
https://github.com/XRPLF/rippled.git
synced 2025-11-20 11:05:54 +00:00
deploy: 03704f712b
This commit is contained in:
@@ -337,12 +337,11 @@ Coverage report</h2>
|
||||
<p>A coverage report is created when the following steps are completed, in order:</p>
|
||||
<ol type="1">
|
||||
<li><code>rippled</code> binary built with instrumentation data, enabled by the <code>coverage</code> option mentioned above</li>
|
||||
<li>completed run of unit tests, which populates coverage capture data</li>
|
||||
<li>completed one or more run of the unit tests, which populates coverage capture data</li>
|
||||
<li>completed run of the <code>gcovr</code> tool (which internally invokes either <code>gcov</code> or <code>llvm-cov</code>) to assemble both instrumentation data and the coverage capture data into a coverage report</li>
|
||||
</ol>
|
||||
<p>The above steps are automated into a single target <code>coverage</code>. The instrumented <code>rippled</code> binary can also be used for regular development or testing work, at the cost of extra disk space utilization and a small performance hit (to store coverage capture). In case of a spurious failure of unit tests, it is possible to re-run the <code>coverage</code> target without rebuilding the <code>rippled</code> binary (since it is simply a dependency of the coverage report target). It is also possible to select only specific tests for the purpose of the coverage report, by setting the <code>coverage_test</code> variable in <code>cmake</code></p>
|
||||
<p>The last step of the above is automated into a single target <code>coverage</code>. The instrumented <code>rippled</code> binary can also be used for regular development or testing work, at the cost of extra disk space utilization and a small performance hit (to store coverage capture data). Since <code>rippled</code> binary is simply a dependency of the coverage report target, it is possible to re-run the <code>coverage</code> target without rebuilding the <code>rippled</code> binary. Note, running of the unit tests before the <code>coverage</code> target is left to the developer. Each such run will append to the coverage data collected in the build directory.</p>
|
||||
<p>The default coverage report format is <code>html-details</code>, but the user can override it to any of the formats listed in <code>Builds/CMake/CodeCoverage.cmake</code> by setting the <code>coverage_format</code> variable in <code>cmake</code>. It is also possible to generate more than one format at a time by setting the <code>coverage_extra_args</code> variable in <code>cmake</code>. The specific command line used to run the <code>gcovr</code> tool will be displayed if the <code>CODE_COVERAGE_VERBOSE</code> variable is set.</p>
|
||||
<p>By default, the code coverage tool runs parallel unit tests with <code>--unittest-jobs</code> set to the number of available CPU cores. This may cause spurious test errors on Apple. Developers can override the number of unit test jobs with the <code>coverage_test_parallelism</code> variable in <code>cmake</code>.</p>
|
||||
<p>Example use with some cmake variables set:</p>
|
||||
<div class="fragment"><div class="line">cd .build</div>
|
||||
<div class="line">conan install .. --output-folder . --build missing --settings build_type=Debug</div>
|
||||
|
||||
Reference in New Issue
Block a user