View Issue Details

IDProjectCategoryView StatusLast Update
0004242Slicer4Core: Testing Infrastructurepublic2018-05-30 12:58
Reporterlassoan Assigned Tojcfr  
PrioritynormalSeverityminorReproducibilityalways
Status resolvedResolutionfixed 
Product VersionSlicer 4.5.0-1 
Target VersionFixed in VersionSlicer 4.9.0 
Summary0004242: Testing of scripted module that depend on loadable module fails
Description

In an extension if a scripted module depends on a loadable module then the scripted module test always fails.

See this discussion for details:

http://slicer-devel.65872.n3.nabble.com/Testing-a-scripted-module-via-ctest-td4036208.html

Steps To Reproduce

This fails (for example in https://app.assembla.com/spaces/slicerrt/subversion/source/HEAD/trunk/SlicerRt/src/DicomRtImportExport/Testing/Python/CMakeLists.txt):

<pre>
slicerMacroBuildScriptedModule(
NAME ${MODULE_NAME}
SCRIPTS ${MODULE_PYTHON_SCRIPTS}
RESOURCES ${MODULE_PYTHON_RESOURCES}
WITH_GENERIC_TESTS
)
</pre>

The problem seems to be that although the correct paths are stored in AdditionalLauncherSettings.ini in [LibraryPaths], they are not used as additional module paths.

This workaround makes the test pass:

<pre>
#-----------------------------------------------------------------------------
slicerMacroBuildScriptedModule(
NAME ${MODULE_NAME}
SCRIPTS ${MODULE_PYTHON_SCRIPTS}
RESOURCES ${MODULE_PYTHON_RESOURCES}

WITH_GENERIC_TESTS

)

#-----------------------------------------------------------------------------
if(CMAKE_CONFIGURATION_TYPES)
set(MODULE_BUILD_DIR "")
foreach(config ${CMAKE_CONFIGURATION_TYPES})
list(APPEND MODULE_BUILD_DIR "${CMAKE_BINARY_DIR}/${Slicer_QTLOADABLEMODULES_LIB_DIR}/${config}")
endforeach()
else()
set(MODULE_BUILD_DIR "${CMAKE_BINARY_DIR}/${Slicer_QTLOADABLEMODULES_LIB_DIR}")
endif()

Register the unittest subclass in the main script as a ctest.

Note that the test will also be available at runtime.

slicer_add_python_unittest(
SCRIPT ${MODULE_NAME}.py

TODO: slicer_add_python_unittest should take care of adding the additional module paths

SLICER_ARGS
--disable-cli-modules
--additional-module-paths ${MODULE_BUILD_DIR} ${CMAKE_BINARY_DIR}/${Slicer_QTSCRIPTEDMODULES_LIB_DIR}
)
</pre>

TagsNo tags attached.

Activities

criskross

criskross

2017-03-02 11:34

developer   ~0014352

Similar issues I am experiencing with our extension SliceTracker which depends on another extension SlicerProstate. Both are scripted modules.

http://slicer-devel.65872.n3.nabble.com/Generic-module-test-on-extensions-that-depend-on-other-scripted-modules-extensions-are-failing-td4038137.html

Fixing this issue seems very important to me since I am not even able to run testing locally.

inorton

inorton

2017-03-02 13:26

developer   ~0014353

Related: https://github.com/commontk/AppLauncher/pull/60

jcfr

jcfr

2017-03-11 02:33

administrator   ~0014371

Fix associated with PR#610 integrated in r25783

https://github.com/Slicer/Slicer/pull/610
http://viewvc.slicer.org/viewvc.cgi/Slicer4?view=revision&amp;revision=25783

lassoan

lassoan

2018-05-29 23:25

developer   ~0015782

Can this be closed?

jcfr

jcfr

2018-05-30 12:58

administrator   ~0015847

Resolving. Fix integrated in r25783 addressed the problem.

Issue History

Date Modified Username Field Change
2016-08-04 18:52 lassoan New Issue
2016-08-04 18:52 lassoan Status new => assigned
2016-08-04 18:52 lassoan Assigned To => jcfr
2016-10-13 02:04 jcfr Product Version Slicer 4.5.1 => Slicer 4.5.0-1
2017-03-02 11:34 criskross Note Added: 0014352
2017-03-02 13:26 inorton Note Added: 0014353
2017-03-11 02:33 jcfr Note Added: 0014371
2018-05-29 23:25 lassoan Note Added: 0015782
2018-05-30 12:28 lassoan Steps to Reproduce Updated View Revisions
2018-05-30 12:58 jcfr Status assigned => resolved
2018-05-30 12:58 jcfr Resolution open => fixed
2018-05-30 12:58 jcfr Fixed in Version => Slicer 4.9.0
2018-05-30 12:58 jcfr Note Added: 0015847