none
Running VsInstr and VsPerfMon.exe through code

    Question

  • Hi,

    I am doing code coverage for my assemblies after instrumenting and using VsPerfMon as described here

    http://blogs.msdn.com/b/cellfish/archive/2008/11/16/native-c-code-coverage-reports-using-visual-studio-2008-team-system.aspx

    How can I do all the above steps through my c++ code ?

    And if there is any change in the assembly file and after rebuilding it, I cannot reinstrument the assembly again. Is there any possible way to remove the instrumentation for the assembly ?

    I am using VS 2010 Ultimate.

    And how to export code coverage data as .coveragexml through command line ?

    Regards,

    Harish.

     
    Tuesday, January 29, 2013 9:31 AM

Answers

  • Hi HarishKV,

    Thank you for posting in the MSDN forum.

    How can I do all the above steps through my c++ code ?

    Actually the blog provided by you has shared us the detailed steps for code coverage analysis. I think you have seen Luo’s suggestion in this thread, so based on the step, you could try to check it, if you got any issue, and you could post the issue in this forum.

    And if there is any change in the assembly file and after rebuilding it, I cannot reinstrument the assembly again. Is there any possible way to remove the instrumentation for the assembly?

    Could you share us the error message when your re- instrument assembly? As far as I know, if you “Clean” and “Rebuild” your app, we could re- instrument the assembly.

    And how to export code coverage data as .coveragexml through command line?

    As far as I know, default it just could create .coverage file if we run the above steps in command line.

    Best Regards,


    Jack Zhai [MSFT]
    MSDN Community Support | Feedback to us
    Develop and promote your apps in Windows Store
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    • Marked as answer by HarishKV Friday, February 01, 2013 5:27 AM
    Wednesday, January 30, 2013 8:53 AM

All replies

  • Hi Harish,

    I moved this thread to Visual Studio Diagnostics (Debugger, Profiler, IntelliTrace) forum for better response.

    Best regards,


    Amanda Zhu [MSFT]
    MSDN Community Support | Feedback to us
    Develop and promote your apps in Windows Store
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Wednesday, January 30, 2013 1:55 AM
  • Hi HarishKV,

    Thank you for posting in the MSDN forum.

    How can I do all the above steps through my c++ code ?

    Actually the blog provided by you has shared us the detailed steps for code coverage analysis. I think you have seen Luo’s suggestion in this thread, so based on the step, you could try to check it, if you got any issue, and you could post the issue in this forum.

    And if there is any change in the assembly file and after rebuilding it, I cannot reinstrument the assembly again. Is there any possible way to remove the instrumentation for the assembly?

    Could you share us the error message when your re- instrument assembly? As far as I know, if you “Clean” and “Rebuild” your app, we could re- instrument the assembly.

    And how to export code coverage data as .coveragexml through command line?

    As far as I know, default it just could create .coverage file if we run the above steps in command line.

    Best Regards,


    Jack Zhai [MSFT]
    MSDN Community Support | Feedback to us
    Develop and promote your apps in Windows Store
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    • Marked as answer by HarishKV Friday, February 01, 2013 5:27 AM
    Wednesday, January 30, 2013 8:53 AM
  • Hi Jack,

    Thanks for the reply.

    Re instrumentation of assembly works fine. I can get .coverage file.

    But in order to get .coveragexml, I open the .coverage file in VS2010 and export it.

    Is there any work around for getting .coveragexml from .coverage programatically ?

    Regards,

    Harish.

    Thursday, January 31, 2013 4:31 PM
  • Hi Harish,

    Re instrumentation of assembly works fine. I can get .coverage file.

    Glad to see that it has been resolved. If so, you could make the useful reply as the answer.

    About the second issue, if possible, please check this thread “Can Microsoft code coverage tool generate XML file as a report format?”, and it shared some useful information about it.

    Have a nice weekend,


    Jack Zhai [MSFT]
    MSDN Community Support | Feedback to us
    Develop and promote your apps in Windows Store
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Friday, February 01, 2013 4:50 AM
  • Hi Jack,

    Thanks for the link. I read through it and I am struck at the point where it is asked to reference the  Microsoft.VisualStudio.Coverage.Analysis.dll, in your project.

    How to do the reference to the dll in my project. I tried setting the Path of the dll in Reference Directory. But no help.

    Can you help me how to add the reference to my VC++ project ?

    Regards,

    Harish.

    Friday, February 01, 2013 5:37 AM
  • Hi Harish,

    Glad to receive your reply.

    Actually I mean that we could export it in the VS IDE like this thread, if possible, you could check this updated blog “Programmatic Coverage Analysis in Visual Studio 2010” about it, maybe you could get useful information. If still no help, would you mind posting a new issue in this forum about this new issue? I will try to involve someone familiar with this topic to further look at this issue.

    Have a nice weekend,


    Jack Zhai [MSFT]
    MSDN Community Support | Feedback to us
    Develop and promote your apps in Windows Store
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Friday, February 01, 2013 7:27 AM
  • Hi Jack,

    Thanks for your reply. I would post a new issue and check that blog for reply.

    Have a nice weekend.

    Regards,

    Harish.

    Friday, February 01, 2013 8:12 AM