gpt4 book ai didi

android - 纯 kotlin 模块中的 "Empty test suite."。 (斯波克/安卓)

转载 作者:IT老高 更新时间:2023-10-28 13:35:26 25 4
gpt4 key购买 nike

我的安卓应用是多模块项目:

include (android-app/kotlin-android)':application', (pure kotlin)':presentation', (pure kotlin)':domain', (android-library/kotin-android)':dataproviders'

Modules :application 和 :dataproviders 与 Spock 配合良好,测试运行和完成没有问题。但是 :presentation 和 :domain 纯 kotlin 模块在 spock 框架中存在问题。有我的简单例子:

MostPopularPresenterTest.groovy

class MostPopularPresenterTest extends Specification {

def "exampleTest"(){
when:
int i = 1
then:
i == 1
}
}

此测试以错误结束:

Class not found: "pl.hypeapp.presentation.mostpopular.MostPopularPresenterTest"Empty test suite.

但是,用 Java/Junit4 编写的测试通过并没有抛出任何错误:

MostPopularPresenterTest2.java

public class MostPopularPresenterTest2 {

@Test
public void test(){
assertEquals(1, 1);
}
}

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

build.gradle

dependencies.gradle

application.build.gradle

presentation.build.gradle

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

编辑: while running/.gradlew test 正在运行。

最佳答案

在您的测试的父包上打开上下文菜单并选择“在...中运行测试”项

关于android - 纯 kotlin 模块中的 "Empty test suite."。 (斯波克/安卓),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45037602/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com