简体   繁体   中英

“Empty test suite.” in pure kotlin module. (Spock/Android)

My android app is multi module project:

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

Modules :application and :dataproviders working fine with Spock, test running and completing without problems. But :presentation and :domain which are pure kotlin modules have problem with spock framework. There are my simple examples:

MostPopularPresenterTest.groovy

class MostPopularPresenterTest extends Specification {

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

This test end with error:

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

But, test written in Java/Junit4 passing well and did not throw any error:

MostPopularPresenterTest2.java

public class MostPopularPresenterTest2 {

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

I'm using Android Studio 3.0 Canary 5 You can look at my build.gradle files at github:

build.gradle

dependencies.gradle

application.build.gradle

presentation.build.gradle

Can someone help me with my problem?

EDIT: while ran /.gradlew test test are running.

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM