Cross Platform Unit Testing with C++

Davis, Patrick P (US) 1 Reputation point
2021-01-26T14:28:46.463+00:00

Our shop is in the process of migrating our Microsoft Visual Studio 2019 solution over to Linux utilizing the newly added Cross-Platform build option within Visual Studio. For the most part things have been going smoothly building, running, and debugging our projects, however we are hitting an issue trying to get our existing unit test suite migrated as well. We are utilizing the Microsoft Native C++ Unit Test Framework on Windows that is easily integrated into the Test Explorer window. Unfortunately it doesn't seem this option is available yet with the cross-platform build option. Are there plans for you all to add support for this in future Visual Studio updates? If not, are there any workarounds you all have used to get unit tests working within Visual Studio?

Visual Studio Testing
Visual Studio Testing
Visual Studio: A family of Microsoft suites of integrated development tools for building applications for Windows, the web and mobile devices.Testing: The act or process of applying tests as a means of analysis or diagnosis.
351 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Tianyu Sun-MSFT 31,246 Reputation points Microsoft Vendor
    2021-01-27T08:03:16.43+00:00

    Hello @Davis, Patrick P (US) ,

    Currently, there isn’t any support for this feature in Visual Studio. This requirement had been suggested before and is under review, you can follow this thread: Make Microsoft Unit Testing Framework for C++ cross platform, and vote, add comments there. Or you can start a new thread in Developer Community from Visual Studio > Help > Send Feedback > Suggest a Feature. If you do start a new thread to suggest this feature, please share the link here, other forum members, include me, who are interested or need the same feature can go to vote for this thread.

    For the workaround, since it is not available to migrate the whole existing unit test to the Linux in Visual Studio, perhaps, you can consider trying to use Google Test.

    Best Regards,
    Tianyu

    • If the answer is helpful, please click "Accept Answer" and upvote it.
      Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.
    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.