Note: This facility is supported in native COBOL only.
Before you run an application in code coverage mode and produce code coverage statistics, you must enable code coverage in
the properties of your project, a project's build configuration or in the properties of the project's files. You then need
to build your application.
To enable code coverage for your project:
- Open your project's properties, expand
Micro Focus > Project Settings and click the
COBOL tab.
Note: If different from the project settings, the build configuration settings take precedence over the project settings when you
build your application. If you enabled code coverage at project level but do not receive any results when you run the application,
it might be because the application was executed in a build configuration which does not have code coverage enabled. To work
around this, always ensure code coverage is enabled for the build configuration you are running your application in.
- Set
Enable code coverage to
Yes.
- Click
Apply and Close.
To enable code coverage for a build configuration of your project:
- Open your project's properties, expand
Micro Focus > Build Configurations and click the
COBOL tab.
- Expand
Override project COBOL settings and check
Enable configuration specific settings.
- Set
Enable code coverage to
Yes.
- Click
Apply and Close.
To enable code coverage for individual files in your project:
- Open a file's properties and click the
COBOL tab.
- Check
Enable file specific settings, and then set
Enable code coverage to
Yes.
- Click
Apply and Close.
Note: If
Build Automatically is not enabled in the IDE, you need to build your project manually.
If your application executes in an enterprise server, you also need to configure the server to run in code coverage mode:
- In the IDE, open Server Explorer.
- Right-click the server that is associated with your application and click
Configure Analysis > Code Coverage.
To enable code coverage to produce reports in HTML format in addition to producing statistics, specify your preferences on
the
Code Coverage page in
Window > Preferences > Micro Focus > COBOL. See
Configuring the Code Coverage HTML Reports.