Giter VIP home page Giter VIP logo

tuxml's Introduction

tuxml

tuxml is short for “Test::Unit XML” and adds JUnit XML compatible output to Ruby’s Test::Unit framework. The output generated by tuxml should work with a lot of tools, but for now, only the Hudson Continuous Integration Server was tested successfully.

Installation

(sudo) gem install tuxml

Usage

tuxml can be used in one of three ways.

Add tuxml gem to your tests

Inside your test file or test helper, add the following lines

require 'rubygems' # if not already required
require 'tuxml'

Then run the test(s) as usual.

Single test class without changing code

To run a single test class you need to explicitly require the tuxml.rb inside the gem, and choose the xml test runner:

ruby -r /path/to/tuxml.rb path/to/test.rb --runner xml

You can find the path to tuxml.rb by running

gem which tuxml -q

Inside shell scripts, you can use the following way to find the tuxml.rb file:

ruby -r `gem which tuxml -q` path/to/test.rb --runner xml

Testsuite without changing code

To run a testsuite using rake, you need to set the environment variable TESTOPTS to add the tuxml.rb file and choose the xml test runner like this:

TESTOPTS="/path/to/tuxml.rb --runner=xml" rake test

Note that when the test rake task invokes several test suites serially, the XML output file will be overwritten. In this case you need to run each test suite individually and set a different output file for each suite.

Setting the output file name

The default output file name is tests.xml in the current working directory. To change the XML output file name, set the TUXML_OUTPUT_FILE environment variable.

Missing stuff

  • The properties element is not supported because it does not seem to make much sense in this context.

  • The system-out and system-err elements are not supported.

Caveats

Due to the way that tuxml attaches itself to the Test::Unit framework, it is not possible to run the tuxml tests with the XML testrunner provided by tuxml.

Acknowledgements

The idea to use an XML testrunner was inspired from work done by Flavio Castelli.

You can find the (almost complete) XML schema here:

http://ant.1045680.n5.nabble.com/schema-for-junit-xml-output-td1375274.html

An example JUnit output that was used when developing tuxml can be found here:

http://junitpdfreport.cvs.sourceforge.net/viewvc/junitpdfreport/src/resources/examples/testresults/TEST-net.cars.engine.PistonTest.xml?revision=1.9&content-type=text%2Fplain

About tuxml

tuxml was written by Thomas Kadauke on a rainy saturday night.

tuxml's People

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

tuxml's Issues

Not working

It seems not working on test-unit 3.1.8 and Ruby 2.2.4

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.