ITKSphinxExamples icon indicating copy to clipboard operation
ITKSphinxExamples copied to clipboard

compare_to_baseline in parent directory CMakeLists.txt

Open brad-t-moore opened this issue 4 years ago • 1 comments

Is there a reason why the cookiecutter generates compare_to_baseline() calls for a new example in the parent directory's CMakeLists.txt and not the CMakeLists.txt of the example itself? I just got through a bit of a run around trying to figure how and where these additional tests were being made. In my case, my example didn't generate an image baseline to compare against, and so this was causing errors.

For example: https://github.com/InsightSoftwareConsortium/ITKSphinxExamples/blob/8665c931a16d7f6134e7c55818cbe686d3f71f7e/src/Filtering/ImageStatistics/CMakeLists.txt#L35-L38

https://github.com/InsightSoftwareConsortium/ITKSphinxExamples/blob/8665c931a16d7f6134e7c55818cbe686d3f71f7e/src/Filtering/ImageStatistics/StatisticalPropertiesOfRegions/CMakeLists.txt#L24-L25

My naive suggestion is to put that compare_to_baseline() test generation adjacent to the add_test() code.

brad-t-moore avatar Mar 18 '21 19:03 brad-t-moore

Parent directory is built as part of ITKExamples, so it has access to all the CMake machinery. The example directory can be taken out of the hierarchy and it should still configure and compile, all while being simple.

dzenanz avatar Mar 18 '21 22:03 dzenanz