Toolchain for Unit Test project?

Sysprogs forums Forums VisualGDB Toolchain for Unit Test project?

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

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #8943

    bmcdonnell_psi
    Participant

    I’m trying to setup a unit test project (CppUTest) as described at The New Unit Test Support in VisualGDB 5.2. Screenshots from my attempt are below.

    As shown in the first image below, I have fewer options than are shown in the tutorial. Why?

    As shown in the second image below, it’s prompting me to choose a toolchain to use for this project – why? I want my unit tests to run on the Windows machine, in Visual Studio – not on the target platform. Shouldn’t it be using Microsoft’s toolchain to do that?

    How should I proceed?

    Thanks.

    • This topic was modified 1 year, 3 months ago by  bmcdonnell_psi. Reason: clarify title
    #8945

    support
    Keymaster

    Hi,

    VisualGDB is actually designed to seamlessly run the tests on your device. It will automatically start selected tests only, will gather results and failure details and display them in the Test Explorer window just like if they were running on the Windows machine. So you can test actual hardware issues there and even use them to verify that all the components on your board are working properly.

    If there is a reason why you would prefer running the tests on Windows side, please let us know. We will be happy to add support for this if it proves more usable in some cases.

    The screenshot in the blog post is taken from the Linux project wizard and is offers more options than the Embedded project wizard.

    #8946

    bmcdonnell_psi
    Participant

    Thanks for replying and clarifying.

    If there is a reason why you would prefer running the tests on Windows side, please let us know. We will be happy to add support for this if it proves more usable in some cases.

    I don’t have hardware yet, so I couldn’t run on target if I wanted to. Even if we did have hardware, it is preferable not to require it in order to run the unit tests.

    Personally, my experience with unit tests is that it’s usually for application code, so it should be fairly platform-independent. So yes, consider this a feature request from me. 🙂

    Could I set up off-target unit tests for the application code of my bare-metal project using the Linux project wizard?

    #8947

    support
    Keymaster

    Hi,

    Yes, this will be the easiest. You will need a Linux machine (or a VM) to run them though.

    We will also consider adding unit test support to the MinGW project wizard to create tests that run directly on Windows.

    #13009

    Paolo Mastrapasqua
    Participant

    Hi,

    We are evaluating VisualGDB (5.3.16.1932) for our project and we also have a reason why we would like to run the unit test on windows.

    The reason is that it is usually difficult to test code that depends on failures of operative system calls. So we prefer to mock os calls and run unit test directly on windows.

    This is also the only practical way to get 100% code coverage.

    So unit test on windows using MinGW would be for us a huge plus.

     

    Paolo Mastrapasqua

    #13012

    support
    Keymaster

    Hi,

    Thanks, we have noted this down and will try to include support for running tests on MinGW in the next major build.

    Regarding the code coverage, VisualGDB 5.3 actually works very well with gcov. You can simply enable coverage reports via VisualGDB Project Properties (it works only for Linux projects) and it will automatically run gcov, build a searchable coverage database and map file paths so that you can view coverage information directly in the code:

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

You must be logged in to reply to this topic.