What's a good XSL to translate xmlrunner.py output into a testreport?

P

Phlip

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?...lipse.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...
 
P

Phlip

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

Stefan Behnel

Phlip, 06.06.2010 19:12:
Bump? Anyone reporting on their unit tests here?

I only use XML reporting in combination with the Hudson-CI tool. It parses
the output and (amongst other things) reports the results over a serious of
builds through its web site. It's also very easy to set up, so maybe that's
what you are actually looking for?

Stefan
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,768
Messages
2,569,574
Members
45,051
Latest member
CarleyMcCr

Latest Threads

Top