What is the difference between these two import statements? (in build.gradle
):
testCompile 'junit:junit:4.12'
androidTestCompile 'junit:junit:4.12'
There's a great answer here explaining the difference:
Simply
testCompile
is the configuration for unit tests (located insrc/test
) andandroidTestCompile
is used for the test API (located insrc/androidTest
)....
The main distinction between the two is the
test
sourceset runs in a regular Java JVM, whereas theandroidTest
sourceset tests run on an Android device (or an emulator).
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.