Skip to content

ENH: Refactor test/CMakeLists.txt to adhere to ITK module convention#900

Open
axel-grc wants to merge 2 commits intoRTKConsortium:mainfrom
axel-grc:Tests
Open

ENH: Refactor test/CMakeLists.txt to adhere to ITK module convention#900
axel-grc wants to merge 2 commits intoRTKConsortium:mainfrom
axel-grc:Tests

Conversation

@axel-grc
Copy link
Collaborator

  • Changed the main function in various test files to specific test function names .
  • Updated the CMakeLists of tests to follow itk convention with createtestdriver

Close #896

@axel-grc
Copy link
Collaborator Author

There is a problem with the example tests: with the ITK convention, tests are dispatched by the test driver and must provide an entrypoint like int (int,char**). The examples are standalone programs with a main(), and I don’t think it’s a good idea to rewrite their main just to fit the test driver pattern.

For now, I kept the previous approach only for examples: build each example as its own executable and register it with CTest via itkTestDriver.

Do you have any insight on this, @SimonRit

@SimonRit
Copy link
Collaborator

There is a problem with the example tests: with the ITK convention, tests are dispatched by the test driver and must provide an entrypoint like int (int,char**). The examples are standalone programs with a main(), and I don’t think it’s a good idea to rewrite their main just to fit the test driver pattern.

For now, I kept the previous approach only for examples: build each example as its own executable and register it with CTest via itkTestDriver.

Do you have any insight on this, @SimonRit

I'm not following. This seems to be the convention of a main function in C which is ok to adopt for all examples as is done in FirstReconstruction:
https://github.com/RTKConsortium/RTK/blob/main/examples/FirstReconstruction/FirstCudaReconstruction.cxx#L12

@axel-grc axel-grc force-pushed the Tests branch 7 times, most recently from 1b84313 to 65201ef Compare February 18, 2026 10:17
@axel-grc axel-grc force-pushed the Tests branch 4 times, most recently from c2d8f2f to cef2b26 Compare March 4, 2026 14:29
@SimonRit SimonRit changed the title WIP: Refactor test/CMakeLists.txt to adhere to ITK module convention ENH: Refactor test/CMakeLists.txt to adhere to ITK module convention Mar 5, 2026
@axel-grc axel-grc force-pushed the Tests branch 4 times, most recently from bc85954 to c615189 Compare March 5, 2026 15:42
Copy link
Collaborator

@SimonRit SimonRit left a comment

Choose a reason for hiding this comment

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

Thanks!

@SimonRit SimonRit force-pushed the Tests branch 3 times, most recently from 281abe3 to efd77ce Compare March 6, 2026 10:42
- Changed the main function in various test files to specific test function names.
- Updated the CMakeLists of tests to follow itk convention with createtestdriver
@axel-grc axel-grc force-pushed the Tests branch 2 times, most recently from 5ab04b8 to 2b9158f Compare March 10, 2026 09:39
@SimonRit SimonRit force-pushed the Tests branch 4 times, most recently from 26b633d to 67075f4 Compare March 10, 2026 11:46
@SimonRit SimonRit force-pushed the Tests branch 14 times, most recently from 6d28822 to be79fd6 Compare March 11, 2026 08:24
@axel-grc axel-grc force-pushed the Tests branch 6 times, most recently from e6422c7 to df93c4d Compare March 17, 2026 10:52
@SimonRit SimonRit force-pushed the Tests branch 8 times, most recently from 05c2ca1 to 17d47e8 Compare March 18, 2026 08:26
The problem is caused by the explicit definition of templated parents
in Cuda filters. The parents are now explicitely instantiated to avoid
this problem. The code is based on explicit template instantiation in
ITK, e.g., MINCTransformIOTemplate.

Note that two Cuda filters based on ITK filters have been left out:
CudaCropImageFilter and CudaWarpImageFilter.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Refactor test/CMakeLists.txt to adhere to ITK module convention

2 participants