On Oct 5, 2008, at 9:24 PM, Adam Murdoch wrote:
Russel Winder wrote:
I have a class in my test hierarchy that is a support class for the
tests, it has no tests in itself. Gant, Maven, Ant, SCons are OK
with
this, but Gradle is flagging this as a test failure: it seems Gradle
asserts that all classes in the test hierarchy must have one or more
test cases.
I think this is due to 2 things:
- The test task by default attempts to run every class in the test
hierarchy as a junit test class, and
- Junit asserts that every class it is given has some test cases in
it.
You can change which classes are treated as test classes using the
test task's include() and exclude() methods:
test {
include '**/*.Test.class'
exclude '**/Abstract*'
}
Having the test task run everything is not a particularly good
default. We should pick a convention for test class naming, use it
as the default, and allow you override the convention if you care.
We could possibly also filter out classes which aren't test classes
(eg abstract classes), regardless of the naming scheme we choose.
That would make a lot of sense. Right now we simply delegate to the
Ant JUnit task and Gradle simply exposes the limitations of this Ant
task. When we do the work to integrate TestNG I think that would be a
good time to write our own test runners and create our own better
filters. I think the default should be that regardless of the name
any executable TestCase should be executed.
- Hans
--
Hans Dockter
Gradle Project lead
http://www.gradle.org
---------------------------------------------------------------------
To unsubscribe from this list, please visit:
http://xircles.codehaus.org/manage_email