ENH: Convert 18 Modules/Core/Common tests from CTest to GoogleTest#6246
Open
hjmjohnson wants to merge 1 commit intoInsightSoftwareConsortium:mainfrom
Open
ENH: Convert 18 Modules/Core/Common tests from CTest to GoogleTest#6246hjmjohnson wants to merge 1 commit intoInsightSoftwareConsortium:mainfrom
hjmjohnson wants to merge 1 commit intoInsightSoftwareConsortium:mainfrom
Conversation
Member
Author
|
@greptile review |
This comment was marked as resolved.
This comment was marked as resolved.
Mechanical CTest -> GTest conversion of 18 no-argument tests in
Modules/Core/Common/test, using git mv + minimal-diff wrap-and-call:
the original itkFooTest(int, char*[]) function body is preserved
verbatim (including comments, std::cout output, and blank-line
layout), wrapped in an anonymous namespace as DoFooTest, and invoked
from a single TEST(Foo, ConvertedLegacyTest) block. #include
"itkGTest.h" is added; no other content edits. Each renamed file is
above git's 50% similarity threshold so git log --follow tracks
through the conversion.
Converted (alphabetical):
itkBSplineInterpolationWeightFunctionTest
itkConicShellInteriorExteriorSpatialFunctionTest
itkEllipsoidInteriorExteriorSpatialFunctionTest
itkFileOutputWindowTest
itkFiniteCylinderSpatialFunctionTest
itkFrustumSpatialFunctionTest
itkRealTimeClockTest
itkSTLContainerAdaptorTest
itkSimpleFilterWatcherTest
itkSparseFieldLayerTest
itkSparseImageTest
itkSpatialFunctionTest
itkSpatialOrientationTest
itkSymmetricEllipsoidInteriorExteriorSpatialFunctionTest
itkTorusInteriorExteriorSpatialFunctionTest
itkVariableSizeMatrixTest
itkVNLSparseLUSolverTraitsTest
itkZeroFluxBoundaryConditionTest
CMakeLists.txt updated: legacy entries removed from ITKCommon{1,2}Tests
and itk_add_test blocks dropped; new *GTest.cxx entries inserted
alphabetically into ITKCommonGTests.
2630715 to
1f866e7
Compare
Member
Author
|
Fixed in 1f866e7 — corrected count from 17 to 18 in commit subject, PR title, and PR body. Greptile P2 finding addressed. |
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.
Mechanical CTest → GoogleTest conversion of 18 no-argument tests in
Modules/Core/Common/test. Each file usesgit mv+ minimal-diffwrap-and-call so
git log --followwalks through the rename.Conversion pattern
The original
int itkFooTest(int, char *[])body is preservedverbatim — every comment, blank line, and
std::coutline — wrappedin an anonymous namespace as
DoFooTest, and invoked from a singleTEST(Foo, ConvertedLegacyTest)block. The only edits are:#include "itkGTest.h"after the primary include.namespace { int Foo(...) → namespace { int DoFoo(...).} // namespace+TEST(Suite, ConvertedLegacyTest) { EXPECT_EQ(0, DoFoo(0, nullptr)); }.No logic, no assertion conversion, no comment edits. Each rename
pair stays well above git's 50% similarity threshold (91-97%).
Tests converted (alphabetical)
Modules/Core/Common/test/CMakeLists.txt: legacy entries removedfrom
ITKCommon{1,2}Tests+ theiritk_add_testblocks dropped;new
*GTest.cxxentries inserted alphabetically intoITKCommonGTests.Local verification
pre-commit run --all-filescleanITKCommonGTestDriverbuilds./bin/ITKCommonGTestDriver --gtest_filter='*ConvertedLegacyTest*'→ 39/39 passed (some files contain multipleTESTblocks)