Kotlin多平台项目在IDEA中运行通用模块测试 [英] Kotlin multiplatform projects run common module test in IDEA

查看:214
本文介绍了Kotlin多平台项目在IDEA中运行通用模块测试的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在将kotlin多平台项目与js/jvm子项目一起使用. 我曾经在jvm子项目中进行过单元测试(使用kotlin测试注释进行了注释),并且我可以通过右键单击+使用junit运行"xxx"测试来轻松运行测试.一旦将这些测试移至通用模块,就无法使用该选项.

I am using kotlin multiplatform project with js/jvm subprojects. I used to have unit tests in jvm subproject (annotated using kotlin test annotations) and I easily ran tests using rightclick + Run 'xxx' test using junit. That option is not possible once I move those tests to common module instead.

我仍然可以使用命令行gradle来运行测试,甚至设法创建了有效的运行配置,但是为了方便起见,我缺少类或特定测试方法上的简单右键单击即可运行".

I can still run tests using command line gradle and I even managed to create working Run configuration that worked, but I am missing that simple "right click to run" on class or even specific test method for convenience.

在项目中有什么方法可以实现这一目标吗?

Is there any way to achieve that in project?

谢谢!

推荐答案

您使用哪个Kotlin版本?在1.2.60中存在带有测试装订线的一个错误,但已在即将在下周初发布的下一个发行版本.

Which Kotlin version do you use? There was a bug with test gutters in 1.2.60, but it is fixed in the very next release which is expected to be at the beginning of the next week.

它实际上应该按照您所描述的那样工作,因此,如果不是带有错误的版本,则最好提交它.

It actually should work as you described, so if it's not the version with the bug, then it's better to submit it.

这篇关于Kotlin多平台项目在IDEA中运行通用模块测试的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆