From 14b790cd9272d3381c2d5a0d751decf49e3114da Mon Sep 17 00:00:00 2001 From: SIMULATAN Date: Sun, 15 Dec 2024 17:31:41 +0100 Subject: [PATCH] fix(tests): #108 exclude nonstandard sourceSets from test coverage Fixes #108 --- .../snoty.kotlin-conventions.gradle.kts | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/conventions/project/src/main/kotlin/snoty.kotlin-conventions.gradle.kts b/conventions/project/src/main/kotlin/snoty.kotlin-conventions.gradle.kts index 7058cd25..55388dbd 100644 --- a/conventions/project/src/main/kotlin/snoty.kotlin-conventions.gradle.kts +++ b/conventions/project/src/main/kotlin/snoty.kotlin-conventions.gradle.kts @@ -15,14 +15,17 @@ kover { allProjects() } currentProject { - sources { - // per default, kover only excludes `test` - // since we also have `testIntegration`, we have to exclude it - testing.suites - .filterIsInstance() - .forEach { - excludedSourceSets.add(it.sources.name) - } + // awaiting implementation of https://github.com/Kotlin/kotlinx-kover/issues/714 + afterEvaluate { + sources { + // per default, kover only excludes `test` + // since we also have `testIntegration` and `dev`, we have to exclude them + sourceSets + .filter { it.name != sourceSets.main.name } + .forEach { + excludedSourceSets.add(it.name) + } + } } } }