isCOBOL Evolve : SDK User's Guide : Advanced Features : isCOBOL Code Coverage : Running an application with isCOBOL Code Coverage from the IDE
Running an application with isCOBOL Code Coverage from the IDE
Test coverage is integrated in the isCOBOL IDE.
In order to take advantage of it, programs must be compiled with -g option, so this option should be activated either in the Preferences or in the project’s settings. Setting the option in Preferences will affect the next projects that are created in the workspace. Setting the option in project’s settings will affect that particular project.
In order to activate the -g option in the Preferences:
1. Click on Window in the menu bar,
2. Choose Preferences,
3. Expand isCOBOL in the tree and select New Project’s Settings,
4. Change the the Compile/Runtime Options page,
5. Change to the G page and activate -g,
6. Click on Apply and Close.
In order to activate the -g option in the project’s setting:
1. Right click on the project name in the isCOBOL Explorer view,
2. Choose Properties from the pop-up menu,
3. Expand isCOBOL Settings in the tree and select Compile/Runtime options,
4. Change to the G page and activate -g,
5. Click on Apply and Close.
Once programs have been compiled with -g option, you can easily perform a test coverage as follows:
1. highlight the main source file name in the isCOBOL Explorer or click on the editor window for the main program file,
2. click on the Run menu and choose COBOL Coverage As -> isCOBOL Application or click on the corresponding button in the toolbar:
The above operations trigger the program execution.
When the runtime session terminates, the Coverage view shows the coverage report.
isCOBOL IDE automatically set the isCOBOL Code Coverage configuration as follows:
iscobol.coverage.classfiles is set to the output folder of the project,
iscobol.coverage.sessionname is set to the name of the project,
iscobol.coverage.sourcefiles is set to the list of folders in the -sp Compiler option plus the source folder of the project.