Why are tests in a separate project? #146
-
Hi, I have been using cmake-init as a source of inspiration and best practices for a while now, so thanks for putting in all the work. I am wondering, though, why the tests are in a separate project. By this I mean the |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Keeping the testing as a separate project enables you to also test the project when installed as a relocatable CMake package. This ensures that you use the same workflow your users would, i.e. However, I did not make this the default in CI primarily because that would require a bit more code and the setup would be different than what the developers have locally. I should probably put an example together to show what testing using the install interface looks like at least. |
Beta Was this translation helpful? Give feedback.
Keeping the testing as a separate project enables you to also test the project when installed as a relocatable CMake package. This ensures that you use the same workflow your users would, i.e.
find_package()
followed by everything else.However, I did not make this the default in CI primarily because that would require a bit more code and the setup would be different than what the developers have locally. I should probably put an example together to show what testing using the install interface looks like at least.