Files
kotlin-fork/kotlin-native/samples/coverage
Sergey Bogolepov eb54689801 Update coverage sample documentation.
We need to invoke `llvm-profdata` tool from
the same toolchain as Clang (on macOS we use the one from Xcode).

(cherry picked from commit 91665b36af68b7fb3a56c0e7ed7ebb7d819adfb2)
2021-03-09 20:19:37 +00:00
..

Code Coverage usage sample

This example shows how to collect coverage information during execution of the test suite. Please note that this functionality will be incorporated into Gradle plugin so you won't need to do it by hand in the nearest future.

Prerequisites

createCoverageReport task requires llvm-profdata and llvm-cov to be added to the $PATH.
In case of macOS, use tools from Xcode (/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin).
For Windows and Linux, use the ones from Kotlin/Native LLVM distribution (e.g. $HOME/.konan/dependencies/clang-llvm-8.0.0-linux-x86-64/bin).

Usage

Just run createCoverageReport task.