Support for Parametrized Tests on google test?

Sysprogs forums Forums VisualGDB Support for Parametrized Tests on google test?

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #26458
    Jose Cazarin
    Participant

    Does VisualGDB support parametrized tests running on target with Google Test?

    Cause I was reading a tutorial and when I changed the macro of a test case from TEST() to TEST_P()  I started getting “No source available” errors on the Test Explorer

     

    Thanks!

    #26460
    Jensa
    Participant

    It does and it works fine for us.

    Did you remember to add the INSTANTIATE_TEST_CASE_P() macro to actually generate the code for them? The compiler errors you get are a bit horrible to figure out when it comes to the test code since it’s based on so much macro’s.

    Another issue could be that I think the source code for the tests might be handled a bit differently when it’s from the package manager so it might be some issues with it realizing that the code needs some stuff that was previously optimized away depending on your compiler/link parameters.

    #26465
    support
    Keymaster

    Thanks @Jensa for confirming that it works for you.


    @jose-cazarin
    , if it still doesn’t work with your setup, could you please share your project type (MSBuild/Make), the build configuration (build on target, or using a cross-toolchain) and share the code that triggers the problem so that we could recheck it on our side?

    #27043
    Jose Cazarin
    Participant

    Getting back to this, what we are trying to do is: we have a .txt file with the inputs of an algorithm. We want to run this algorithm in our device and check if the results are the same. The problem is: this .txt file is too big, if we try to compile it within the embedded code we run out of memory. So we are trying to find a way to, during runtime, transfer the inputs from the PC to the embedded device and still use the GoogleTest framework

    We will start looking into it again and try to make the parameterized tests work. But I don’t know if that’s the solution for what we need.

    #27075
    support
    Keymaster

    Hi,

    The parametrized tests unfortunately won’t solve the problem, however we are planning to extend our advanced semihosting framework to support reading test data same way  it currently outputs test results. We should be able to give a time estimate on this in the next 1-2 weeks.

    #27180
    Jose Cazarin
    Participant

    Thanks, that would help a lot. I’ll keep in touch.

    #27536
    support
    Keymaster

    Hi,

    Just wanted to let you know that we have added support for test resources (files on the Windows machine that can be accessed from the embedded code) to the following VisualGDB build: VisualGDB-5.5.4.3548.msi

    You can find a reference of the test resource manager API here: https://visualgdb.com/documentation/semihosting/_t_r_m_a_p_i.html

    Please make sure you install the latest semihosting/profiler framework and enable test resources via VisualGDB Project Properties -> Unit Tests. The new functionality, along with detailed tutorials, will be included in the upcoming Preview 5.

    #27559
    Jose Cazarin
    Participant

    Thank you, that will be very helpful!

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