Skip to content

ENH: Convert five Core/Common CTests to GoogleTest - #6369

Merged
dzenanz merged 6 commits into
InsightSoftwareConsortium:mainfrom
hjmjohnson:convert-core-common-gtests-batch1
Jun 3, 2026
Merged

dzenanz merged 6 commits into
InsightSoftwareConsortium:mainfrom
hjmjohnson:convert-core-common-gtests-batch1

Conversation

@hjmjohnson

Copy link
Copy Markdown
Member

Convert five no-argument CTests in Modules/Core/Common/test to GoogleTest, one mechanical conversion per commit, plus a follow-up commit that adds result assertions to the previously assertion-free itkNumericsTest.

Each conversion preserves history via git mv, maps the original if (...) return EXIT_FAILURE checks to the most specific EXPECT_* macro, and was built and run locally (ITKCommonGTestDriver, macOS arm64 Release) — all converted tests pass.

Per-commit summary
Test Conversion notes
itkVersorTest → itkVersorGTest 14 scoped blocks → one TEST(Versor, ConvertedLegacyTest); Math::Absolute(a-b) > eps → EXPECT_NEAR, two throw-expecting blocks → EXPECT_THROW; helpers in an anonymous namespace
itkImageVectorOptimizerParametersHelperTest → …GTest helper checks → EXPECT_EQ (exact); ITK_TRY_EXPECT_EXCEPTION → EXPECT_THROW
itkImageAlgorithmCopyTest2 → itkImageAlgorithmCopyGTest2 ITK_TEST_EXPECT_TRUE(CheckBuffer(...)) → EXPECT_TRUE (genuine boolean predicate)
itkCompensatedSummationTest2 → appended to itkCompensatedSummationGTest added TEST(CompensatedSummation, ConvertedLegacyTest2) with the multi-thread helper; Absolute(ref-comp) > Absolute(ref-uncomp) → EXPECT_LE
itkNumericsTest → itkNumericsGTest mechanical wrap (the original asserted nothing)
+ Verify SVD solve results follow-up commit asserting the non-singular solution [7,0,0] and the singular minimum-norm solution [35/6, 7/3, -7/6]; expected values captured from the real run and cross-checked against the null-space projection

@github-actions github-actions Bot added type:Infrastructure Infrastructure/ecosystem related changes, such as CMake or buildbots type:Enhancement Improvement of existing methods or implementation area:Python wrapping Python bindings for a class type:Testing Ensure that the purpose of a class is met/the results on a wide set of test cases are correct area:Core Issues affecting the Core module labels May 31, 2026
@hjmjohnson
hjmjohnson marked this pull request as ready for review May 31, 2026 17:48
@greptile-apps

This comment was marked as resolved.

@dzenanz dzenanz left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good on a quick glance. It would be good if someone reviewed this more carefully.

@hjmjohnson
hjmjohnson requested a review from thewtex June 2, 2026 21:02
@hjmjohnson

Copy link
Copy Markdown
Member Author

@dzenanz Any suggestions for active developers who could review? I'm happy to continue the conversion to gtests, but it feels like the enthusiasm for these conversions has dropped off. There are about 600 more no-argument tests that could be converted (mostly mechanical at this point). I find it's a lot easier to debug the gtest than the other tests, and I find that they are much less verbose, but perhaps the pain of bulk conversions is too much of a burden given the ever-shrinking ITK developer community.

@dzenanz
dzenanz merged commit c25479f into InsightSoftwareConsortium:main Jun 3, 2026
20 checks passed
@dzenanz

dzenanz commented Jun 3, 2026

Copy link
Copy Markdown
Member

600 more no-argument tests

Perhaps do these conversion as you "touch" tests for other reasons. Changes require effort, and the value of these test conversions is on the low side.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:Core Issues affecting the Core module area:Python wrapping Python bindings for a class type:Enhancement Improvement of existing methods or implementation type:Infrastructure Infrastructure/ecosystem related changes, such as CMake or buildbots type:Testing Ensure that the purpose of a class is met/the results on a wide set of test cases are correct

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants