Reputation: 9586
How can I add a unit test to a C++ console program in Visual Studio 2012?
From what I've been able to gather from the MSDN the MS unit test support for C++ can't do this at all, (which doesn't surprise me as the MS C++ unit test support was always shocking).
However in earlier versions of Visual Studio you used to be able to unit test C++ code using Visual Assist, but sadly this doesn't support vs2012.
Does anyone know of a C++ unit test framework with some sort of IDE integration that works with vs2012?
Upvotes: 1
Views: 1558
Reputation: 7271
Visual studio does support integrated unit testing. You need to structure your program correctly though. The way I like to structure my solutions is to have three projects.
Whilst it is possible to use the Visual Studio testing framework, I would recommend Google test. One of the best things about google test is actually Google mock. You can get some integration with this plugin.
Upvotes: 4