Leonid Startsev | e721ebe | 2021-10-29 14:41:49 +0300 | [diff] [blame] | 1 | /* |
| 2 | * Copyright 2017-2021 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license. |
| 3 | */ |
| 4 | |
| 5 | apply plugin: 'kover' |
| 6 | |
| 7 | tasks.withType(Test) { task -> |
Leonid Startsev | e721ebe | 2021-10-29 14:41:49 +0300 | [diff] [blame] | 8 | kover { |
| 9 | enabled = rootProject.ext.koverEnabled |
Vsevolod Tolstopyatov | 51ccccf | 2021-11-22 19:50:18 +0300 | [diff] [blame] | 10 | |
| 11 | } |
| 12 | } |
| 13 | tasks.koverVerify { |
| 14 | // Core is mainly uncovered because a lot of serializers are tested with JSON |
Clara Fok | 93e1812 | 2024-04-23 10:28:10 -0700 | [diff] [blame] | 15 | def minPercentage = (project.name.contains("core") || project.name.contains("properties")|| project.name.contains("json-okio")) ? 44 : 80 |
Vsevolod Tolstopyatov | 51ccccf | 2021-11-22 19:50:18 +0300 | [diff] [blame] | 16 | rule { |
| 17 | name = "Minimal line coverage rate in percents" |
| 18 | bound { |
Leonid Startsev | e721ebe | 2021-10-29 14:41:49 +0300 | [diff] [blame] | 19 | minValue = minPercentage |
| 20 | // valueType is 'COVERED_LINES_PERCENTAGE' by default |
| 21 | } |
| 22 | } |
| 23 | } |