0

I have a test fixture:

class UnitTestCompositor :public ::testing::Test 
{
public:
    UnitTestCompositor(){}

    void SetUp()
    { 
         //some setup code ...  
    }

    void TearDown() {
    }

    ~UnitTestCompositor() {
    }
}

and i have a bunch of tests:

TEST_F(UnitTestCompositor, DISABLED_CheckDistortionMeshes){
    // test code
}
TEST_F(UnitTestCompositor, DISABLED_CheckLeftAndRightEyeMeshes){
    // test code
}

So now i have these tests disabled individually, is there a way to disable the SetUp() code from running? or disable the test Fixture and tests from running all together apart from commenting the code?

Abhinav
  • 111
  • 1
  • 8
  • The SetUp() function doesn't run when the corresponding test cases are disabled anyway.... – Abhinav Jan 17 '17 at 01:54
  • As you've discovered, no `UnitTestCompositor` methods are run if you don't run any `UnitTestCompositor` tests. That's because instances of the fixture class `UnitTestCompositor` are only constructed in `UnitTestCompositor` tests. Otherwise your question is a duplicate of [GoogleTest: How to skip a test?](http://stackoverflow.com/q/7208070/1362568) [This answer](http://stackoverflow.com/a/7208148/1362568) is the one you want. – Mike Kinghan Jan 17 '17 at 18:06
  • Yep, a close duplicate, thanks! – Abhinav Jan 17 '17 at 18:08

0 Answers0