How should one use the TEST_IGNORE()
macro in native VC++ unit test projects in Visual Studio 2015? I'm used to using [Ignore]
in C#, but I'm apparently missing something in VC++.
Here's what I've tried, but the TEST_IGNORE()
macro expands out to invalid code (lots of "unexpected tokens" and "syntax error:'{'" errors...)
TEST_CLASS(MyTests)
{
public:
TEST_IGNORE()
TEST_METHOD(TestSomething)
{
/*Test code is here*/
}
};
Figured it out. You have to sandwich the TEST_IGNORE()
macro in between BEGIN_TEST_METHOD_ATTRIBUTE(testName)
and END_TEST_METHOD_ATTRIBUTE()
So the above code becomes
TEST_CLASS(MyTests)
{
public:
BEGIN_TEST_METHOD_ATTRIBUTE(TestSomething)
TEST_IGNORE()
END_TEST_METHOD_ATTRIBUTE()
TEST_METHOD(TestSomething)
{
/*Test code is here*/
}
};
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With