Can I create html reports per test task?

Hi,

I have a project with different tes tasks. They maybe contain same testclasses which run against different environments. Can I create the html report per test task?

I have tried:

project.tasks.withType(Test).each {

Test test-> test.reports.html.destination = file(“build/myreports/”+ test.name) }

but that doesn’t work

Do I have an error in my Buildfile or have I found a bug?

Cheers Markus

can you try

project.tasks.withType(Test) {Test test ->
    test.reports.html.destination = file("build/myreports/"+ test.name)
}

in this snippet we got rid of the “.each”. this means the configuration is applied lazy, also for tasks declared later in your build

does that work for you?

Hi Rene,

thanks for your answer. That doesn’t make a difference, sorry. Do you have any other suggestion for me? I am using gradle 2.2.1.

Cheers Markus