I have a Visual Studio 2005 C++ project, it is a console application.
I want to start getting bits of the code under a test harness but I've run into some issues that I don't know how to best handle.
I don't want most of my testing code to end up in the normal .exe in production so I thought would be best to create a separate project for my tests. First issue, how is this new project going to call into the rest of the code? Should I make my legacy code a .lib or .dll with a single entry point and create a separate project that calls the main of my legacy code?
Should I go for the ugly hack of putting all my tests in files that are entirely #ifdef TESTING
so that the code doesn't end up in my production .exe? If so how should I conditionally load my testing framework? Use a separate Properties Configuration for testing?
I'm basically looking for any suggestions on how to go about getting a test harness on a legacy .exe project in Visual C++