lundi 2 mars 2015

Android Studio Gradle androidTest vs instrumentTest

I'm adding unit tests to my existing Android Studio project and I'm a bit confused with the setup. Particularly, the androidTest vs instrumentTest flags within the gradle script. Can someone explain the different between these 2 sections and what exactly they target vs the other.


My project was migrated from an Eclipse project, so it does not have the default gradle structure. Here's what I've been playing around with:



androidTest {
setRoot('tests')
java.srcDirs = ['tests/src']
}

instrumentTest {
setRoot('tests')
java.srcDirs = ['tests/src']
manifest.srcFile file('tests/AndroidManifest.xml')
}


Is there any reason to have both?


Aucun commentaire:

Enregistrer un commentaire