Setting location of coverage reports through command line

Sysprogs forums Forums VisualGDB Setting location of coverage reports through command line

Viewing 11 posts - 1 through 11 (of 11 total)
  • Author
    Posts
  • #19994
    dennyk
    Participant

    First of all, is there a list of options when running visualGdb from command line somewhere?

    My issue is I want to run my unit test and get the report in the location I specified in ‘VisualGdb Project Properties -> Code Coverage -> Directory to store coverage reports’, and that location is on my PC, not on my target hardware. When I run my unit test using visual studio’s test explorer, I can see the test report in the location specified. But the problem is, I need to run this test using a batch script, which I can do, but I cannot find the coverage report anywhere. Can someone help me?

    • This topic was modified 6 years, 9 months ago by dennyk.
    #19997
    support
    Keymaster

    Hi,

    Please try this build: http://sysprogs.com/files/tmp/VisualGDB-5.4.1.2048.msi

    It will reuse the normal coverage report logic when launched from command line.

    #20005
    dennyk
    Participant

    Hi,

    Thanks for the help, with that version, I can see the scovreport file, but I also set the option for “Keep raw coverage reports”. I can see the directory that normally contains the raw coverage reports if I run my test from visual studio’s test explorer, but it is empty, the job.txt is there, but also empty. It’s those raw coverage files that I really need, especially the gcda files as I do the processing on my own. Is there a way that can be fixed? Or is there another version that also has that fixed? Or is there a command line option I need to use? Please help…

    • This reply was modified 6 years, 9 months ago by dennyk.
    #20011
    support
    Keymaster

    Hi,

    All VisualGDB settings from Tools->Options->VisualGDB are stored in registry under HKEY_CURRENT_USER\Software\Sysprogs\VisualGDB\Settings. If you are running VisualGDB on a machine without Visual Studio, we would advise simply exporting the settings from a regular machine via a .reg file and applying them on the second machine.

    #20016
    dennyk
    Participant

    Hi,

    I’m running it on the same machine where if i run my test from visual studio’s test explorer, i see the raw files. So i believe i wouldn’t need to export those settings. So is there any other explanation why the raw files are not kept if i run it through command line?

    #20023
    support
    Keymaster

    Hi,

    As long as the KeepRawCoverageReports registry setting is set to 1, VisualGDB should keep the reports. Please try deleting the coverage report directory, running the tests via command line and let us know which exact files/directories were created. This should explain what is going on.

    #20025
    dennyk
    Participant

    Hi,

    I checked the registry editor to make sure, “KeepRawCoverageReports” under HKEY_CURRENT_USER\SOFTWARE\Sysprogs\VisualGDB\Settings\Common\Profiling is 1. So I should be good.

    And I remove all old coverage reports from my build dir, which is where I set it to be. and Run “<path_to_visualgdb>\VisualGDB.exe /runtests <path_to_container>\adrv9010gdbgtest.vgdbtestcontainer /output:testOutput.xml” from command line. And when I checked my build_dir again, there is the scovreport file, and the directory with a timestamp. But that directory only contains an empty job.txt file and nothing else.

    So what am I missing here? I believe there should be gcda gcno and gcov files in that directory with a time stamp.. Please help..

    #20026
    support
    Keymaster

    Hi,

    The empty .job would normally mean that VisualGDB could not locate any raw coverage reports after running the project. This might be caused by some combination of settings that prevents VisualGDB from locating the files when running from command line.

    Could you please check if you can reproduce this problem on a clean test project created via VisualGDB project wizard?

    #20027
    dennyk
    Participant

    Hi,

    Before trying that..

    Now I am suspecting that visualGdb fails to find the debug files from HW target..

    When copying debug files from HW target, where are they expected to be? In my case I find them manually in directory specified in ‘Project properties -> Configuration Properties -> instrumentation -> Coverage Report Directory’\<Project_Name>\<Project_Config>, which I never changed, seems to be the default and seems to work when I run everything from the GUI. The one that I changed is under ‘VisualGdb Project Properties -> Code Coverage -> Directory to store coverage reports’, which is set to somewhere in my PC.

    So what is the difference for the path set under project properties and the path set under visualGdb properties?

    Is it possible that when test is run from GUI, it knows the gcda files are in the path set under project properties and not when it’s run from cmd line? If that is the case, what path am I supposed to set for the one under project properties?

    #20032
    support
    Keymaster

    Hi,

    We have managed to reproduce the problem. VisualGDB was not properly copying coverage directory information to the test container file when building it outside Visual Studio.

    We have fixed it in this build: http://sysprogs.com/files/tmp/VisualGDB-5.4.1.2055.msi

    If you encounter any further problems, feel free to contact us again.

    • This reply was modified 6 years, 9 months ago by support.
    #23700
    dabramson
    Participant

    This sounds very similar to one of the issues i’m experiencing in this post.

    run gtest in tfs build with coverage


    @dennyk
    – have you started having this issue again where the raw files are not saved if you run the tests through the command line?

Viewing 11 posts - 1 through 11 (of 11 total)
  • You must be logged in to reply to this topic.