Note: This facility is supported in native COBOL only.
Having enabled code coverage for
one or more projects in your solution (see
Enabling code coverage), you need to execute the application in code coverage mode in order to generate the coverage data. There is a different
approach to this depending on whether or now the application requires an enterprise server to run.
Note: Applications compiled for code coverage can also be run/debugged without code coverage enabled, which simply results in no
coverage reports being produced; these applications still execute code coverage operations at run time, which incurs a performance
overhead. To completely remove code coverage computation from your application, recompile it with the code coverage setting
disabled.
To run an application does not require an enterprise server in code coverage mode:
- In the IDE, ensure code coverage is enabled in your project's properties.
- Click
Debug > Start With Micro Focus Code Coverage.
If you have not compiled your application with the latest changes, the IDE first rebuilds the project. The IDE then starts
the application in debug mode.
Note: If none of the projects in your solution have
Enable code coverage checked in its properties, the IDE displays a warning that you need to enable this setting. If you continue running the application
without
Enable code coverage checked for a project in the solution, no code coverage reports are produced.
- Step through your application in the usual manner.
- When you have finished running the application or have finished debugging, stop the debugger.
After the execution stops, the IDE automatically opens the
Micro Focus Code Coverage window that shows the statistics about what percentage of the code has executed. The code in the editor is colorized to indicate
covered and missed blocks.
To run an application that requires an enterprise server in code coverage mode:
- In the IDE, ensure code coverage is enabled in your project's properties.
- Build your solution.
- Right-click the server in Server Explorer and click
Start with Code Coverage.
- Execute your application in the usual manner.
- Right-click the server in Server Explorer and click
Stop and generate code coverage results.
After the execution stops, the IDE automatically opens the
Micro Focus Code Coverage window that shows the statistics about what percentage of the code has executed. The code in the editor is colorized to indicate
covered and missed blocks.
See
Viewing the Code Coverage information.