To use test coverage with COBOL stored procedures


  1. Create a new test coverage configuration file by copying the template ( etc\default.tcf by default) and add the following two lines to it:
    STOREDPROCEDURE YES
    ECHOLOG ON
  2. From a COBOL command prompt, set the TESTCOVER environment variable to specify drive-letter:\folder-hierarchy\configfile.tcf. When using IBM DB2, you must set TESTCOVER using the Windows Control Panel before starting the service. If not, you can set it from the command prompt before starting your COBOL development software.
  3. Specify the TESTCOVER directive for the COBOL programs that are run as stored procedures or called by them.
  4. Rebuild the project.
  5. Delete any previous test coverage results files if you have been accumulating results.
  6. Run your project and view the test coverage results as usual.
Note: When using IBM DB2:
  • Before you can execute the stored procedure you need to copy testcover.dll from your base\bin folder to your function folder under your IBM DB2 installation directory. You must also copy the stored procedure .dll itself into the function folder.
  • Ensure that the KEEPFENCED Database Manager Configuration parameter for IBM DB2 is set to NO. Test coverage relies on programs being canceled and reloaded, so will not function correctly if KEEPFENCED is set to YES, which is the default.
Related reference
TESTCOVER
Related information
Environment Variables Summary