jw
06/03/2021, 2:29 AMjsTest { kotlin { exclude '..' } }
but it seems to have no effect. my current workaround is to eliminate the commonTest srcDir and add it as a srcDir to each platform-specific target's test source set and then do the excludelouiscad
06/03/2021, 2:55 AMallButJsTest
and make all platform specific test sourceSets but the js one depend on it in the Gradle DSL.jw
06/03/2021, 3:01 AMlouiscad
06/03/2021, 3:04 AMjw
06/03/2021, 3:06 AMlouiscad
06/03/2021, 3:09 AMjw
06/03/2021, 3:10 AMlouiscad
06/03/2021, 3:17 AMTijl
06/04/2021, 8:31 AMjsTest
has a preconfigured dependsOn
commonTest
, and the filtering only applies on the sourceSet itself, so jsTest
and not the sourceSets it depends on (commonTest
)
Rather than adding a srcDir to a platform set you could make your own common SourceSets and then depend on them:
val jvmAndAndroidTest by creating {
dependsOn(commonTest.get())
}
val jvmTest by getting {
dependsOn(jvmAndAndroidTest)
}
val androidLibTest by getting {
dependsOn(jvmAndAndroidTest)
}
in your more granular example you could deepen the tree even more, and to a degree automate it.
However, if you don’t care so much about compiling but more about running, I can recommend creating your own @Test…
annotations that only typealias to @Test
on the platforms they work on, @TestOnlyJvmAndroid
, @TestExcludeNative
etc.
This has a much cleaner folder structure, but of course it does not take care of compilation errors.louiscad
06/04/2021, 10:12 AMjw
06/04/2021, 12:00 PMlouiscad
06/04/2021, 12:02 PMjw
06/04/2021, 12:08 PMlouiscad
06/04/2021, 12:18 PMrusshwolf
06/04/2021, 12:28 PM@Test
and @Ignore
annotations specific to each source-set. IIRC I backed off of it when special-casing Android stuff started to be a pain, but I don't think there were any actual blockers, I just wasn't sure if it'd be useful enough to be worth the effort.louiscad
06/04/2021, 12:30 PMrusshwolf
06/04/2021, 12:32 PMlouiscad
06/04/2021, 12:35 PM