VS2005: how to use Code Coverage provided with Intel Composer XE 2011?
1/21/2014 2:06 PM
Since it is not really clearly indicated in the documentation provided by Intel, it is possible to use the code coverage function provided by Intel XE Composer 2011 with VS2005. The only problem is that the results generated by the tool are not very user-friendly (html pages), and that some operations have to be done manually once the execution tests are finished.
To get code coverage test results using Intel Composer, the process is the following one:
The first thing to do is to migrate the VS project to an Intel one using the following toolbar button: .
Once the project migrated, some specific setup has to be changed. Edit the properties of the project, go the C++\Optimization tab. In this tab, some items should appear under the Intel Specific item. In the Code Coverage Build Options entry, choose the item 'Instrument for Code Coverage' as below:
Infortunately, it has be compiled. Depending on the complexity of the code, the compilation could fail since Intel Composer and MS VC do not respect the same ANSI compilation rules. In case of errors, the code has to be corrected in order to respect Intel syntax. After compilation and since the project is migrated, in the Tools menu, a new item should appear: Intel C++ Composer XE 2011. By clicking on it a second item should appear: "Code coverage operations".
2 operations have to be done: instrument the code (it means compile it with some extra code), then execute it.:
Launching the Phase2 launches the executable as configured in the Debug tab. If the process is a GUI, the user can navigate through the interface to make the tests and quit the application after.
As user, we should expect to see some window opened after these operations in the VS2005 IDE. Infortunately, that is not the case, and we have to do some manual operations.
Go to the working directory. A .dyn file should be present. In order to read it, we have to use profmerge.exe and codecov.exe which are provided in the Intel Composer XE 2011 folders (in the C:\Program Files (x86)\Intel\Composer XE 2011 SP1\bin\intel64 or ia32 fodlers depending of the process type).
Once the 2 command lines launched from the working directory of the test application, several HTML pages are generated. CODE_COVERAGE.html is the root one.