Windows 10,Android Studio 3.0。
所以我只是从主分支克隆了Kotlin Koans仓库,并尝试以两种不同的方式运行测试:
1.使用IDE时,当我按下测试方法旁边的绿色箭头时,我会看到:
Process finished with exit code 1
Class not found: "i_introduction._0_Hello_World.N00StartKtTest"Empty test suite.
2. 当我按照 Kotlin Koans 自述中的描述尝试使用终端时:
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 - 结果仍然相同。
./gradlew test
,那么你就可以运行单独的单元测试。 - murt