Well the area that it could immediately benefit the most is the networking code rewrite and I'm starting to think that it's a wonderful way forward. For one, it wont require me to start up two instances of the game, go through the sequence of hosting a game on one side and joining it on the other -- they could execute in the same process in the test code. For another, it seems like a good way to enforce loose coupling -- problems with the networking layer are discovered there and problems with the UI will be easier to troubleshoot (harder to unit test UI, but not impossible). Finally, it will cause design problems which lead to tight coupling to scream at you, that is, when you run into tight coupling, it will become very obvious when writing the test for that code.
So thanks for all of the input on this topic bork. I definitely prefer to keep tests separated from the original code. As for the "in the same directory" concept, I agree that it's quite helpful with JUnit because of Java's package/directory hierarchy scheme for sources. Even as such, when I've used JUnit in the past, I've always put tests under ./src/test. [OT] I even had the SCM team (Source Control Management) tell me to take the "test" directory out because they thought I just created it for some test. I had to explain unit tests to them. I really better not get started complaining about my previous job, it sucked! [/OT] Back on topic, the other problem is Matze's jam-based build system just compiles all c/cpp files that it finds in the source tree you throw at it. I'm sure it could be modified to perform otherwise, but that would also be breaking its paradigm (and I don't understand it that deeply). As it is, I'll need to confront the build system to create a target to build the tests.
So I'm going to give CPPUnit a spin and see how it works out. If it's simple enough, then that'll be my vote.