On 11/07/10 11:03 PM, Matthias Bohlen wrote:
Hi,
how do I aggregate junit test reports from all of the subprojects of a
root project in a multi-project build so that I can view them in a
browser, starting from a single index.html?
Here's some options. Neither of them work 100% well.
- You can use Ant's junitreport task, something like:
task testReport {
dependsOn subprojects*.test
doFirst {
ant.junitreport(todir: "$buildDir/testreport") {
subprojects.each { fileset(dir: testResultsDir) }
}
}
}
the problem with this approach is that the task depends on every test
task, which means you cannot easily run it for just a subset of projects.
- You can point the test results and test report dirs of each subproject
to the same place:
subprojects {
testResultsDir = rootProject.testResultsDir
testReportDir = rootProject.testReportDir
}
I think this works better, as that you can run whichever test task you
like, and you'll end up with an aggregate report of whatever tests
happen to have been run. The problem with this approach is that the
report is generated after every test task, which can be a bit expensive.
We do plan to add some kind of aggregate report at some point. Not sure
exactly how this will look, but there will be a single index.html from
which you can navigate to the results of all the tests (and checkstyle
results, and coverage when it happens, and so on).
--
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