On 1/06/10 1:29 AM, szczepiq wrote:
Hey guys,

I cannot get include/exclude to work with 'test' task. Here's my gradle:

ant.importBuild 'build.xml'

usePlugin 'java'

test {
  testClassesDir = file('../automatedbuild/classes')
  scanForTestClasses = false
  include = '**/CreditLimitsTest.class'
  forkEvery = null
  exclude = '**/*.*'
}

The problem is that it always picks up all tests for execution, rather than the single one I expect. I played with various configuration entries but it always picks up all tests.


There's no 'include' or 'exclude' property on Test. The properties are actually called 'includes' and 'excludes'. So, test { include = '...' } is simply setting a dynamic property called 'include' on the test task. Which doesn't do anything.

You need to set the 'includes' property: test { includes = [ '...' ] } or use the include() convenience method: test { include '...' }

Things like this make me wonder whether dynamic properties for tasks (and projects) are actually a bad idea.


--
Adam Murdoch
Gradle Developer
http://www.gradle.org
CTO, Gradle Inc. - Gradle Training, Support, Consulting
http://www.gradle.biz


---------------------------------------------------------------------
To unsubscribe from this list, please visit:

   http://xircles.codehaus.org/manage_email


Reply via email to