run gtest in tfs build with coverage

Sysprogs forums Forums VisualGDB run gtest in tfs build with coverage

Viewing 7 posts - 16 through 22 (of 22 total)
  • Author
    Posts
  • #23735
    support
    Keymaster

    Thanks for the update. We have fixed the problem triggered with TFS in this build: http://sysprogs.com/files/tmp/VisualGDB-5.4.100.2790.msi

    The command line log looks like the coverage directories do not get stored in the test container file. Please double-check that you have enabled code coverage for both debug and release configurations in VisualGDB Project Properties. If this doesn’t help, please share your test container file here.

    #23736
    dabramson
    Participant

    OK. Tfs can now run through gtests via the visualgdb command.

    Setting code coverage for debug and release did not help the empty coverage issue. The scovreport generated for the tests running from the tfs agent is empty, as is the manual run from the command line.

    I have a project under test (PUT) and the test project (TEST). I’m attaching screen shots of the settings for both PUT and TEST.

    The test container is also attached as requested.

    • This reply was modified 5 years, 10 months ago by dabramson.
    Attachments:
    You must be logged in to view attached files.
    #23768
    support
    Keymaster

    Thanks for clarifying that you have 2 projects. Most likely the problem is triggered by some combination of settings in those projects (we have previously tried to reproduce it with 1 project only), although it’s hard to pinpoint it from the current screenshots . The test container is missing the <CodeCoverage> element, so that explains why the code coverage it not handled, although this could be triggered by several different options.

    Would you be able to reproduce the same problem on 2 freshly created projects, demonstrating the same settings (test frameworks, references between the projects), etc, and attach them here or send them via our support form? This should help us pinpoint and fix this without requesting any more details.

    #23775
    dabramson
    Participant

    Hello,

    The project I’m working with is just a toy anyway to work out all of this coverage stuff before trying to apply it to a real project. I attached that project in whole. If it is important that the project I send you be from scratch please let me know and I’ll try to find time to do it.

    Thanks

    Attachments:
    You must be logged in to view attached files.
    #23787
    support
    Keymaster

    Thanks for the project files. From a very brief look, it appears you main test project had code coverage disabled on the MSBuild level, so the test container generated by MSBuild (that is essentially a snapshot of MSBuild-level properties necessary for VisualGDB to launch the project outside MSBuild) did not have any coverage-related settings.

    After we changed the setting (see below), the container appears OK.

    We will run a few more tests on your solution and see if we can improve the usability for this scenario.

    Attachments:
    You must be logged in to view attached files.
    #23808
    dabramson
    Participant

    I turned that setting off because I wanted to NOT get coverage on the unit test project. I think that was the result of the suggestion in this post…

    code coverage highlighting broken, and general question

    The only coverage I’m interested in is the tested code. Thank you for trying to make this better.

    #24032
    support
    Keymaster

    Sorry for the delay. We have updated the VisualGDB logic for generating the test containers on the MSBuild level so that it includes the coverage information from referenced projects.

    Please try this build: VisualGDB-5.4.103.2936.msi

    Please ensure you enable the test container generation for ALL involved projects (the test project and the referenced libraries):

    This will get the coverage to work correctly when running the tests from command line (ensure you use the correct test container with the <CodeCoverageInfo> elements when running tests via command line).

    Attachments:
    You must be logged in to view attached files.
Viewing 7 posts - 16 through 22 (of 22 total)
  • You must be logged in to reply to this topic.