Skip to content

Instantly share code, notes, and snippets.

@kellyrob99
Created June 14, 2011 22:31
Show Gist options
  • Save kellyrob99/1026097 to your computer and use it in GitHub Desktop.
Save kellyrob99/1026097 to your computer and use it in GitHub Desktop.
Gradle rule to execute arbitrary groups of tests in isolation
/**
* Add a rule that supports executing tests based on a series of comma delimited patterns(ant glob patterns).
*/
tasks.addRule("Pattern: testMulti<Name>,<Name2> will test **/<Name>.class,**/<Name2>.class") {String taskName ->
if (taskName.startsWith("testMulti"))
{
tasks.add(taskName).dependsOn(test)
test.includes = taskName.substring(9).split(',').collect {"**/${it}.class"}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment