https://kotlinlang.org logo
#multiplatform
Title
# multiplatform
a

addamsson

02/01/2019, 3:42 PM
How can I run tests annotated with
kotlin.test.Test
from the IDE in my
commonTest
module? IDEA doesn't recognize them as tests. Note that I'm using the
kotlin-multiplatform
plugin.
^^^--- Note that there is no green triangle to run it
n

natpryce

02/01/2019, 3:54 PM
You cannot run common tests without a pltform. You need to have at least one platform in the project. Every platform’s tests will also include all the common tests.
a

addamsson

02/01/2019, 5:45 PM
I have a javascript and a jvm module
but my tests are in common
i don't want to move them to any of the other modules
since I don't want to write them twice
a

ankushg

02/01/2019, 8:03 PM
You shouldn't need to move them -- if you run your
jvmTest
task, it should run anything under
jvmTest
and anything under
commonTest
a

addamsson

02/01/2019, 8:15 PM
So what my problem really is
is that I don't have the green triangle icon next to my test methods
so I can't run them when I write them with just pressing a key combination
n

natpryce

02/02/2019, 11:02 AM
Strange. I’ve got a multiplatform project with jvm and macosX64 targets, and IntelliJ shows the “run” icon next to my test methods. But, running from the icon only runs the test on the JVM platform.
So not perfect.
Sounds like the multiplatform support is incomplete in IntelliJ. I suggest raising YouTrack issues for what you find.
a

addamsson

02/02/2019, 2:49 PM
Are you using the
kotlin-multiplatform
plugin? This was working for me before I upgraded to it.
n

natpryce

02/02/2019, 3:00 PM
i am
a

addamsson

02/02/2019, 6:14 PM
hm
maybe they fix this for the next IDEA release