Search code examples
c++unit-testingmstest

Ignore C++ unit tests


Is there a simple way to ignore C++ unit tests in Microsoft Unit test Framework? The only way I could find is to set the test priority.

BEGIN_TEST_METHOD_ATTRIBUTE(FooTest)
    TEST_PRIORITY(1)
END_TEST_METHOD_ATTRIBUTE()
TEST_METHOD(FooTest)
{
}

Is there a smarter way to achieve this?

In for example Google Test you can specify tests that can be ignore and write a comment why they are ignored.


Solution

  • Use TEST_IGNORE() instead of the TEST_PRIORITY() in your code snippet.