title: How to Skip a Portion of the ”Code” in the source code while doing GoogleTest
body: <p>I tried using a debug flag addition (<strong>GOOGLE_TEST</strong>) in the source code and defined it in the TEST/Makefile.am. but the things didn’t work. I am using C++ Language.
  Note: I don’t want to change anything in the SRC Directory code which will affect the production code and its Makefile.am</p>
  
  <h1>Test Class in SRC Directory</h1>
  
  <pre><code>class Common: public Thread {
   public:
    friend class test_common;
    Common {
    }
    ~Common () {
    }
    virtual void ThreadMain();
   protected:
    virtual void ProcessData(void);
  };
  void Common::ProcessData(void) {
    #ifndef __GOOGLE_TEST__
    while (1) { }
    #endif
  }
  </code></pre>
  
  <h1>TESTCODE in test Directory</h1>
  
  <pre><code>class test_common : public ::testing::Test {
  };
  TEST_F(test_common, create_common) {
      Common commonObj();
      commonObj. ProcessData ();
  }
  </code></pre>
  
  <h1>OUTPUT</h1>
  
  <p>GTest Stuck in the While loop part even after defining the flag in the test/makefile.am</p>