COMP: Enable ITKGoogleTest whenever BUILD_TESTING is on - #6778
Closed
hjmjohnson wants to merge 1 commit into
Closed
Conversation
Any module's test kit may create a GoogleTest driver, but ITKGoogleTest was enabled only as a TEST_DEPENDS of individual modules. Selections that omitted it failed at configure time with GTest::gtest not found, for instance -DITK_BUILD_DEFAULT_MODULES=OFF -DModule_ITKIONRRD=ON -DBUILD_TESTING=ON. Seven modules that call CreateGoogleTestDriver do not list ITKGoogleTest in their itk-module.cmake, and the set of modules without GoogleTest tests keeps shrinking, so require the module for testing builds rather than tracking the dependency per module.
Member
|
The premise of the first sentence is wrong. Each module needs to have it in there test depends to ensure cmake interfaces are correct. |
Member
Author
|
Closing. The premise is wrong: The seven modules that call |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
BUILD_TESTING=ONnow mandatesITKGoogleTest, instead of relying on each module to list it inTEST_DEPENDS. Any module's test kit may callCreateGoogleTestDriver, and the set of modules with no GoogleTest tests keeps shrinking, so tracking the dependency per module is the wrong lever.Fixes a configure failure on current
main:Found while auditing #6776 / #6777; independent of both.
Scope: seven modules have the same latent omission
72 modules call
CreateGoogleTestDriver; these seven do not nameITKGoogleTestin theiritk-module.cmake, so any selection that enables one of them without separately pulling inITKGoogleTesthits the error above:Adding seven
TEST_DEPENDSentries would fix today's instances and leave the next one to be discovered the same way. This PR removes the class instead. The seven entries are left alone; they are harmless where present.Verification
ITKGoogleTestenabled afterModule_ITKIONRRD=ON+BUILD_TESTING=ONModule_ITKIONRRD=ON+BUILD_TESTING=OFFBUILD_TESTING=ONEnablement checked by the presence of
lib/cmake/ITK-6.0/Modules/ITKGoogleTest.cmakein each build tree. The guard isBUILD_TESTING AND NOT DISABLE_MODULE_TESTS, so a testing build that adds no module test directories does not pull the module in.