I've seen a lot of tutorials and helper projects for doing testing on an Android Studio / Gradle project. I'm curious about the naming convention of the the test folder. I've seen two similar namings : test
and androidTest
. Is there any real difference? Is the IDE / Gradle framework treating these differently?
- app
- src
- androidTest
- java
- main
- java
- res
- androidTest
- src
versus
- app
- src
- test
- java
- main
- java
- res
- test
- src
EDIT:
@jonalmeida So if I read that documentation correctly, my build.gradle
file dependencies need to match the sourceSet, right?
dependencies {
// dependency injection
compile 'com.squareup.dagger:dagger:1.2.1'
provided 'com.squareup.dagger:dagger-compiler:1.2.1'
// networking
compile 'com.squareup.retrofit:retrofit:1.6.1'
// testing
androidTestCompile 'org.easytesting:fest:1.0.16'
androidTestCompile 'junit:junit:4.+'
androidTestCompile 'org.robolectric:robolectric:2.3'
testCompile 'com.squareup:fest-android:1.0.8' // <---- this guy won't work
}