"空的测试套件." 在纯kotlin模块中.(斯波克/ Android装置)

Hyp*_*ype 11 junit android spock kotlin android-studio

我的Android应用程序是多模块项目:

include (android-app/kotlin-android)':application', (pure kotlin)':presentation', (pure kotlin)':domain', (android-library/kotin-android)':dataproviders'
Run Code Online (Sandbox Code Playgroud)

模块:应用程序和:数据提供程序与Spock一起正常运行,测试运行和完成没有问题.但是:表示和:纯kotlin模块的域有spock框架的问题.有我的简单例子:

MostPopularPresenterTest.groovy

class MostPopularPresenterTest extends Specification {

    def "exampleTest"(){
        when:
        int i = 1
        then:
        i == 1
    }
}
Run Code Online (Sandbox Code Playgroud)

此测试以错误结束:

未找到类:"pl.hypeapp.presentation.mostpopular.MostPopularPresenterTest"空测试套件.

但是,用Java/Junit4编写的测试传递良好并且没有抛出任何错误:

MostPopularPresenterTest2.java

public class MostPopularPresenterTest2 {

    @Test
    public void test(){
        assertEquals(1, 1);
    }
}
Run Code Online (Sandbox Code Playgroud)

我正在使用Android Studio 3.0 Canary 5您可以在github上查看我的build.gradle文件:

的build.gradle

dependencies.gradle

application.build.gradle

presentation.build.gradle

有人可以帮助我解决我的问题吗?

编辑:运行/.gradlew测试测试正在运行.

小智 2

打开测试父包上的上下文菜单,然后选择项目“在...中运行测试”