Running code coverage in headless mode allows you to run
code coverage without having a UI open. This is ideal for environments
in which a UI workbench is not installed and/or running code coverage
from the command line or as part of a script may be necessary.
About this task
You can run code coverage for any compiled language application
that you can debug from the command line or as part of a script. There
are two modes in which you can run headless code coverage:
- As a daemon listening for a connection (use with a remote debug
engine using the port specified - seeRunning code coverage in headless mode: Daemon)
for more information.
- Operating directly on a program compiled with debug information,
specified as an argument (One Shot mode).
Note: One Shot mode is only
available for AIX/Linux, not on Z Series.
$ codecov testProg
Note: The results will be stored by date in the root of
the user's home directory under the CC folder.
The syntax
diagram for the
codecov command is shown below:

- Options List
- Format: codecov [options] [program_name]
[program_parameters]
- program_name
- The full path of the executable to run code coverage on.
Note: One
Shot mode is only available on AIX/Linux, not on Z Series.
- program_parameters
- The parameters for the program.
Note: One Shot mode is only available
on AIX/Linux, not on Z Series.
- -startdaemon
- Start in daemon mode and wait for connections.
- -stopdaemon=<port>
- Stop the daemon that is listening on the port.
- -cclevel=<"LINE" | "FUNCTION">
- The code coverage level (either "LINE" or "FUNCTION")
- -prevresultpath=<"NONE" | "PREV" | path>
- Specify the path of the previous result file.
- -reportformat=<"HTML" | "NONE">
- Generate an HTML report if the report format is HTML.
- -singleconnect
- Exit after a single daemon connection (must use with -startDaemon).
- -localonly
- The daemon will only accept connections from the localhost.
- startupcommandlist=<path>
- Specifies a file that contains commands that will be sent to the
debug engine at startup.
- -savesource
- Saves the source with the results.
- -optionsfile=<path>
- Read command arguments from the specified options file.
- -tag="text"
- Specify a tag that will be associated with the CC results. e.g.
testcase ID.
- -zipresult
- The results directory is compressed into a zip file with the
same name as the results directory.
- -help
- Print out the help screen.