title: How can I subclass gtest testing::Test?
body: <p>I have test classes with some common functionality, and I want to create something like </p>
  
  <pre><code>class BaseTest : public testing::Test
  </code></pre>
  
  <p>then derive further subclasses, like </p>
  
  <pre><code>class StuffTest : public BaseTest
  </code></pre>
  
  <p>However, the compiler gives the error message</p>
  
  <pre><code>error: use of deleted function 'StuffTest::StuffTest()'
  TEST_F(StuffTest, SFile)
  </code></pre>
  
  <p>How can I derive test subclass, and why this strange error message?</p>
  
  <p>Added some test code:
  (I want to add a test name in the subclasses. Without constructor, it works OK. With constructor I experience weird syntax errors.)</p>
  
  <pre><code>#include &lt;gtest/gtest.h&gt;
  
  using namespace std;
  
  // A new test class  of these is created for each test
  class BaseTest
    : public testing::Test
  {
  public:
   // BaseTest(string a);
  BaseTest();
     virtual void SetUp()
     { cerr &lt;&lt; "Setting up " &lt;&lt; MyName;}
     virtual void TearDown()
     {cerr &lt;&lt; "Closing down " &lt;&lt; MyName;}
  protected:
    string MyName;
  };
  
  
  //BaseTest::BaseTest(string TestName)
  BaseTest::BaseTest()
  : testing::Test
  {
  //  MyName = TestName;
  }
  
  TEST_F(BaseTest, Tools)
  {
    cerr &lt;&lt; "Something was wrong\n";
  }
  
  
  // A new test class  of these is created for each test
  class MyStuffTest : BaseTest
  {
  public:
  };
  /*
  TEST_F(MyStuffTest, Tools)
  {
    cerr &lt;&lt; "Something was wrong\n";
  }
  */
  
  
  int main(int argc, char **argv) {
    testing::InitGoogleTest(&amp;argc, argv);
     return RUN_ALL_TESTS();
  }
  </code></pre>