On 6/08/10 7:31 AM, Adam Murdoch wrote:
 On 6/08/10 7:24 AM, Robert Fletcher wrote:
Unfortunately that event happens before the JUnit report is generated
so the file I need to manipulate won't exist yet (or will get
overwritten immediately afterwards).

You could disable the built-in report, and use the Ant junitreport task to generate it in the afterSuite { } closure:

test {
    testReport = false
    afterSuite {
        ant.junitreport(...)
    }
}


This isn't quite right. You need to check that the suite is the root suite (otherwise you'll generate the report after each test class):

test {
    testReport = false
    afterSuite { suite ->
        if (!suite.parent) {
            ant.junitreport(...)
        }
    }
}


On Thu, Aug 5, 2010 at 8:48 PM, Rene Groeschke<[email protected]> wrote:
hi Robert,

I think the "afterSuite" closure fits here:


test{
    afterSuite{
        if(!it.parent){
            // manipulate the stylesheet file
        }
    }
}

regards,
René

--
------------------------------------
Rene Groeschke

[email protected]
http://www.breskeby.com
http://twitter.com/breskeby
------------------------------------



Am 05.08.10 14:35, schrieb Robert Fletcher:
Hi

I'd like to be able to make a simple customization to the JUnit
report. Specifically I want to append to
$testReportDir/stylesheet.css. If using ant:junitreport directly I
could pass the styleDir parameter and supply a custom XSL file. I
can't see any way to leverage that from Gradle, though. Since what I
want to do is so simple I thought I could just modify the file in
test.doLast. Unfortunately the modification I want to make is really
only useful when the tests fail - it makes the output clearer - and
the test.doLast closure is not run if the tests fail.

I could, I suppose, set ignoreFailures = true, do my modification then
try to detect the test state and fail, but that seems kinda hacky!

Anyone have any ideas?

Cheers,
Rob

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

     http://xircles.codehaus.org/manage_email



--
------------------------------------
Rene Groeschke

[email protected]
http://www.breskeby.com
http://twitter.com/breskeby
------------------------------------


---------------------------------------------------------------------
To unsubscribe from this list, please visit:

   http://xircles.codehaus.org/manage_email



---------------------------------------------------------------------
To unsubscribe from this list, please visit:

     http://xircles.codehaus.org/manage_email





--
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