Setting up integration tests in Android Gradle-based project

后端 未结 1 1717
情深已故
情深已故 2021-02-14 11:58

I\'m following this tutorial to add integration test env to my Android project. I have create src/integrationTest/java and src/integrationTest/resources

1条回答
  •  -上瘾入骨i
    2021-02-14 12:25

    Solved! Actually, these lines don't have to be in source set config, but in the task that runs integration tests. Now, my build.gradle looks like:

        sourceSets {
            integrationTest {
                java.srcDir file('src/integrationTest/java')
                resources.srcDir file('src/integrationTest/resources')
            }
        }
    
        configurations {
            integrationTestCompile.extendsFrom testCompile
        }
    
        task integrationTest(type: Test) {
            testClassesDir = sourceSets.integrationTest.output.classesDir
            classpath = sourceSets.integrationTest.runtimeClasspath
        }
    

    0 讨论(0)
提交回复
热议问题