2

Generally, we like to have a common folder for common header files to be shared among various projects in solution but what about googletest since it needs access to all header files of project to test them? Is it the norm for googletest project to include files from target project directly?

Solution
   ├── Project1
   ├── Project2
   ├── Projec1_GTest
   └── Project2_Gtest

As we can see both Project1 and Project2 have corresponding Gtest projects. So Project_Gtest should just include the headers from Project1 directly from there, right? It's a bit cross-linked but it make sense to me to use them like that with googletest.

  • You can put the test files within in your project folder and call them "tests" instead. Then exclude these test folders from your actual build. – nikhil_kotian Jan 29 '18 at 16:10

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.