ENH: Convert 4 no-argument CTests to GoogleTest#6045
Merged
hjmjohnson merged 8 commits intoInsightSoftwareConsortium:mainfrom Apr 13, 2026
Merged
ENH: Convert 4 no-argument CTests to GoogleTest#6045hjmjohnson merged 8 commits intoInsightSoftwareConsortium:mainfrom
hjmjohnson merged 8 commits intoInsightSoftwareConsortium:mainfrom
Conversation
5429771 to
85759ac
Compare
85759ac to
ce5792c
Compare
This comment was marked as resolved.
This comment was marked as resolved.
ce5792c to
88deb32
Compare
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.
Convert 4 no-argument legacy CTests to GoogleTest from 4 different module directories. Each test uses a two-commit pattern:
git mvrename (preservesgit log --followhistory) then content conversion + CMakeLists.txt update.itkNthElementPixelAccessorTest→ Core/ImageAdaptorsitkVarianceImageFunctionTest→ Core/ImageFunctionitkTensorRelativeAnisotropyImageFilterTest→ Filtering/DiffusionTensorImage (new GTest driver)itkChiSquareDistributionTest→ Numerics/Statistics (new GTest driver, split into 7 TEST() blocks)All 11 tests build and pass locally (LLVM 22, macOS arm64).
Conversion details
History preservation: Each conversion starts with a pure
git mvcommit (100% rename similarity) sogit log --follow itkFooGTest.cxxtraces back through the original test's full history.New GTest infrastructure added to DiffusionTensorImage and Statistics modules (
set(*GTests ...)+creategoogletestdriver()).ChiSquareDistribution split into 7
TEST()blocks matching the original's logical sections: BasicObjectProperties, CDF at 1/11/100 dof, ParameterVectorAPI, SeparateParameterAPI, WrongParametersThrow, SetGetDegreesOfFreedom. Repeated CDF/inverse verification extracted intoVerifyCDF()/VerifyInverseCDF()helpers.ITK_TRY_EXPECT_EXCEPTION→EXPECT_THROW.NthElementPixelAccessor now asserts all 3 vector components (not just index 0).
CMake source lists kept alphabetically sorted per project convention.