I am adding unit tests to my existing Android Studio project and I am a bit confused about the setup. In particular, the androidTest vs instrumentTest flags in a gradle script. Can someone explain the differences between the two sections and the fact that they are aimed against the other.
My project was migrated from an Eclipse project, so it does not have a gradle default structure. Here is what I played with:
androidTest { setRoot('tests') java.srcDirs = ['tests/src'] } instrumentTest { setRoot('tests') java.srcDirs = ['tests/src'] manifest.srcFile file('tests/AndroidManifest.xml') }
Is there a reason to have both?
source share