Tagged: Unit Test
March 1, 2021 at 19:50 #30042
I’m trying to set up unit tests in my cmake project for embedded stm32f4.
-First strange thing is that It says I have latest version 5.5 however I do not see that unit test option when trying to create a project.(shown in image q1)
-So i tried to create the project myself without the template. have the cmake file the same as your tutorial on github.
project(EmbedUnitTest LANGUAGES C CXX ASM)
FRAMEWORKS com.sysprogs.arm.stm32.hal com.sysprogs.arm.stm32.ll com.sysprogs.embedded.semihosting_and_profiler
set_source_files_properties(system_stm32f4xx.c PROPERTIES HEADER_FILE_ONLY TRUE)
SOURCES EmbedUnitTest.cpp system_stm32f4xx.c stm32f4xx_hal_conf.h EmbeddedSimulationDemoTests.cpp
You can settings in visualgdb project in image q2. implementations for _sbrk() etc is set to minimal (no semihosting)
Finally my project is shown in image q3.
What am I missing to get this working? I may ultimately want to switch to google test but first wanted to get this one working first.
Attachments:You must be logged in to view attached files.March 1, 2021 at 20:32 #30046
No problem, we will be happy to help you, however, we would kindly ask you to renew your technical support first via the following link: https://sysprogs.com/splm/mykeyMarch 2, 2021 at 02:02 #30048
I have updated support. I wish your tutorials were more clear that custom edition of visual gdb is needed for unit testing support. I have went ahead and got a license for this. It seems to work now except for a few quirks. When using google test
- google test: when selecting a single test to run from test explorer, it will sometimes just delete the test from the explorer and not run.
- google test: when encountering a printf() using the semihosting setting explained above, it will just hang on it (not the case for tinyembed).
- tinyembed: when running line IsRunningUnitTests() it will hang on it. This does not happen in the templated project. only when recreating it with all same settings.
Finally, I am having problems with preprocessors when using cmake’s target_compile_definitions(). intellisense does not notice the global preprocessor is defined and thus confusingly leaves sections of code faded when they shouldn’t be. Should I create a new thread for this? Also I am unable to install visualGDB to visual studio 2019. it just gives an error message shown in image q1.
- This reply was modified 1 month, 2 weeks ago by AEHadi.
Attachments:You must be logged in to view attached files.March 2, 2021 at 08:37 #30053
Thanks for renewing your license. Regarding the installation issues, please see the following page: https://visualgdb.com/documentation/troubleshooting/install/
Regarding other issues, we can gladly investigate them, however we would need to know the steps we could follow to reproduce them on our side. Please follow our problem reporting guidelines and share the steps (including all relevant screenshots) to reproduce the issues from scratch and we will look further into it. For better tracking, we would advise creating a separate forum thread for each issue.
You must be logged in to reply to this topic.