从Android Studio运行Kotlin Koans测试
Windows 10、Android Studio 3.0。从Android Studio运行Kotlin Koans测试,android,unit-testing,kotlin,Android,Unit Testing,Kotlin,Windows 10、Android Studio 3.0。 所以我刚刚从master branch克隆了Kotlin Koans repo,并尝试以两种不同的方式运行测试: 1.使用IDE,当我按下测试方法旁边的绿色箭头时,我看到: Process finished with exit code 1 Class not found: "i_introduction._0_Hello_World.N00StartKtTest"Empty test suite. 二,。当我尝试使用Kotlin
所以我刚刚从master branch克隆了Kotlin Koans repo,并尝试以两种不同的方式运行测试:
1.使用IDE,当我按下测试方法旁边的绿色箭头时,我看到:
Process finished with exit code 1
Class not found: "i_introduction._0_Hello_World.N00StartKtTest"Empty test suite.
二,。当我尝试使用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 Studio jdk,这里介绍了它。
我还尝试禁用gradle deamons-结果仍然相同。如果GitHub版本不适合您,您也可以通过IntelliJ插件安装Kotlin Koans 查看此处的说明:您必须使用“任务描述”中的图标“检查任务”(照片附件中的绿色图标)来测试您的实现。
尝试按照说明将其作为gradle项目导入。我不知道它应该如何工作,但如果您在terminal中编写
/gradlew test
,则可以运行单独的单元测试