tap2xunit is a shell script to convert tap outputs to Xunit format.
This is for instance useful if you are running bats tests and want the output to be converted to a format automatically supported by Bitbucket Pipelines, which was the reason why I needed this in the first place.
Yes I am well aware that other projects already exists such as tap-xunit, but I wanted something that would be easy to ship in my CI agent, and well.. I already had bash and no node.
To convert TAP to Xunit, redirect the TAP output to tap2xunit. By default the XML Xunit output will be rendered on stdout by you can either redirect it to a file using shell redirection (e.g, >
) or via the -o
option (see below).
tap2xunit [-n <test-names> ] [-o <outputfile>] [-t]
-n
: allows you to change the name of the test suite fromtest
(the default) to the value you specify after the-n
switch,-o
: a path to an output file. NOTE: any directories in the path provided must have be created beforehand.-t
, in conjunction with-o
, this allows to 'tee' the TAP output to stdout and the XML xunit output as a file
Besides bash (>= v3), tap2xunit requires sed and grep which have a good chance to already be installed on your system...
Copy the tap2xunit in your PATH and you should be set!
Please use GitHub issue tracker for any bugs or feature suggestions:
https://github.com/endemics/tap2xunit/issues
Contributions such as patches to the code, tests or documentation are welcome and can be submitted via GitHub pull requests.
Please follow instructions in the Github Flow page if you are new to this!
tap2xunit is licensed under the MIT License. A copy of this license is included in the file LICENSE.
Copyright 2020, Gildas Le Nadan.