computer motherboard

Automatic Merge

This tutorial describes how to use automatic session merging to allow many coverage test sessions to result in one set of coverage results.

Session Manager

The first task is to ensure Coverage Validator can store at least two sessions in the session manager. The default for the session manager is one session.

  • Open the Session Manager by clicking Session Manager… on the Managers menu.
    Coverage Validator managers menu
  • The Session Manager is displayed. Increase the number of sessions to 2. Close the dialog with the Close button.
    Coverage Validator Session Manager Dialog

Settings dialog

We need to modify Coverage Validator’s settings to ensure that automatic session merging is enabled.

  • Open the settings dialog by clicking the tools icon on the toolbar.
    Coverage Validator settings icon
  • The Settings Dialog is displayed. Select the Auto Merge tab.
    Coverage Validator auto-merge code coverage settings
  • Select the check boxes and radio boxes as shown in the image above. Click the OK button.
  • The settings chosen enable session merging and result in the current session holding the contents of the central merge session so that the data displayed at the end of a session indicates the maximum coverage of all sessions recorded. If a source file is modified during the tests all coverage results in the central session will be reset.

We now need to record two coverage sessions, each containing different coverage information.

Session 1

  • Click on the relaunch icon to launch the most recently launched application.
    Coverage Validator re-launch icon
  • Click the Test menu entry for Test1.
  • Close the application.
  • This session is automatically merged with the central session managed by Coverage Validator.

Session 2

  • Click on the relaunch icon to launch the most recently launched application.
    Coverage Validator re-launch icon
  • Click the Test menu entry for Test2.
  • Close the application.
  • This session is automatically merged with the central session managed by Coverage Validator.

Session 3

  • Click on the relaunch icon to launch the most recently launched application.
    Coverage Validator re-launch icon
  • Click the Help menu entry for About Coverage Validator Tester….
  • Close the application.
  • This session is automatically merged with the central session managed by Coverage Validator.

Examining the results

  • Open the Session Manager by clicking Session Manager… on the Managers menu.
    Coverage Validator managers menu
  • The Session Manager is displayed, showing the sessions just recorded and the central merged session (this has the highest coverage percentage).
    Coverage Validator session manager merging two code coverage sessions
  • Select the session on the Session Manager with the highest percentage coverage. Click the Select button. The dialog will be dismissed and all displays will be cleared.
  • Click the Refresh All toolbar button to refresh all displays.
    Coverage Validator Refresh All icon
  • On the Coverage tab, select testsvw.cpp to display the source code. Scroll down the edit window until the OnTestPerformTest() and OnTestTest2() functions are shown. Both functions should indicate that they have been visited, indicating that data unique to each session is present in the merged session.
    Coverage Validator code coverage merge result
  • Save the session for future reference by using the Save menu entry on the File menu.

Fully functional, free for 30 days