从Android Studio运行Kotlin Koans测试 [英] Run Kotlin Koans tests from Android Studio
问题描述
Windows 10,Android Studio 3.0.
因此,我只是从master分支克隆了Kotlin Koans存储库,并尝试以两种不同的方式运行测试:
1.使用IDE,当我按下测试方法旁边的绿色箭头时,我会看到:
Windows 10, Android Studio 3.0.
So I just cloned Kotlin Koans repo from master branch and tried to run tests in two different ways:
1. Using IDE, when I press the green arrow next to the test method I see:
Process finished with exit code 1
Class not found: "i_introduction._0_Hello_World.N00StartKtTest"Empty test suite.
2.当我尝试使用Kotlin Koans自述文件中所述的终端机时:
2. And when I try to use terminal as described in Kotlin Koans Readme:
gradlew test --tests i_*
它给我的输出是:
:compileKotlin
Using kotlin incremental compilation
Caught an exception trying to connect to Kotlin Daemon
java.lang.ClassNotFoundException: com.sun.tools.javac.util.Context
我已经看到很多建议,说jdk文件夹中可能缺少tools.jar,我使用的是内部Android Studios jdk,它在此处介绍. 我还尝试禁用Gradle Deamons-结果仍然相同.
I've seen a lot of suggestions that there might be tools.jar missing in jdk folder, I am using internal Android Studios jdk and it's presented here. I also tried to disable gradle deamons - result is still the same.
推荐答案
如果GitHub版本不适合您,您还可以通过IntelliJ插件安装Kotlin Koans.
If the GitHub version is not working for you, you can also install Kotlin Koans via IntelliJ plugin.
在此处查看说明: https://kotlinlang.org/docs /tutorials/edu-tools-learner.html
这篇关于从Android Studio运行Kotlin Koans测试的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!