131 reputation
5
bio website legalizeadulthood.wordpress.c…
location Salt Lake City, UT
age 49
visits member for 2 years, 5 months
seen Jan 29 '13 at 22:40

I was a Direct3D Microsoft MVP for 10 years.


Nov
17
comment Is anyone doing “real” TDD with Visual-C++, and if yes, how do they do it?
Yes, of course you can't use Windows specific technologies on non-Windows platforms. My observation was simply that if you have platform agnostic code then you don't want to tie your unit tests to a particular platform. At a previous employer, we avaluated a large number of unit test frameworks and methods. We chose Boost.Test because it was cross platform and if anything was ever to end up in the C++ standard library regarding unit testing, it would most likely be Boost.Test.
Nov
16
comment Is anyone doing “real” TDD with Visual-C++, and if yes, how do they do it?
You need two built products: production code (static library, shared library, executable, etc) and a test executable. In Visual Studio, each built product corresponds to a project, so you need two projects. It really isn't any more complicated than that. The unit test project is NOT redundant.
Nov
16
comment Is anyone doing “real” TDD with Visual-C++, and if yes, how do they do it?
In addition, if your tests are in C++/CLI, then you can't run them on other platforms. Most places where I've used C++ they needed the cross-platform compilation abiility. Of course you can't reuse the VS project on other platforms, but it isn't a big deal to have Makefiles or SConscripts for it.
Nov
16
comment Is anyone doing “real” TDD with Visual-C++, and if yes, how do they do it?
I find that using the C++/CLI stuff for unit testing just muddies the waters when testing pure native C++ code. I have used NUnit to test C++/CLI application code, however. I wrote my tests in C# and that worked just fine. (The existing code base was C++/CLI and I didn't want to port it to C#.)
Nov
16
awarded  Supporter
Nov
16
comment Is anyone doing “real” TDD with Visual-C++, and if yes, how do they do it?
I'm not sure how Java works with projects; I have limited experience there. From what little I know, I understand the projects to be an artifact of the IDE and not the language. (Strictly speaking, this is also true for C#, but I don't know anyone that just uses the command-line compiler for anything other than short blog articles or demonstrations.) However, even in Java you definitely keep the test code separate from the production code, which is what separate projects are doing for you. I never recommend conditionally compiling C++ to separate production and test code.
Nov
16
awarded  Revival
Nov
16
awarded  Teacher
Nov
15
awarded  Editor
Nov
15
revised Is anyone doing “real” TDD with Visual-C++, and if yes, how do they do it?
added 512 characters in body
Nov
15
comment Is anyone doing “real” TDD with Visual-C++, and if yes, how do they do it?
Seriously? "Tip: Each test should contain one main function and generate one executable." This sounds ridiculously slow for any reasonable amount of tests. Even if they mean only one test fixture per executable, its still silly advice IMO. Try doing that with thousands of tests (for a medium sized project) or hundreds of thousands of tests (for a large project) and you'll most definitely go insane.
Nov
15
answered Is anyone doing “real” TDD with Visual-C++, and if yes, how do they do it?
Nov
15
awarded  Autobiographer