From: earthwormgaz on
I want to Unit Test a program I've written with Visual C++.

I'm going to use CppUnit. I created a new project, wrote some basic
tests, and made the new Unit Test project dependant on the one for the
program under test.

I get link errors though. I can't add a library to the list of deps to
solve this, because the project I want to Unit Test build a .exe, not
a .lib!

Any ideas?
From: Carl Daniel [VC++ MVP] on
earthwormgaz wrote:
> I want to Unit Test a program I've written with Visual C++.
>
> I'm going to use CppUnit. I created a new project, wrote some basic
> tests, and made the new Unit Test project dependant on the one for the
> program under test.
>
> I get link errors though. I can't add a library to the list of deps to
> solve this, because the project I want to Unit Test build a .exe, not
> a .lib!
>
> Any ideas?

Factor your code into a library (that you can unit test) and a driver (the
main flow of the exe).

-cd