BUG: Ensure module prefix and suffix of MODULEPATH is properly set in SlicerMacroConfigureGenericCxxModuleTests

* CMAKE_SHARED_MODULE_SUFFIX already includes the dot in the library suffix.

* Make also sure CMAKE_SHARED_MODULE_PREFIX is considered

git-svn-id: http://svn.slicer.org/Slicer4/trunk@19763 3bd1e089-480b-0410-8dfb-8563597acbee
BUG: Generic Cxx test - Ensure modulePath is properly set on generator relying an IntDir

* For a definition of IntDir, consider reading:
http://www.cmake.org/cmake/help/cmake-2-8-docs.html#variable:CMAKE_CFG_INTDIR

* The main idea is to generate the full path to the module at runtime where
qSlicerCoreApplication::intDir() returns the current IntDir if any.

git-svn-id: http://svn.slicer.org/Slicer4/trunk@19764 3bd1e089-480b-0410-8dfb-8563597acbee
ENH: Improve modularization by moving code related to loadable module into qSlicerLoadableModule.{h,cxx}

* The code allowing to import the python module extensions associated with
a loadable module used to be in qSlicerLoadableModuleFactoryItem and
couldn't be re-used.

This commit factor out the code into a static function associated with the
qSlicerLoadableModule that could be easily re-used.

git-svn-id: http://svn.slicer.org/Slicer4/trunk@19765 3bd1e089-480b-0410-8dfb-8563597acbee
BUG: Ensure python extension are loaded when running Generic Cxx tests.

* Note that ideally, the code within qSlicerLoadableModule::setup()
should be "smart" enough to check if the import is needed.

* After making sure it doesn't impact starting/loading of Slicer,
may be the call to "isEmbeddedModule" in "qSlicerLoadableModule::setup"
could be avoided.

git-svn-id: http://svn.slicer.org/Slicer4/trunk@19766 3bd1e089-480b-0410-8dfb-8563597acbee
ENH: Update python tests to use new "exit" mechanism

* To indicate an error, regular python Exception can be used.

* For more details refer to r19581.
See http://viewvc.slicer.org/viewvc.cgi/Slicer4?view=revision&revision=19581

git-svn-id: http://svn.slicer.org/Slicer4/trunk@19767 3bd1e089-480b-0410-8dfb-8563597acbee
STYLE: Prevent confusion by re-organizing code in SlicerQT/Testing/Python/CMakeLists.txt

* When test are added it's important to read the comment surrounding
existing tests to ensure it make sens to add it in a given section.

* As an example, let's consider "SlicerSceneObserverTest", this test was
previously added under the section "Check if 'slicer.testing.runUnitTest()'
works as expected", this didn't make sens.

The associated CMake code has been moved under a new section entitled
"Application tests"

git-svn-id: http://svn.slicer.org/Slicer4/trunk@19768 3bd1e089-480b-0410-8dfb-8563597acbee
COMP: Prevent confusion by removing unneeded command line option passed to "slicer_add_python_unittest"

* The option '--testing' is already passed by default. Indeed, the macro
being name "...add_..._test" it means the flags will be added automatically.

git-svn-id: http://svn.slicer.org/Slicer4/trunk@19769 3bd1e089-480b-0410-8dfb-8563597acbee
ENH: Add test showing that using --python-code with Exception works as expected.

git-svn-id: http://svn.slicer.org/Slicer4/trunk@19770 3bd1e089-480b-0410-8dfb-8563597acbee
BUG: Use new spelling for --disable-*-modules command line option.

* This is a regression introduced following commit r17177
See http://viewvc.slicer.org/viewvc.cgi/Slicer4?view=revision&revision=17177

* Added a regression test named "slicer_nomainwindow_DisableModulesCommandLineOptionsTest"
that could help to catch the problem if it occurs again. It also check
that the command line option works as expected.

git-svn-id: http://svn.slicer.org/Slicer4/trunk@19771 3bd1e089-480b-0410-8dfb-8563597acbee
ENH: Illustrate how vtkMRMLNode::CreateNodeByClass and SetReferenceCount should be used from python

This is a addendum to the mail [1] previously send on the list.

The reference count shouldn't be decreased using the naive approach where
it is set to one. Indeed, internally, the reference count could be any
number greater than one. It doesn't have to be 2.

Considering this last remark, using the following approach is *REQUIRED*,
otherwise it will lead to a CRASH of the application.

 n = slicer.mrmlScene.CreateNodeByClass('vtkMRMLViewNode')
 slicer.mrmlScene.addNode(n)
 n.SetReferenceCount(n.GetReferenceCount() - 1)

Even better, this specific example can be simplified using the following
syntax, this is the *RECOMMENDED* approach, it will prevent bug, memory
leaks and crashes:

  n = slicer.mrmlScene.addNode(slicer.vtkMRMLViewNode())

And if the name of the node is generated at runtime, this could be done:

  n = eval('slicer.mrmlScene.AddNode(slicer.%s())' % 'vtkMRMLViewNode')


[1] http://massmail.spl.harvard.edu/public-archives/slicer-devel/2011/007513.html

git-svn-id: http://svn.slicer.org/Slicer4/trunk@19772 3bd1e089-480b-0410-8dfb-8563597acbee