unit test printf

Sysprogs forums Forums VisualGDB unit test printf

Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • #28890
    the_steg
    Participant

    I might be missing something here, where does the printf output go to when you run unit tests with the option to redirect printf to test output window? I can’t find a test output window which would make sense!

     

    I’m using a Segger J-Link debugger and an STM32 device.

     

    Regards.

    #28891
    support
    Keymaster

    Hi,

    As long as you use the TinyEmbeddedTest framework, you can set the “Redirect printf() to Test Output window” option in the Test Framework Properties and the output will then appear under the test results (Show Additional Output link). That said, make sure you don’t have multiple conflicting options enabled (see this page).

    #28893
    the_steg
    Participant

    I’m definitely missing something then! Can you tell me exactly where to find that link as its not obvious to me. I have the correct options set as per that page.

     

    Regards.

    #28920
    support
    Keymaster

    Hi,

    If you are new to VisualGDB, please do allocate some time to go through the documentation and tutorials (e.g. unit testing tutorial). They do show the location of all the relevant settings (e.g. see the “Recovering from assertion failures” section) and will save you considerable time if you are planning a non-trivial setup.

    #28940
    the_steg
    Participant

    Got it, thanks. for anyone else wondering, the function is OutputTestMessage.

     

    I read pretty much all the guides and this one https://visualgdb.com/documentation/tests/TinyEmbeddedTest/ says to use printf with the option to redirect printf to the test output window. Does this not do the same thing?

     

    Regards.

    #28942
    support
    Keymaster

    Sorry, not sure what you meant. If you have tried following the tutorial and VisualGDB is not working as expected, please share the screenshots of all the steps you take on your side (including all GUI settings) and the output you get (including any missing windows or differences compared to the tutorial), and we will try to check what is going on.

    #28943
    the_steg
    Participant

    No, I think it is fine. I was mistaken that printf statements in the one guide outputs to the test window but in fact i should have followed the guide which shows the OutputTestMessage function sends text to the test window. It works with the latter and that’s all that matters.

     

    It would be nice to have a guide that shows how to integrate the unit test project with an existing project.

     

    #28945
    support
    Keymaster

    Thanks for the suggestion. We have it on our radar and will publish it together with other tutorials covering the new Embedded CMake subsystem.

    #28956
    the_steg
    Participant

    I’ll look forward to the CMake one. Any idea when it’ll be available?

    #28961
    support
    Keymaster

    Sorry, we don’t have an estimate yet. Feel free to follow us on Twitter to get notified about new tutorials.

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