On 24/05/10 10:40 AM, pchung24 wrote:
Hi,

What would be a way to repeat a task multiple times. I would like to repeat
the test of a project which deals with concurrency a number of times.


I'm curious why you want to do this, if you don't mind me asking?

You could probably do something at the test framework level, for example, using a custom JUnit Runner and @RunWith.

Alternatively, to do this at the Gradle task level, you'd need to add multiple instances of the test task. Something like:

5.times {
    task "test$it"(type: Test) {
        testResultsDir = new File(project.testResultsDir, it)
        testReportDir = new File(project.testReportDir, it)
    }
    check.dependsOn "test$it"
}

You need to give each task instance it's own results and report dir, otherwise they scribble over the results of the other instances. This is arguably a poor choice of defaults.

Statistical test execution might be a good thing for Gradle to support, where a certain set of tests are executed multiple times, possibly concurrently, possibly in various different environments, and an aggregate report is produced at the end. The test execution stuff in Gradle 0.9 provides us with the infrastructure to start doing interesting things like this.


--

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