We’ll do our best to address this issue before the release. Code coverage doesn’t work with Ninja generator ( CPP-17864).Configuration and known issueĬoverage settings, including custom paths to gcov / llvm-cov / llvm-profdata tools and more, can be found in Settings/Preferences | Build, Execution, Deployment | Coverage:Ī few important known issues are worth mentioning: Do not apply collected coverage data – to simply ignore the current results.Īnother way of exploring the results is to check the color indication in the left gutter in the editor.Ĭlick the gutter area to see how many times the line was hit.Replace active suites – to start from scratch.Add to active suites – to enrich the current results.When rerunning the coverage analysis, CLion will ask you how you’d like the results presented: How to read the resultsĬoverage measurements are located in the Coverage tool window, which shows results per folder (% of files and % of lines covered) and per file (% of lines covered): Or you can click the “Run … with Coverage” button in the Navigation Bar. Now you can run it using the run icon in the left gutter: -fprofile-instr-generate -fcoverage-mapping – for Clang (uses llvm-profdata merge / llvm-cov export, a clang’s instrumentation based profiling).įor example, if you use both GCC and Clang in your project, you may have something like this in your CMakeLists.txt:.-fprofile-arcs -ftest-coverage or an equivalent -coverage – for GCC (uses gcov) and Clang (uses llvm-cov gcov, gcov-style coverage, which means it will compatible with the gcov tool from version 4.2 of GCC).There are a few options depending on what compiler you use and what kind of results you expect: To get coverage measurement, you have to pass special coverage compile options. How to launch a configuration with coverage? The configuration can be either a unit tests run or a regular configuration run. In general, statements coverage answers the question, "Was this statement executed during the configuration run?". A patch-update for anyone using the previous EAP build will be available shortly.Ĭode coverage in CLion relies on llvm-cov/ gcov integration to perform and show you statements coverage measuring for your code. ![]() A new CLion 2019.3 EAP (build 193.4932.12) is now available! Get it from our website, via the Toolbox App, or as a snap package (if you are using Ubuntu).
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |