Starting and stopping the headless code coverage daemon

Headless mode runs code coverage without a UI. Headless mode is ideal for environments in which a UI workbench is not installed or from the command line or as part of a script.

About this task

Notes:
  • Headless code coverage is not available on macOS.
  • Standard mode is not supported with headless code coverage on z/OS®.
Headless mode runs a daemon that listens for an incoming connection in the same way that the UI uses a debug daemon. Start or run your application like you do for code coverage capture in the UI but use the IP/Host:port of the headless code coverage collector. For more information, see Generating code coverage in headless mode using a daemon.
Note: By default the results are stored by date in the root of the user's home directory under the CC folder. You can use the -output parameter to change the default setting.
The syntax diagram for the codecov command is shown below:
Read syntax diagramSkip visual syntax diagramcodecov -help-stopdaemon=<port>-printparms-startdaemon-port=<port list> -output=<path>-cclevel=<LINE|FUNCTION>-modulelist=<path>-moduleexludelist=<path>-moduleexclude=<module_list>-moduleinclude=<module_list>-moduleincludelist=<path>-singleconnect-localonly-startupcommandlist=<path>-savesource=<TRUE|FALSE>-optionsfile=<path>-tag="text"-timeout=<seconds>-ignoreerrors-testid=<testid>-exportertype=<exporter type>-view=<DEFAULT|SOURCE_LISTING|SOURCE_ONLY|LISTING_ONLY>
Options list
Format: codecov [options]
-help
Prints the help screen.
-stopdaemon=<port>
Stops the daemon that is listening on the port.
-printparms
Prints a summary of the parameters specified.
-startdaemon
Starts in daemon mode and wait for connections.
-port=<port list>
The port number, port list(port,port) or port range(port-port) used by the debug daemon.
-output=<path>
The directory to save the code coverage result files. A result containing the program name and time stamp is created under the output directory for each session. A sub-directory is created when you export the result in the SonarQube format.
-cclevel=<LINE|FUNCTION>
The code coverage level (either "LINE" or "FUNCTION").
-modulelist=<path>
Specifies an optional file that contains a list modules used by MODULE level code coverage.
-moduleexludelist=<path>
Specifies an optional file that contains a list of regular expressions that will cause matching module names to be excluded from code coverage.
-moduleexclude=<module_list>
Comma separated list of module names or module expressions that will be excluded from code coverage. Module expressions can use '*' or '?' to match module names.
-moduleinclude=<module_list>
Comma separated list of module names or module expressions that will be included in code coverage. Module expressions can use '*' or '?' to match module names. Module include overrides the module exclude parameter.
-moduleincludelist=<path>
Specifies an optional file that contains a list of module names that should be included in code coverage. Module expressions can use '*' or '?' to match module names. Module include overrides the module exclude parameter.
-singleconnect
Exits 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=<TRUE|FALSE>
Saves the source with the results. The default is TRUE. The value for this parameter also controls whether source appears with the PDF exporter. For example, if -savesource=TRUE is specified with -exportertype=CCPDF, source is included in the PDF report.
-optionsfile=<path>
Reads command arguments from the specified options file.
-tag="text"
Specifies a tag that will be associated with the CC results. e.g. test ID.
-timeout=<seconds>
Number of seconds to wait for a debug engine response before timing out. The default is 120 seconds. The session will terminate and results already captured will be saved. Specifying 0 (zero) will wait indefinitely.
-ignoreerrors
Results will be produced even if errors occur during the session. The results may be incomplete.
-testid=<testid>
Results will be associated with the specified testid.
-exportertype=<CCSONARQUBE|CCPDF>
Specifies the export format for code coverage data. You can specify multiple export types by using a comma to separate.
  • exportertype=CCSONARQUBE produces the SonarQube format with the .xml extension. Each test result is contained in a unique sub-directory.
  • exportertype=CCPDF produces the PDF format with the .pdf extension. By default, source is included in the PDF report. To exclude source from the report, specify savesource=false.
-view=<DEFAULT|SOURCE_LISTING|SOURCE_ONLY|LISTING_ONLY>
Choose the view to use when you save source.
  • DEFAULT uses whatever is the engine preferred view.
  • SOURCE_LISTING uses the source view first. When the source view is not found or is not available, it will default to the LISTING view.
  • SOURCE_ONLY only allows source views to be included in code coverage collection.
  • LISTING_ONLY only allows listing views to be included in code coverage collection.
Notes:
  • DEFAULT is the only supported view option for Debug Tool compatibility mode.
  • DEFAULT and SOURCE_LISTING are the only supported view options for standard mode. Standard mode is not available in IBM Z® Open Unit Test.