Question

we have a huge codebase with about 1000k lines of native/unmanaged legacy c++ - code and we are going to provide the code with unit tests and MSTest would fit perfectly in our current development environment (TFS, VS 2010, ...). I know that MSTest is orginally meant to test managed code but its also possible to write unit tests for unmanaged sc.

Are there any (later) drawbacks on the usage of MSTest for unmanaged code? Does anyone have any experience on this?

The second opinion would be using Google.Test, but I would have to write a Visual Studio add-in to integrate the gtest framework in our environment.

Thanks in advance!

Was it helpful?

Solution

I would not recommend MSTest for managed testing. See here for my experiences. However if you do insist I would say a really good way to test you legacy code would be use PInvoke interop to your c++ code.

OTHER TIPS

I would recommend googletest anyway. I think they will also gladly accept your VS integration and include it in the next release, provided the patch has reasonable quality.

Oh, and you can use another great Google project then, gmock.

I use the Boost.Test framework to test my C++ code in Visual Studio without any issues. You need to create a test project (a console-mode EXE) that contains your tests which your main project can depend on. Using the Visual Studio 'post build' step you can run the tests automatically.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top