GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - asarazan/koverage: 100% code coverage for Kotlin

BranchesTags
Open more actions menu

Latest commit

 

History

36 Commits
36 Commits

Folders and files

NameName
Last commit message
Last commit date
app
app
 
 
gradle/wrapper
gradle/wrapper
 
 
koverage
koverage
 
 
.gitignore
.gitignore
 
 
.travis.yml
.travis.yml
 
 
LICENSE
LICENSE
 
 
README.md
README.md
 
 
build.gradle
build.gradle
 
 
gradle.properties
gradle.properties
 
 
gradlew
gradlew
 
 
gradlew.bat
gradlew.bat
 
 
settings.gradle
settings.gradle
 
 

Repository files navigation

koverage Build Status

100% code coverage for Kotlin data classes and other generated kotlin code.

It's a known problem that Kotlin generates a lot of code under the hood, and that standard coverage techniques are not equipped to ignore these paths. This library is a brute force solution that forces the traversal of those paths at test-time, leading to 100% coverage numbers for generated logic.

Get

dependencies {
  testImplementation 'net.sarazan:koverage:1.1.2'
}

Use

For every supported Kotlin class in your project, create a unit test that calls Koverage.cover<YOUR_CLASS_HERE>(). See the app module for an example.

Supported Use Cases

We've tried to hit the most broad use cases, and still fail gracefully if things don't work out. We've confirmed basic compatibility for generated code in the following cases:

  • Field-backed properties
  • Enums
  • Data Classes
  • Companion Objects
  • Singleton Objects

TODO

  • This is not terribly well-tested. There are probably some use cases where it falls over.
  • I suspect it does not do the right thing on field-backed properties with non-default getters/setters.
  • It would be cool to create a gradle plugin that automatically runs Koverage.cover on all detected data classes. PRs welcome!

About

100% code coverage for Kotlin

Resources

Readme
Apache-2.0 license
Activity

Stars

9 stars

Watchers

1 watching

Forks

1 fork
Report repository

Releases

Packages

Contributors

Languages

You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.