Trouble with External Module Tests

I want to upgrade my external module to use the new re-usable github actions before adding a new filter.

However, I am having trouble with the baseline data.

  • first I was storing the data in the git repository (as in the main branch), but the windows cxx text build was failing to load the baseline image (could not create ImageIO factory). Locally, on my mac it works. On the CI only the windows job fails, the ubuntu and mac job passed.
  • I also tried using ExternalData: I uploaded the data to https://data.kitware.com/#folder/64c15003b4d956782eee8ee3. But I get the same symptoms.

Exception detected while reading D:/a/ITKTopologyControl/build/ExternalData/test/Baseline/itkFixTopologyCarveOutsideTestOutput.mha : Could not create IO object for reading file D:/a/ITKTopologyControl/build/Testing/Temporary/itkFixTopologyCarveOutsideTestOutput.mha
add FixTopologyCarveInside: grow from inside under topological constraints · dyollb/ITKTopologyControl@19f0c47 · GitHub

Any idea what I am doing wrong?

1 Like

interesting: I changed the base class of my filter and ITK_EXERCISE_BASIC_OBJECT_METHODS failed. But only in the windows build. I wonder why this test is disabled for gcc


The error message above was just a consequence, since the test didn’t finish executing and didn’t write an output file.

These may explain it:
COMP: Avoid Superclass type alias GCC compile errors by thewtex · Pull Request #2720 · InsightSoftwareConsortium/ITK · GitHub
ITK/Modules/Core/TestKernel/include/itkTestingMacros.h at master · InsightSoftwareConsortium/ITK · GitHub

yes.

I wonder if (in this PR) you tried something like:

#if defined(__GNUC__)
#define ITK_EXERCISE_BASIC_OBJECT_METHODS(object, ClassName, SuperclassName)                                           \
  object->Print(std::cout);                                                                                            \
  std::cout << "Name of Class = " << object->GetNameOfClass() << std::endl;                                            \
  using self_t = std::remove_reference<decltype(*object)>::type; \
  using parent_t = typename self_t::Superclass; \
  std::cout << "Name of Superclass = " << dynamic_cast<parent_t&>(*object).GetNameOfClass() << std::endl; \
  ITK_MACROEND_NOOP_STATEMENT
1 Like

Not sure about the benefit; would that allow making the macro be quantitative for GCC ?

You may want to submit a PR.

1 Like

I realize GetNameOfClass is virtual, so no benefit, and no PR.