Previous Topic Next topic Print topic


Running an Application with Code Coverage

Note: This facility is supported in native COBOL only.

Having enabled code coverage forone or more projects in your solution, you need to execute the application with code coverage in order to generate the code coverage data.

There is a difference between how you run applications with code coverage depending on whether they require an enterprise server to run or not.

If your application does not require an enterprise server, to run it in code coverage mode:

  1. 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 has Enable code coverage checked in its properties, the IDE displays a warning that you need to do so. If you continue running the application without Enable code coverage checked for a project in the solution, no code coverage reports are produced.
  2. Step through your application in the usual manner.

    When you have finished running the application or have finished debugging, stop the debugger. This causes code coverage to produce a Results.tcz and one or more report files in .htm format in the folder specified in Tools > Options > Micro Focus > Code Coverage > Results Options.

If your application requires an enterprise server, to run it in code coverage mode:

  1. In the IDE, ensure code coverage is enabled in your project's properties.
  2. Build your solution.
  3. Right-click the server in Server Explorer and click Start with Code Coverage.
  4. Execute your application in the usual manner.
  5. Right-click the server in Server Explorer and click Stop and generate code coverage results.

    This stops the server and produces the Code Coverage reports.

Viewing the Code Coverage reports

If specified in the IDE options, the code coverage index report file, TCIndex.htm, automatically opens in the editor.

If the code coverage index report file, TCIndex.htm, does not automatically open in the editor, click Show Latest Code Coverage Report, Show Micro Focus Code Coverage Report in the COBOL toolbar, to open it.

Previous Topic Next topic Print topic