Sysprogs forums › Forums › VisualGDB › Toolchain for Unit Test project?
Tagged: CppUTest, GoogleTest, Unit Tests, visualgdb
- This topic has 5 replies, 3 voices, and was last updated 7 years ago by support.
-
AuthorPosts
-
August 31, 2016 at 19:47 #8943bmcdonnell_psiParticipant
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 8 years, 2 months ago by bmcdonnell_psi. Reason: clarify title
August 31, 2016 at 20:35 #8945supportKeymasterHi,
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.
August 31, 2016 at 20:45 #8946bmcdonnell_psiParticipantThanks 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?
August 31, 2016 at 20:52 #8947supportKeymasterHi,
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.
November 17, 2017 at 10:43 #13009Paolo MastrapasquaParticipantHi,
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
November 18, 2017 at 04:27 #13012supportKeymasterHi,
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:
-
AuthorPosts
- You must be logged in to reply to this topic.