From: Phlip on
Hypo Nt:

Here's xmlrunner.py:

http://www.rittau.org/python/xmlrunner.py

you attach it to your developer tests, and it emits a file called
"TEST-unittest.TestSuite.xml", containing auspicious wackiness like
this:

<testcase
classname="tests.unit.gateways.authorize_net_tests.AuthorizeNetTests"
name="test_failed_credit" time="0.0017"></testcase>
<testcase
classname="tests.unit.gateways.authorize_net_tests.AuthorizeNetTests"
name="test_fraudulent_avs_result" time="0.0010"></testcase>
<testcase
classname="tests.unit.gateways.authorize_net_tests.AuthorizeNetTests"
name="test_fraudulent_cvv_result" time="0.0011"></testcase>

That looks just like the kind of stereotypical XML that XSL was
designed to convert into HTML, for civilian reading! All the verbiage
for XML test runners claim they do JUnit output, so that JUnit XSL
files can convert them into HTML.

So here's a sample JUNIT.XSL:

http://www.google.com/codesearch/p?hl=en#T32D24pjTaw/trunk/test-integration-ui/resources/test-plugins/org.eclipse.swtbot.eclipse.junit4.headless_2.0.0.329-dev/JUNIT.XSL

It contains matchers like these:

<xsl:template match="testcase" mode="print.test">

And when I run it with this command line...

xsltproc JUNIT.XSL TEST-unittest.TestSuite.xml

....it outputs nothing!

Long story short, how do I format my test output prettily? All the
bloggage on this seems to assume that everyone already knows this
because _everyone_ graduated to Python thru Java...

--
Phlip
http://c2.com/cgi/wiki?ZeekLand
From: Phlip on
On Jun 3, 9:47 am, Phlip <phlip2...(a)gmail.com> wrote:
> Hypo Nt:
>
> Here's xmlrunner.py:
>
>  http://www.rittau.org/python/xmlrunner.py
>
> you attach it to your developer tests, and it emits a file called
> "TEST-unittest.TestSuite.xml", containing auspicious wackiness like
> this:
>
>   <testcase
> classname="tests.unit.gateways.authorize_net_tests.AuthorizeNetTests"
> name="test_failed_credit" time="0.0017"></testcase>
>   <testcase
> classname="tests.unit.gateways.authorize_net_tests.AuthorizeNetTests"
> name="test_fraudulent_avs_result" time="0.0010"></testcase>
>   <testcase
> classname="tests.unit.gateways.authorize_net_tests.AuthorizeNetTests"
> name="test_fraudulent_cvv_result" time="0.0011"></testcase>
>
> That looks just like the kind of stereotypical XML thatXSLwas
> designed to convert into HTML, for civilian reading! All the verbiage
> for XML test runners claim they do JUnit output, so that JUnitXSL
> files can convert them into HTML.
>
> So here's a sample JUNIT.XSL:
>
> http://www.google.com/codesearch/p?hl=en#T32D24pjTaw/trunk/test-integ....
>
> It contains matchers like these:
>
>   <xsl:template match="testcase" mode="print.test">
>
> And when I run it with this command line...
>
>    xsltproc JUNIT.XSLTEST-unittest.TestSuite.xml
>
> ...it outputs nothing!
>
> Long story short, how do I format my test output prettily? All the
> bloggage on this seems to assume that everyone already knows this
> because _everyone_ graduated to Python thru Java...

Bump? Anyone reporting on their unit tests here?