Skip to content

Commit

Permalink
Exclude test code from jacoco coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
ogolberg authored Mar 25, 2024
1 parent a0e4407 commit a483988
Show file tree
Hide file tree
Showing 29 changed files with 11 additions and 7 deletions.
1 change: 1 addition & 0 deletions tests/base/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
plugins {
`kotlin-conventions`
`java-test-fixtures`
}

9 changes: 5 additions & 4 deletions tests/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
plugins {
`kotlin-conventions`
`java-test-fixtures`
}

configurations.create("lib2") {
Expand All @@ -8,18 +9,18 @@ configurations.create("lib2") {

tasks {
test {
val files = configurations.getByName("lib2").files.map { it.path } + sourceSets.main.get().java.classesDirectory.get().asFile.path
val files = configurations.getByName("lib2").files.map { it.path } + sourceSets.testFixtures.get().java.classesDirectory.get().asFile.path

systemProperty("test-classpath", files.joinToString(separator = ":"))

dependsOn("lib2:jar")
dependsOn("lib2:testFixturesJar")
}
}

dependencies {
implementation(projects.tests.lib1)
testFixturesImplementation(testFixtures(projects.tests.lib1))

add("lib2", projects.tests.lib2)
add("lib2", testFixtures(projects.tests.lib2))

testImplementation(projects.core)
}
3 changes: 2 additions & 1 deletion tests/lib1/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
plugins {
`kotlin-conventions`
`java-test-fixtures`
}

dependencies {
api(projects.tests.base)
testFixturesApi(testFixtures(projects.tests.base))
}
3 changes: 2 additions & 1 deletion tests/lib2/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
plugins {
`kotlin-conventions`
`java-test-fixtures`
}

dependencies {
api(projects.tests.base)
testFixturesApi(testFixtures(projects.tests.base))
}
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ class ExpediterIntegrationTest {

Issue.DuplicateType(
"com/toasttab/expediter/test/Dupe",
listOf("main", "lib2.jar")
listOf("testFixtures", "lib2-test-fixtures.jar")
),

Issue.FinalApplicationSuperType(
Expand Down

0 comments on commit a483988

Please # to comment.