MSTest for a huge legacy codebase

we have a huge codebase with roughly 1000k lines of inline / unmanaged legacy C ++ code and we're going to provide the code with unit tests and MSTest will fit perfectly into our current development environment (TFS, VS 2010, ...) ... I know that MSTest is originally intended to test managed code, but it is also possible to write unit tests for unmanaged sc.

Are there any (more recent) downsides to using MSTest for unmanaged code? Does anyone have experience with 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 into our environment.

Thanks in advance!

+2


source to share


3 answers


I would not recommend MSTest for guided testing. See here for my experience. However, if you insist, I would say that a really good way to test your legacy code would be to use PInvoke in your C ++ code.



+2


source


I would recommend googletest anyway. I think they will also happily accept your VS integration and will include it in the next release if the patch is of reasonable quality.



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

+1


source


I am using Boost.Test framework to test C ++ code in Visual Studio without any problem. You need to create a test project (EXE console mode) that contains your tests that your main project depends on. Using the Visual Studio post-build step, you can automatically run tests.

0


source







All Articles