Mgj
06/23/2020, 11:45 AMmbonnin
06/23/2020, 11:47 AM./gradlew jvmTest
?Mgj
06/23/2020, 11:48 AMmbonnin
06/23/2020, 11:56 AMjvm()
as a target to your kotlin {}
block? According to https://kotlinlang.org/docs/reference/building-mpp-with-gradle.html#running-tests, there should be a jvmTest
targetMgj
06/23/2020, 12:00 PMAs the commonTest default source set is added to all test compilations, tests and test tools that are needed on all target platforms may be placed there.
Tijl
06/23/2020, 12:18 PMandylamax
06/23/2020, 12:22 PMandroid
, adding jvm()
isn't advised. Coz you already have an android()
target. And that's what the IntelliJ plugin does in a mobile multiplatform projectmbonnin
06/23/2020, 12:25 PM./gradlew androidTest
? Is there such a task?Mgj
06/23/2020, 12:28 PMtest
and testDebugUnitTest
taskmbonnin
06/23/2020, 12:29 PMtestDebugUnitTest
is what you want in the end, that shouldn't run iOS tests, right?Mgj
06/23/2020, 12:30 PMtest
actually seems to not use platform tests either 🤷Kris Wong
06/23/2020, 12:57 PMMgj
06/23/2020, 12:58 PMKris Wong
06/23/2020, 12:58 PMTijl
06/23/2020, 1:05 PMMgj
06/23/2020, 1:07 PMTijl
06/23/2020, 1:08 PMjvm
target.
keep in mind that if you start adding libraries that have common code+platform implementation you’re not testing the android or ios implementation thoughjvm
can be convinient some times (with some gradle tooling etc)Mgj
06/23/2020, 1:12 PMrusshwolf
06/23/2020, 3:20 PMtestDebugUnitTest
is the task you want if you have an Android target and want to do the same thing you would have done to run Android unit tests in a non-MPP project. Adding a JVM target will probably overcomplicate things if you're just doing it for tests.Mgj
06/23/2020, 5:44 PMrusshwolf
06/23/2020, 5:50 PMcommonTest
will be platform-agnostic. But you still need to call a platform-specific task to run them (or run on all platforms with ./gradlew allTests
)Mgj
06/23/2020, 5:52 PM