can't get unit tests to show up in test explorer

Sysprogs forums Forums VisualGDB can't get unit tests to show up in test explorer

Tagged: 

This topic contains 3 replies, has 2 voices, and was last updated by  support 1 month, 2 weeks ago.

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #30042

    AEHadi
    Participant

    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.

    cmake_minimum_required(VERSION 3.15)

    project(EmbedUnitTest LANGUAGES C CXX ASM)

    find_bsp(ID com.sysprogs.arm.stm32
    VERSION 2021.02
    MCU STM32F411RE
    FRAMEWORKS com.sysprogs.arm.stm32.hal com.sysprogs.arm.stm32.ll com.sysprogs.embedded.semihosting_and_profiler
    HWREGISTER_LIST_FILE STM32F4xxxx/DeviceDefinitions/stm32f411xe.xml)

    find_test_framework(ID com.sysprogs.unittest.tinyembtest)

    if(SIMULATION)
    set_source_files_properties(system_stm32f4xx.c PROPERTIES HEADER_FILE_ONLY TRUE)
    endif()

    add_bsp_based_executable(NAME EmbedUnitTest
    SOURCES EmbedUnitTest.cpp system_stm32f4xx.c stm32f4xx_hal_conf.h EmbeddedSimulationDemoTests.cpp
    GENERATE_BIN
    GENERATE_MAP
    BUILD_UNIT_TESTS
    EXCLUDED_PLATFORMS Hardware)

    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.
    #30046

    support
    Keymaster

    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/mykey

    #30048

    AEHadi
    Participant

    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.
    #30053

    support
    Keymaster

    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.

Viewing 4 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic.