tree: ae1facacee25b1cee7c61f431d9f04781eab037d [path history] [tgz]
  1. src/
  2. build.gradle.kts
  3. gradle.properties
  4. README.md
kotlin-native/samples/coverage/README.md

Code Coverage usage sample

⚠️ Kotlin/Native support for code coverage is far from beign ready. Anything might be broken.

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.