Similar to my previous question but specifically for the Microsoft Unit Testing Framework:
Visual Studio 2017 has integrated C++ unit testing (MS unit testing, google test, etc.). How can I create a CMakeLists.txt file that will create a project like this that will use the integrated IDE testing, specifically using the Microsoft Unit Testing Framework?
Thank you!
This works for me:
CMakeLists.txt
You might need to change the path to where you have Visual Studio installed.
tests.cpp
In the Tests output I have
Please note that from Visual Studio 2019 this test framework will be deprecated, so I would not adive you to invest in it. From the release notes: "The Managed C++ Test Project template is no longer available. You can continue using the Managed C++ Test framework in your existing projects but, for new unit tests, consider using one of the native test frameworks for which Visual Studio provides templates (MSTest, Google Test) or the Managed C# Test Project template"