Sysprogs forums › Forums › VisualGDB › unit test printf
- This topic has 9 replies, 2 voices, and was last updated 5 years, 2 months ago by
support.
-
AuthorPosts
-
August 26, 2020 at 05:36 #28890
the_steg
ParticipantI 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.
August 26, 2020 at 07:36 #28891support
KeymasterHi,
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).
August 26, 2020 at 08:03 #28893the_steg
ParticipantI’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.
August 28, 2020 at 20:26 #28920support
KeymasterHi,
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.
September 1, 2020 at 06:33 #28940the_steg
ParticipantGot 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.
September 1, 2020 at 07:11 #28942support
KeymasterSorry, 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.
September 1, 2020 at 07:38 #28943the_steg
ParticipantNo, 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.
September 1, 2020 at 19:39 #28945support
KeymasterThanks for the suggestion. We have it on our radar and will publish it together with other tutorials covering the new Embedded CMake subsystem.
September 2, 2020 at 00:39 #28956the_steg
ParticipantI’ll look forward to the CMake one. Any idea when it’ll be available?
September 2, 2020 at 06:03 #28961support
KeymasterSorry, we don’t have an estimate yet. Feel free to follow us on Twitter to get notified about new tutorials.
-
AuthorPosts
- You must be logged in to reply to this topic.