Hi
I am trying to make use of VS2019 to perform Unit-Testing of my Arduino Visual Micro code, as described -
https://www.instructables.com/Arduino-Shared-Project-PC-Debugging-and-Automated-... However, I keep on getting problems with files being found properly.
1) I noticed that when creating the initial Project and Solution, the tickbox "Place solution and project in same directory" must be ticked, otherwise you get all kinds of problems with intellisense and deep-search not finding things. I actually want to keep the solution and projects separate, so how can I get that to work?
2) When I try to "Right-click > Build" the Unit-Test project, the compiler fails trying to find the "WProgram.h". I have not found a way to overcome this. And even when I do by changing #def entries of the UT projects' compiler properties, I still get failures finding arduino.h and other arduino type defining files.
When I just have the "Shared Code Project" and "Arduino Project" in the solution, they build fine following Visual-Micro build process.
When I try to bring in and build the VS2019 "Native Unit test project", remove the precompiled header (as described) and add my own header in, I start to get all these problems with the build (see attached .txt). I have not even added any test code. The TEST_CLASS and TEST_METHOD blocks are unaltered. Not even my use of "byte" in my shared project (.h) is being recognized.
Is VS2019 Native Unit-Test project meant to be used in this way?! I.e. where is the boundary as to what I can and cannot test? The given example is very simplistic and maybe there are restrictions to what arduino centric .h's I can use in my shared code project that I am testing??
I would really like to see a realistic heavy-weight example using all the bells and whistles of the Visual-Studio, Visual-Micro and Arduino environment to know what can and cannot be done using them. Or at least a detailed description of what code can and cannot be tested.
Thanks.