Last active
August 29, 2015 14:15
-
-
Save leonschreuder/3f222f8687073c46cd64 to your computer and use it in GitHub Desktop.
Robolectric test specification from the commandline:
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
// Add test classes on the command line. Examples: | |
// gradle test -Dclasses=SomeClassTest // runs test/java/com/bla/SomeClassTest.java | |
// gradle test -Dclasses=*ActivityTest // runs all classes who's name ends in ActivityTest.java | |
// gradle test || gradle test -DClasses=all // both notations include all classes | |
def suppliedClasses = System.getProperty('classes', 'all') | |
if (suppliedClasses == 'all') { | |
println "target: all" | |
include '**/*Test.class' | |
} else { | |
def targetClass = '**/'+suppliedClasses +'.class' | |
println "target: " + targetClass | |
include targetClass | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment