
Thanks a lot for your message, Richard. Following the messages from other people in this thread, I was resolved to do what you/say, by being convinced that your tutorial, as I have understood it, was supposed to work on Visual 2008, but that Visual 2010 introduced a bug. Thanks a lot for the clarification. It seems I didn't read you tutorial with enough care. ----- Mail original -----
De: "Richard"
À: boost-users@lists.boost.org Envoyé: Vendredi 5 Avril 2013 20:36:47 Objet: Re: [Boost-users] Boost.Test : Project setting in Visual 2010 [Please do not mail me a copy of your followup]
boost-users@lists.boost.org spake the secret code
If you look more closely at my tutorial, the static library contains the system under test.
The unit tests are *not* in the library containing the system under test.
In the section "First Failing Test: Going Red", I wrote:
"Add a new source file to the Test project called TestPrimeFactors.cpp and enter this code:"
You don't want to mix production code and test code into the same source files, or the same project. If you start to mix them together, it's too easy for production code to somehow start depending on test code, or production code having data in it that is only used for testing and so-on.
If you keep the production code and test code separate, then it is harder for test code to accidentally sneak into production code.
In these tutorials, I do this by keeping all the unit tests in the project that builds the test executable and all the production code in a static library that is a link input to the test executable.