The simplest solution would be this:
test {
exclude '**/SpringTestSuite.class'
}
But all your other attempts work just fine for me too. Note that test class
scanning is automatically turned off as soon as you specify an include
pattern.
I think your problem lies somewhere else. Does running Gradle with the -i
switch confirm that SpringTestSuite gets run? If yes, do you maybe have a
test suite that has SpringTestSuite as one of its children?
--
Peter Niederwieser
Principal Engineer, Gradleware
http://gradleware.com
Creator, Spock Framework
http://spockframework.org
Twitter: @pniederw
blackwolf wrote:
>
> Hi,
>
> I'm having trouble excluding a test, and I was hoping somebody could help
> me.
>
> I have 2 projects: A and B. B has a 'testCompile' dependency on A. A has a
> SpringTestSuite class in main/ and B has a BTestSuite class in test/.
> Initially, I configured B's 'test' task to look like this:
>
> test {
> include '**/*TestSuite.class'
> }
>
> Gradle ran SpringTestSuite from A too. So I tried
>
> test {
> scanForTestClasses = false
> include '**/*TestSuite.class'
> exclude '**/SpringTestSuite.class'
> }
>
> That didn't help. Next I tried
>
> test {
> scanForTestClasses = false
> include '**/*TestSuite.class'
> exclude '**/*'
> }
>
> No tests ran (as expected). Next I tried
>
> test {
> scanForTestClasses = false
> include '**/*TestSuite.class'
> exclude '**/*Spring*'
> }
>
> and Gradle ran SpringTestSuite again.
>
> How do I tell Gradle not to run SpringTestSuite?
>
> Thanks!
>
--
View this message in context:
http://gradle.1045684.n5.nabble.com/test-scanForTestClasses-includes-excludes-don-t-work-properly-tp4851233p4851576.html
Sent from the gradle-user mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe from this list, please visit:
http://xircles.codehaus.org/manage_email