Test Coverage Utility Program (tcutil)

The Test Coverage Utility Program (tcutil) is a command line utility that enables you to convert the test coverage binary results file into an XML file to help you integrate test coverage with a Continuous Integration system. You can use a Third-Party XSLT processor to transform the XML file into a format which is suitable for your CI.

Syntax

tcutil requires that you specify one or more .tcz files and has the following command line syntax:

tcutil option[option…] tczfilename [tczfilename…]
Note: On Windows, tcutil is implemented as a batch file. When invoking tcutil from within a batch file or CI command processor, you need to make a call to tcutil in order to execute it - for example:
call tcutil...

Where:

tczfilename
The test coverage binary results file (.tcz). You can find the .tcz files in the locations specified in your test coverage configuration file .tcf.

And option is one of the following:

-x [xmlfilename]
Specify a name, xmlfilename, for the output XML summary file. The XML schema file for this file is mftcov.xsd in <installdir>/etc/schema/mftcov.xsd.

If you do not specify a file name for xmlfilename, the utility program generates a file that has the base name as the input .tcz file, tczfilename, if only one .tcz file is specified. If more than one .tcz files are specified, the utility program generates a tcresult.xml file.

-t nnn
Specify a threshold in percentage, nnn, to ensure the test run fails if less than nnn% of the statements are covered. nnn must be a numeric integer value:
  • If the overall threshold is less than nnn%, return a non-zero exit code.
  • If the overall threshold is greater than nnn%, return a zero exit code.
-u
Include any unexecuted programs. The information about these is determined based on the information in the .tcz file and any .idy files in either the current folder or in folders specified by the COBIDY environment variable. This option requires the application to be compiled with the COLLECTION Compiler directive.
-s xslfilename
Include a direct reference to the stylesheet, xslfilename, in the output XML summary file specified by the -x option.