View Issue Details

IDProjectCategoryView StatusLast Update
0002807Slicer4Core: Building (CMake, Superbuild)public2014-03-06 05:13
Reporterjcfr Assigned Tohjmjohnson  
PrioritynormalSeverityminorReproducibilityhave not tried
Status closedResolutionfixed 
Product Version 
Target VersionSlicer 4.3.0Fixed in VersionSlicer 4.3.0 
Summary0002807: itkTestMain.h is not available anymore in ITKv4.
Description

What should be done when updating code from ITKv3 ?

See https://itk.icts.uiowa.edu/jira/browse/ITK-2943

TagsITKv4

Relationships

has duplicate 0002833 closedjcfr itkTestMain.h is missing in ITKv4 
child of 0002007 closedjcfr Build against ITKv4 and remove ITKv3 

Activities

hjmjohnson

hjmjohnson

2012-11-30 12:16

developer   ~0007391

In order to maintain the test harness infrastructure, the test harness infrastructure was copied into Slicer treee (a single file: Modules/CLI/itkTestMain.h

This has been working for ITKv4 since 2011-04-04.

There is no compelling reason to conflate the move to ITKv4 with a change in the test harness. The test pass with the existing system.

===================

The itkTestMain.h was an internal test harness paradigm that was not intended as part of the exposed ITK API (it was the internal test harness mechanism used for ITK).

Other tools that may have re-used this internal mechansims will need to copy the from ITKv3 the support files for their test harness infrastructure.

Using the old test harness noes not change the behavior or utility of ITKv4.

=====
If one wishes to update their test harness (for whatever reason that would be) they should consider cmake native test harnesses, or google test harness, or other such infrastructures.

jcfr

jcfr

2012-11-30 12:21

administrator   ~0007392

Since module are expected to be successfully build against both Slicer or SlicerExecutionModel only, this should then probably be moved into the SlicerExecutionModel.

hjmjohnson

hjmjohnson

2012-11-30 12:28

developer   ~0007393

JC,

Something like the following would be what I recommend for SEM:

###############################################################################
###############################################################################

MakeTestDriverFromSEMTool

For tools made with the slicer execution model,

This macro will build a test driver that adds the

--compare

--compareIntensityTolerance

--compareRadiusTolerance

--compareNumberOfPixelsTolerance

to the SEM tools.

macro(MakeTestDriverFromSEMTool SEMToolName SEMToolTestSourceName)
set(SEMToolLibName ${SEMToolName}Lib)

if(ITK_VERSION_MAJOR LESS 4)

BackPort files from ITKv4 need to be pushed to ITKv3 for backwards compatibility

include_directories(${BRAINSTools_SOURCE_DIR}/BRAINSCommonLib/itkV3TestKernel/include)

endif()

set(CMAKE_TESTDRIVER_BEFORE_TESTMAIN "#include \"itkTestDriverBeforeTest.inc\"")
set(CMAKE_TESTDRIVER_AFTER_TESTMAIN "#include \"itkTestDriverAfterTest.inc\"")

create_test_sourcelist(${SEMToolName} ${SEMToolName}TestDriver.cxx ${SEMToolTestSourceName}
EXTRA_INCLUDE itkTestDriverIncludeRequiredIOFactories.h
FUNCTION ProcessArgumentsAndRegisterRequiredFactories
)
add_executable(${SEMToolName}TestDriver ${SEMToolName}TestDriver.cxx ${SEMToolTestSourceName})
target_link_libraries(${SEMToolName}TestDriver ${SEMToolLibName} ${ITKTestKernel_LIBRARIES})
set_target_properties(${SEMToolName}TestDriver PROPERTIES
RUNTIME_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}"
LIBRARY_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}"
ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}"
)
endmacro()

=================================================

Where test driver is something like:

//
//A test driver to append the
//itk image processing test
//commands to an
//the SEM compatibile program
//

#ifdef WIN32
#define MODULE_IMPORT __declspec(dllimport)
#else
#define MODULE_IMPORT
#endif

extern "C" MODULE_IMPORT int ModuleEntryPoint(int, char* []);

int BRAINSFitTest(int argc, char* argv[])
{
return ModuleEntryPoint(argc, argv);
}

jcfr

jcfr

2012-11-30 12:30

administrator   ~0007394

Thanks for the feedback. This is something we will be addressing during the hackfest.

hjmjohnson

hjmjohnson

2012-11-30 12:35

developer   ~0007395

If there are modules that need this done, then we coud work through that effort. I will take care of all the internal Slicer mechanisms once we no longer need to support ITKv3. Until then the task is too daunting to maintain both test harnesses.

kikinis

kikinis

2013-01-29 09:48

developer   ~0007756

any update?

hjmjohnson

hjmjohnson

2013-01-29 10:08

developer   ~0007758

All modules in Slicer compile against ITKv4 and this has been addressed during the Utah meeting.

jcfr

jcfr

2013-01-29 10:16

administrator   ~0007759

Fixed in r21604
See http://viewvc.slicer.org/viewvc.cgi/Slicer4?view=revision&revision=21604

jcfr

jcfr

2014-03-06 05:12

administrator   ~0011027

Closing resolved issues that have not been updated in more than 3 months

Issue History

Date Modified Username Field Change
2012-11-30 10:07 jcfr New Issue
2012-11-30 10:07 jcfr Status new => assigned
2012-11-30 10:07 jcfr Assigned To => jcfr
2012-11-30 10:07 jcfr Target Version => Slicer 4.3.0
2012-11-30 10:07 jcfr Relationship added child of 0002007
2012-11-30 10:07 jcfr Tag Attached: ITKv4
2012-11-30 10:07 jcfr Assigned To jcfr => hjmjohnson
2012-11-30 12:16 hjmjohnson Note Added: 0007391
2012-11-30 12:16 hjmjohnson Status assigned => resolved
2012-11-30 12:16 hjmjohnson Resolution open => fixed
2012-11-30 12:21 jcfr Note Added: 0007392
2012-11-30 12:21 jcfr Status resolved => assigned
2012-11-30 12:21 jcfr Status assigned => feedback
2012-11-30 12:28 hjmjohnson Note Added: 0007393
2012-11-30 12:30 jcfr Note Added: 0007394
2012-11-30 12:35 hjmjohnson Note Added: 0007395
2012-12-17 19:27 jcfr Relationship added has duplicate 0002833
2013-01-29 09:48 kikinis Note Added: 0007756
2013-01-29 10:08 hjmjohnson Note Added: 0007758
2013-01-29 10:08 hjmjohnson Status feedback => resolved
2013-01-29 10:08 hjmjohnson Fixed in Version => Slicer 4.3.0
2013-01-29 10:16 jcfr Note Added: 0007759
2014-03-06 05:12 jcfr Note Added: 0011027
2014-03-06 05:13 jcfr Status resolved => closed