Created
March 11, 2015 10:29
-
-
Save up1/420c200abe6393d994d1 to your computer and use it in GitHub Desktop.
Unit test on Android application
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
evaluationDependsOn(":app") | |
apply plugin: 'java' | |
dependencies { | |
def androidModule = project(':app') | |
testCompile project(path: ':app', configuration: 'debugCompile') | |
def debugVariant = androidModule.android.applicationVariants.find({it.name == 'debug'}) | |
testCompile debugVariant.javaCompile.classpath | |
testCompile debugVariant.javaCompile.outputs.files | |
testCompile files(androidModule.plugins.findPlugin("com.android.application").getBootClasspath()) | |
testCompile 'junit:junit:4.+' | |
testCompile 'org.robolectric:robolectric:2.2' | |
testCompile 'org.mockito:mockito-core:1.9.5' | |
} | |
tasks.withType(Test) { | |
scanForTestClasses = false | |
include "**/*Should.class" | |
include "**/*Test.class" | |
include "**/*Tests.class" | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment