# Can Test/Unit output in XML?

**URL:** <https://www.ruby-forum.com/t/can-test-unit-output-in-xml/109884>\
**Category:** Ruby\
**Created:** [July 19, 2007, 10:35pm UTC](https://www.ruby-forum.com/t/can-test-unit-output-in-xml/109884 "2007-07-19T22:35:14Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![maung](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/ac91a4/32.png) [@maung](https://www.ruby-forum.com/u/maung)\
**Post date:** [July 19, 2007, 10:35pm UTC](https://www.ruby-forum.com/t/can-test-unit-output-in-xml/109884/1 "2007-07-19T22:35:14Z")

</div>

Hi,

Is there any way that I can get test/unit output file in XML format? Any  
helpful advice would be very appreciated.

Thanks,  
maung

---

<div class="post-metadata">

**Author:** ![maung](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/ac91a4/32.png) [@maung](https://www.ruby-forum.com/u/maung)\
**Post date:** [July 20, 2007, 1:43pm UTC](https://www.ruby-forum.com/t/can-test-unit-output-in-xml/109884/2 "2007-07-20T13:43:05Z")

</div>

On 7/19/07, Maung A. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> Hi,
> 
> Is there any way that I can get test/unit output file in XML format? Any  
> helpful advice would be very appreciated.

There was a TestReport project on RubyForge, but it’s been pulled or  
discontinued. I am looking for some kind of test-reporting tool myself  
actually. Reporting starts to get pretty important when you are  
dealing with tests written by QA.

---

<div class="post-metadata">

**Author:** ![maung](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/ac91a4/32.png) [@maung](https://www.ruby-forum.com/u/maung)\
**Post date:** [July 20, 2007, 3:31pm UTC](https://www.ruby-forum.com/t/can-test-unit-output-in-xml/109884/3 "2007-07-20T15:31:19Z")

</div>

On 7/19/07, Maung A. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> Hi,
> 
> Is there any way that I can get test/unit output file in XML format? Any  
> helpful advice would be very appreciated.

If there’s nothing ready, it should not be hard to createa custom  
runner/outputter that will write xml.

Have a look at test/unit/ui/console/testrunner.rb how it writes to  
console for start.

J.

---

<div class="post-metadata">

**Author:** ![maung](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/ac91a4/32.png) [@maung](https://www.ruby-forum.com/u/maung)\
**Post date:** [July 20, 2007, 4:54pm UTC](https://www.ruby-forum.com/t/can-test-unit-output-in-xml/109884/4 "2007-07-20T16:54:27Z")

</div>

On 7/20/07, Jano S. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> console for start.  
> I have had a look and it’s easy to do. The “hardest” part is to define  
> xml scheme.  
> Then use xmlbuilder or anything else, and redefine add\_fault (two  
> types here, errors and failures), started, finished, maybe  
> test\_started and test\_finished.

J.

---

<div class="post-metadata">

**Author:** ![maung](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/ac91a4/32.png) [@maung](https://www.ruby-forum.com/u/maung)\
**Post date:** [July 20, 2007, 5:44pm UTC](https://www.ruby-forum.com/t/can-test-unit-output-in-xml/109884/5 "2007-07-20T17:44:34Z")

</div>

[http://caldersphere.rubyforge.org/](http://caldersphere.rubyforge.org/) produces XML files that are  
compatible  
with a lot of common CI systems, it may meet your needs.

There is another XML logger, but the name escapes me atm.

–andy

---

<div class="post-metadata">

**Author:** ![maung](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/ac91a4/32.png) [@maung](https://www.ruby-forum.com/u/maung)\
**Post date:** [July 20, 2007, 6:42pm UTC](https://www.ruby-forum.com/t/can-test-unit-output-in-xml/109884/6 "2007-07-20T18:42:46Z")

</div>

Thanks to all for your suggestions and especially to Andy. It might work  
well. Let me try. 🙂

maung

andy sipe wrote:

> [http://caldersphere.rubyforge.org/](http://caldersphere.rubyforge.org/) produces XML files that are  
> compatible  
> with a lot of common CI systems, it may meet your needs.
> 
> There is another XML logger, but the name escapes me atm.
> 
> –andy
