View Issue Details

IDProjectCategoryView StatusLast Update
0002951Slicer4Core: Base Codepublic2013-02-18 08:52
Reporterpinter Assigned Tojcfr  
PrioritynormalSeverityminorReproducibilityhave not tried
Status closedResolutionfixed 
Product Version 
Target VersionSlicer 4.3.0Fixed in VersionSlicer 4.3.0 
Summary0002951: Update test framework to call initialize ITKIOFactoryRegistration when needed
Description

Hi Csaba,

The failing cli tests associated with Slicer build you pointed out, should be fixed by this commit: http://viewvc.slicer.org/viewvc.cgi/Slicer4/trunk/Base/CLI/Testing/itkTestMain.h?r1=21691&r2=21690&pathrev=21691

The same approach will have to be applied for other test. I will be looking into adding a generic solution based on "CMAKE_TESTDRIVER_BEFORE_TESTMAIN ". See http://www.cmake.org/cmake/help/v2.8.10/cmake.html#command:create_test_sourcelist

All of that said, while test test are failing, Slicer itself should be able to load nrrd. Let me know if it's not the case.

TagsITKv4

Relationships

related to 0002813 closedjcfr Restore performance of ITKv4 Factory 

Activities

jcfr

jcfr

2013-02-14 13:09

administrator   ~0007935

Last edited: 2013-02-14 13:09

Introduction of a new macro named "slicerMacroAddModuleCxxTestDriver" would help simplifying how test are written.
See http://slicer-devel.65872.n3.nabble.com/Proposal-Introduction-of-a-macro-named-quot-slicerMacroAddModuleCxxTestDriver-quot-tt4027573.html

Waiting for feedback from the community.

jcfr

jcfr

2013-02-16 09:53

administrator   ~0007969

The following commits should resolve the last problem associated with Slicer tests.

That said, I thought about few different approaches:

1) Extent the "create_test_sourcelist" CMake command and add a parameter named EXTRA_INCLUDES. With that new feature it would then be easier to pass additional header to the test driver. Writing of macro like "slicerMacroAddModuleCxxTestDriver" would be easier.

2) Instead of trying to work around the issue, it would probably make sens to add such library into ITKv4 proper.

[1] http://www.cmake.org/cmake/help/v2.8.10/cmake.html#command:create_test_sourcelist

In the mean time, the solution is to include "itkFactoryRegistration.h" and call "itk::itkFactoryRegistration()"

// ------------------------------------
Commit r21721:

BUG: Ensure ITKv4 IO Factory are registered within tests

  • Include directories associated with ITKFactoryRegistration are also
    appended to ITK_INLCUDE_DIRS to ensure that the method itk::itkFactoryRegistration
    could be called.

  • Code allowing to register the factory has been manually added to the
    tests.

  • Would it make sens to have this library ITKFactoryIORegistration
    being built/provided by ITKv4 proper ?

See http://viewvc.slicer.org/viewvc.cgi/Slicer4?view=revision&revision=21721
// ------------------------------------

// ------------------------------------
Commit r21723:

COMP: Ensure ITKFactoryRegistration is considered when setting ITK_INCLUDE_DIRS at top-level.

This will fix build errors of the form:

.../Logic/Testing/Cxx/vtkMRMLSliceLogicTest2.cxx:49:38: error: itkFactoryRegistration.h: No such file or directory
.../Logic/Testing/Cxx/vtkMRMLSliceLogicTest2.cxx: In function 'int vtkMRMLSliceLogicTest2(int, char**)':
.../Logic/Testing/Cxx/vtkMRMLSliceLogicTest2.cxx:56: error: 'itkFactoryRegistration' is not a member of 'itk'

See http://viewvc.slicer.org/viewvc.cgi/Slicer4?view=revision&revision=21723
// ------------------------------------

// ------------------------------------
Commit r21725:

COMP: Fix missing "itkFactoryRegistrationConfigure.h" build error

This will fix build errors of the form:

../ITKFactoryRegistration/itkFactoryRegistration.h:6:45: error: itkFactoryRegistrationConfigure.h: No such file or directory
../Libs/MRML/Logic/Testing/Cxx/vtkMRMLSliceLogicTest2.cxx:49:
../Libs/ITKFactoryRegistration/itkFactoryRegistration.h:10: error: expected constructor, destructor, or type conversion before 'void'
../Libs/MRML/Logic/Testing/Cxx/vtkMRMLSliceLogicTest2.cxx: In function 'int vtkMRMLSliceLogicTest2(int, char**)':
../Libs/MRML/Logic/Testing/Cxx/vtkMRMLSliceLogicTest2.cxx:56: error: 'itkFactoryRegistration' is not a member of 'itk'

See http://viewvc.slicer.org/viewvc.cgi/Slicer4?view=revision&revision=21725
// ------------------------------------

Issue History

Date Modified Username Field Change
2013-02-14 09:39 jcfr New Issue
2013-02-14 09:39 jcfr Status new => assigned
2013-02-14 09:39 jcfr Assigned To => pieper
2013-02-14 09:41 jcfr Reporter jcfr => pinter
2013-02-14 09:41 jcfr Assigned To pieper => jcfr
2013-02-14 09:41 jcfr Target Version => Slicer 4.3.0
2013-02-14 09:47 jcfr Tag Attached: ITKv4
2013-02-14 13:09 jcfr Note Added: 0007935
2013-02-14 13:09 jcfr Note Edited: 0007935
2013-02-16 09:47 jcfr Relationship added related to 0002813
2013-02-16 09:53 jcfr Note Added: 0007969
2013-02-16 09:53 jcfr Status assigned => resolved
2013-02-16 09:53 jcfr Fixed in Version => Slicer 4.3.0
2013-02-16 09:53 jcfr Resolution open => fixed
2013-02-18 08:52 pinter Status resolved => closed