]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
Fix problem with make test when environment is not set
authorvsr <vsr@opencascade.com>
Wed, 21 Oct 2015 10:45:08 +0000 (13:45 +0300)
committervsr <vsr@opencascade.com>
Wed, 21 Oct 2015 10:45:08 +0000 (13:45 +0300)
CMakeCommon/FindSUIT.cmake
CMakeCommon/UnitTest.cmake

index 09c97b03e76fb07a2f043bbc49485212b7f60372..3d6400c5323908cfe9618875ad987976ee59c473 100644 (file)
@@ -4,6 +4,7 @@
 IF(HAVE_SALOME)
   SET(SUIT_INCLUDE ${SALOME_GUI_INCLUDE})
   MESSAGE(STATUS "SUIT_INCLUDE: ${SALOME_GUI_INCLUDE}")
+  SET(SUIT_LIB_DIR "${GUI_ROOT_DIR}/lib/salome")
 ELSE(HAVE_SALOME) 
   SET(SUIT_DIR $ENV{SUIT_DIR})
   IF(EXISTS ${SUIT_DIR})
index db5686dfe58baaff172a31b7e02744022a385e18..636adcc856a0de3b1098244cd6349341da4d53de 100644 (file)
@@ -26,6 +26,9 @@
 ENABLE_TESTING()
 
 MACRO(ADD_UNIT_TESTS)
+  SET(_LD_LIBRARY_PATH "${CMAKE_INSTALL_PREFIX}/bin:${CMAKE_INSTALL_PREFIX}/swig:${CMAKE_INSTALL_PREFIX}/plugins:${SUIT_LIB_DIR}:$ENV{LD_LIBRARY_PATH}")
+  SET(_PYTHONPATH "${CMAKE_INSTALL_PREFIX}/swig:${CMAKE_INSTALL_PREFIX}/plugins:${CMAKE_INSTALL_PREFIX}/addons:${CMAKE_INSTALL_PREFIX}/pythonAPI:$ENV{PYTHONPATH}")
+  SET(_CONFIG_FILE "${CMAKE_INSTALL_PREFIX}/plugins")
   foreach(eachFileName ${ARGN})
     # Strip the ".py" suffix 
     GET_FILENAME_COMPONENT(aTestName ${eachFileName} NAME_WE)
@@ -39,6 +42,8 @@ MACRO(ADD_UNIT_TESTS)
     IF(EXISTS ${aTestFileName})
       ADD_TEST(NAME ${aTestName}
                COMMAND ${PYTHON_EXECUTABLE} ${aTestFileName})
+      SET_TESTS_PROPERTIES(${aTestName} PROPERTIES
+               ENVIRONMENT "LD_LIBRARY_PATH=${_LD_LIBRARY_PATH};PYTHONPATH=${_PYTHONPATH};NEW_GEOM_CONFIG_FILE=${_CONFIG_FILE}")
       # Debug output...
       #MESSAGE(STATUS "Test added: ${aTestName} file: ${aTestFileName}")
     ELSE(EXISTS ${aTestFileName})