I have a pure Java sub-project within my Android project. I already have a test suite located within src/test/java
, and I wish to introduce a second test suite for integration tests.
I have specified this within my build.gradle
as follows:
sourceSets {
integration {
java {
compileClasspath += test.compileClasspath
runtimeClasspath += test.runtimeClasspath
}
}
}
task integrationTest(type: Test, description: 'Runs the integration tests.', group: 'Verification') {
testClassesDir = sourceSets.integration.output.classesDir
classpath = sourceSets.integration.runtimeClasspath
}
configurations {
integrationCompile.extendsFrom testCompile
integrationRuntime.extendsFrom testRuntime
}
with tests located within src/integration/java
. These tests can be run successfully from the command line, and within Android Studio, the java
folder appears in green like the main test suite.
But when right-clicking and choosing "Run 'All Tests'", I get the errors No tests were found
, Empty test suite.
.
How can I have a second test suite that can be run easily from within Android Studio?