I'm having trouble figuring out how to get the testing framework set up and usable in Visual Studio 2008 for C++
presumably with the built-in unit testing suite.
Any links or tutorials would be appreciated.
The most scalable way to write unit tests in C is using a unit testing framework, such as: CppUTest. Unity. Google Test.
On the Create a new project page, type unit test into the search box. Select the project template for the test framework that you want to use, for example MSTest Test Project or NUnit Test Project, and then select Next. On the Configure your new project page, enter a name for your project, and then select Create.
This page may help, it reviews quite a few C++ unit test frameworks:
Check out CPPUnitLite or CPPUnitLite2.
CPPUnitLite was created by Michael Feathers, who originally ported Java's JUnit to C++ as CPPUnit (CPPUnit tries mimic the development model of JUnit - but C++ lacks Java's features [e.g. reflection] to make it easy to use).
CPPUnitLite attempts to make a true C++-style testing framework, not a Java one ported to C++. (I'm paraphrasing from Feather's Working Effectively with Legacy Code book). CPPUnitLite2 seems to be another rewrite, with more features and bug fixes.
I also just stumbled across UnitTest++ which includes stuff from CPPUnitLite2 and some other framework.
Microsoft has released WinUnit.
Also checkout Catch or Doctest
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With