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 empty

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 toolbar
  • The Settings Dialog is displayed. Select the Auto Merge tab.
    Coverage Validator auto merge 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 multiple coverage sessions containing different code coverage data. For this example we’ll record three code coverage sessions.

Session 1

  • Click on the relaunch icon to launch the most recently launched application.
    Coverage Validator relaunch toolbar
  • 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 relaunch toolbar
  • 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 relaunch toolbar
  • 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. Note that although we recorded 3 sessions there are only two in the session manager (because of the limit of 2 shown in max number of sessions box). Each recorded session has been merged into the central session (this has the highest coverage percentage).
    Coverage Validator session manager 3 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 toolbar
  • 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 native example testsvw.cpp Test1 and Test2
  • Save the session for future reference by using the Save menu entry on the File menu.

Conclusion

In this tutorial, you have learned how to configure automatic session merging and recorded three code coverage sessions, which have been automatically merged into the central session. You have verified the code coverage results have been merged into the central session.

Fully functional, free for 30 days