locked
Test Explorer in VS2013 doesn't show messages of Standard Library exceptions RRS feed

  • Question

  • If a std::exception is thrown from my code, Test Explorer will just show "Message: Unhandled C++ Exception". An example:

    namespace UnitTest1
    {
        void ProductionCode() { throw runtime_error("Foobar"); }

        TEST_CLASS(UnitTest1)
        {
        public:
            TEST_METHOD(TestMethod1)
            {
                ProductionCode();
            }
        };
    }

    Here, I expect Test Explorer to say "Message: Foobar", but it doesn't. Is it possible to make it recognize Standard Library exceptions, or do I just have some settings wrong?

    Tuesday, January 21, 2014 9:44 PM

Answers

  • Hi,

    I tried your code on my Visual Studio 2012. I got the same result with you. I doubt that Visual C++ native unit test can’t recognize Standard Library exceptions. I suggest you should try to catch the exception and then output the exception message using some C++ output method.

    Also you could get the issue confirmed and diagnose by product team.

    You can submit a feedback to Microsoft Connect feedback portal: http://connect.microsoft.com, Microsoft engineers will evaluate them seriously. After you submit the feedback, you can post the link here which will be beneficial for other members with the similar issue. And I will help you to vote it.

    Best regards,


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Wednesday, January 22, 2014 7:35 AM