]> SALOME platform Git repositories - tools/medcoupling.git/commitdiff
Salome HOME
Introducing MEDCOUPLING_BUILD_PY_TESTS (default ON) to allow disabling abn/minors
authorabn <adrien.bruneton@cea.fr>
Fri, 29 Apr 2022 18:45:56 +0000 (20:45 +0200)
committerabn <adrien.bruneton@cea.fr>
Fri, 29 Apr 2022 18:45:56 +0000 (20:45 +0200)
Python tests.

14 files changed:
CMakeLists.txt
src/ICoCo/Swig/CMakeLists.txt
src/ICoCo/Swig/CTestTestfileInstall.cmake
src/MEDCoupling_Swig/CMakeLists.txt
src/MEDCoupling_Swig/CTestTestfileInstall.cmake
src/MEDLoader/Swig/CMakeLists.txt
src/MEDLoader/Swig/CTestTestfileInstall.cmake
src/MEDPartitioner_Swig/CMakeLists.txt
src/ParaMEDMEM_Swig/CMakeLists.txt
src/ParaMEDMEM_Swig/CTestTestfileInstall.cmake.in
src/PyWrapping/CMakeLists.txt
src/PyWrapping/CTestTestfileInstall.cmake
src/RENUMBER_Swig/CMakeLists.txt
src/RENUMBER_Swig/CTestTestfileInstall.cmake

index 2a84ec3d10c707cc560d6e5e94b2fdb807bf2d20..cbd863df6f38b7142e87ce342d8bf8694f917df7 100644 (file)
@@ -90,8 +90,9 @@ OPTION(MEDCOUPLING_ENABLE_PARTITIONER "Build MEDPartitioner." ON)
 OPTION(MEDCOUPLING_ENABLE_RENUMBER "Build Renumber." ON)
 OPTION(MEDCOUPLING_WITH_FILE_EXAMPLES "Install examples of files containing meshes and fields of different formats." ON)
 OPTION(MEDCOUPLING_USE_MPI "(Use MPI containers) - For MED this triggers the build of ParaMEDMEM." OFF)
-OPTION(MEDCOUPLING_BUILD_TESTS "Build MED tests." ON)
-OPTION(MEDCOUPLING_BUILD_DOC "Build MED doc." ON)
+OPTION(MEDCOUPLING_BUILD_TESTS "Build MEDCoupling C++ tests." ON)
+OPTION(MEDCOUPLING_BUILD_PY_TESTS "Build MEDCoupling Python tests." ON)
+OPTION(MEDCOUPLING_BUILD_DOC "Build MEDCoupling doc." ON)
 OPTION(MEDCOUPLING_BUILD_STATIC "Build MEDCoupling library in static mode." OFF)
 OPTION(MEDCOUPLING_USE_64BIT_IDS "Size of IDs to refer cells and nodes. 32 bits when OFF (default), 64 bits when ON." ON)
 
index 620da515e09efd6a719c807ebae2d18c053eee55..a50c05ca3068542dccb753ffa0cdec63f0895060 100644 (file)
@@ -24,7 +24,9 @@
 # (see PyWrapping source directory)
 #
 
-INCLUDE(tests.set)
+IF(MEDCOUPLING_BUILD_PY_TESTS)
+    INCLUDE(tests.set)
+ENDIF()
 
 SALOME_ACCUMULATE_ENVIRONMENT(PYTHONPATH NOCHECK ${CMAKE_CURRENT_BINARY_DIR}/../../PyWrapping)
 SALOME_GENERATE_TESTS_ENVIRONMENT(tests_env)
index f6228fc81d2686eb573d641f6cf7ae9f4e6f2742..6178f58b2962b5a35db3338bc3baa75b2ca736df 100644 (file)
@@ -17,7 +17,9 @@
 # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 #
 
-INCLUDE(tests.set)
+IF(MEDCOUPLING_BUILD_PY_TESTS)
+    INCLUDE(tests.set)
+ENDIF()
 
 FOREACH(tfile ${ALL_TESTS})
   GET_FILENAME_COMPONENT(BASE_NAME ${tfile} NAME_WE)
index 84e2beff7309ab210da7fda312eb0671e37ef991..a929b3da948d60bc7d3468388a73c6b56b06336b 100644 (file)
@@ -16,8 +16,9 @@
 #
 # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 #
-
-INCLUDE(tests.set)
+IF(MEDCOUPLING_BUILD_PY_TESTS)
+    INCLUDE(tests.set)
+ENDIF()
 
 INCLUDE(${SWIG_USE_FILE})
 
index f6228fc81d2686eb573d641f6cf7ae9f4e6f2742..6178f58b2962b5a35db3338bc3baa75b2ca736df 100644 (file)
@@ -17,7 +17,9 @@
 # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 #
 
-INCLUDE(tests.set)
+IF(MEDCOUPLING_BUILD_PY_TESTS)
+    INCLUDE(tests.set)
+ENDIF()
 
 FOREACH(tfile ${ALL_TESTS})
   GET_FILENAME_COMPONENT(BASE_NAME ${tfile} NAME_WE)
index 36be2c718c0d908c4fd0d360f2d8595aa07e7c21..f5a9ced7ff59c8606ccb21fd214491762a2d2ddb 100644 (file)
@@ -21,7 +21,9 @@
 FIND_PACKAGE(SWIG REQUIRED)
 INCLUDE(${SWIG_USE_FILE})
 
-INCLUDE(tests.set)
+IF(MEDCOUPLING_BUILD_PY_TESTS)
+    INCLUDE(tests.set)
+ENDIF()
 
 ADD_DEFINITIONS(${PYTHON_DEFINITIONS} ${NUMPY_DEFINITIONS} ${SCIPY_DEFINITIONS})
 
index f6228fc81d2686eb573d641f6cf7ae9f4e6f2742..6178f58b2962b5a35db3338bc3baa75b2ca736df 100644 (file)
@@ -17,7 +17,9 @@
 # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 #
 
-INCLUDE(tests.set)
+IF(MEDCOUPLING_BUILD_PY_TESTS)
+    INCLUDE(tests.set)
+ENDIF()
 
 FOREACH(tfile ${ALL_TESTS})
   GET_FILENAME_COMPONENT(BASE_NAME ${tfile} NAME_WE)
index 149935fe5603c560afe0b5eee4f8f7b8c3a3ad00..dedb560bdc4e4cccad69c0641e020869e4a2d697 100644 (file)
@@ -77,12 +77,14 @@ INSTALL(FILES MEDPartitioner.i MEDPartitionerCommon.i DESTINATION ${MEDCOUPLING_
 INSTALL(FILES MEDPartitionerTest.py DESTINATION ${MEDCOUPLING_INSTALL_SCRIPT_PYTHON})
 
 IF(MEDCOUPLING_PARTITIONER_METIS)
-   # Python test of partitionner require METIS or PARMETIS?
-   SALOME_ACCUMULATE_ENVIRONMENT(PYTHONPATH NOCHECK ${CMAKE_CURRENT_BINARY_DIR}/../MEDLoader/Swig)
-   SALOME_GENERATE_TESTS_ENVIRONMENT(tests_env)
-   ADD_TEST(MEDPartitionerTest ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/MEDPartitionerTest.py)
-   SET_TESTS_PROPERTIES(MEDPartitionerTest PROPERTIES ENVIRONMENT "${tests_env}")
-   CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/../MEDLoader/Swig/MEDLoaderDataForTest.py ${CMAKE_CURRENT_BINARY_DIR} COPYONLY)
+    IF(MEDCOUPLING_BUILD_PY_TESTS)
+       # Python test of partitionner require METIS or PARMETIS?
+       SALOME_ACCUMULATE_ENVIRONMENT(PYTHONPATH NOCHECK ${CMAKE_CURRENT_BINARY_DIR}/../MEDLoader/Swig)
+       SALOME_GENERATE_TESTS_ENVIRONMENT(tests_env)
+       ADD_TEST(MEDPartitionerTest ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/MEDPartitionerTest.py)
+       SET_TESTS_PROPERTIES(MEDPartitionerTest PROPERTIES ENVIRONMENT "${tests_env}")
+       CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/../MEDLoader/Swig/MEDLoaderDataForTest.py ${CMAKE_CURRENT_BINARY_DIR} COPYONLY)
+    ENDIF()
 ENDIF()
 
 # Application tests
index 1f07a5ac35030eef4809d7e7d058ab38d4a29eb3..aebc1b4c7cdea04a598845fd711b85fe51a217fd 100644 (file)
@@ -70,39 +70,41 @@ SWIG_CHECK_GENERATION(ParaMEDMEM)
 #
 # Tests
 #
-SALOME_ACCUMULATE_ENVIRONMENT(PYTHONPATH NOCHECK ${CMAKE_CURRENT_BINARY_DIR}/../PyWrapping)
-SALOME_ACCUMULATE_ENVIRONMENT(MED_RESOURCES_DIR NOCHECK ${CMAKE_SOURCE_DIR}/resources)
-SALOME_GENERATE_TESTS_ENVIRONMENT(tests_env)
-
-#  -- some tests require 2, 3, 4 or 5 procs --
-# MPICH does not support --oversubscribe:
-IF(NOT ${MPIEXEC_EXECUTABLE} MATCHES "mpich")
-    SET(_oversub_opt "--oversubscribe")
+IF(MEDCOUPLING_BUILD_PY_TESTS)
+    SALOME_ACCUMULATE_ENVIRONMENT(PYTHONPATH NOCHECK ${CMAKE_CURRENT_BINARY_DIR}/../PyWrapping)
+    SALOME_ACCUMULATE_ENVIRONMENT(MED_RESOURCES_DIR NOCHECK ${CMAKE_SOURCE_DIR}/resources)
+    SALOME_GENERATE_TESTS_ENVIRONMENT(tests_env)
+    
+    #  -- some tests require 2, 3, 4 or 5 procs --
+    # MPICH does not support --oversubscribe:
+    IF(NOT ${MPIEXEC_EXECUTABLE} MATCHES "mpich")
+        SET(_oversub_opt "--oversubscribe")
+    ENDIF()
+    
+    ADD_TEST(NAME PyPara_Basics_Proc2
+             COMMAND ${MPIEXEC} -np 2  ${_oversub_opt} ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/test_BasicOperation.py)
+    SET_TESTS_PROPERTIES(PyPara_Basics_Proc2 PROPERTIES ENVIRONMENT "${tests_env}")
+    
+    ADD_TEST(NAME PyPara_InterpKernelDEC_Proc4
+             COMMAND ${MPIEXEC} -np 4  ${_oversub_opt} ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/test_InterpKernelDEC.py)
+    SET_TESTS_PROPERTIES(PyPara_InterpKernelDEC_Proc4 PROPERTIES ENVIRONMENT "${tests_env}")
+    ADD_TEST(NAME PyPara_InterpKernelDEC_Proc5
+             COMMAND ${MPIEXEC} -np 5  ${_oversub_opt} ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/test_InterpKernelDEC.py)
+    SET_TESTS_PROPERTIES(PyPara_InterpKernelDEC_Proc5 PROPERTIES ENVIRONMENT "${tests_env}")
+    
+    #ADD_TEST(NAME PyPara_NonCoincidentDEC_Proc5
+    #         COMMAND ${MPIEXEC} -np 5  ${_oversub_opt} ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/test_NonCoincidentDEC.py)
+    #SET_TESTS_PROPERTIES(PyPara_NonCoincidentDEC_Proc5 PROPERTIES ENVIRONMENT "${tests_env}")
+    
+    ADD_TEST(NAME PyPara_StructuredCoincidentDEC_Proc4
+             COMMAND ${MPIEXEC} -np 4  ${_oversub_opt} ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/test_StructuredCoincidentDEC.py)
+    SET_TESTS_PROPERTIES(PyPara_StructuredCoincidentDEC_Proc4 PROPERTIES ENVIRONMENT "${tests_env}")
+    
+    ADD_TEST(NAME PyPara_OverlapDEC_Proc4
+             COMMAND ${MPIEXEC} -np 4  ${_oversub_opt} ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/test_OverlapDEC.py)
+    SET_TESTS_PROPERTIES(PyPara_OverlapDEC_Proc4 PROPERTIES ENVIRONMENT "${tests_env}")
 ENDIF()
 
-ADD_TEST(NAME PyPara_Basics_Proc2
-         COMMAND ${MPIEXEC} -np 2  ${_oversub_opt} ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/test_BasicOperation.py)
-SET_TESTS_PROPERTIES(PyPara_Basics_Proc2 PROPERTIES ENVIRONMENT "${tests_env}")
-
-ADD_TEST(NAME PyPara_InterpKernelDEC_Proc4
-         COMMAND ${MPIEXEC} -np 4  ${_oversub_opt} ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/test_InterpKernelDEC.py)
-SET_TESTS_PROPERTIES(PyPara_InterpKernelDEC_Proc4 PROPERTIES ENVIRONMENT "${tests_env}")
-ADD_TEST(NAME PyPara_InterpKernelDEC_Proc5
-         COMMAND ${MPIEXEC} -np 5  ${_oversub_opt} ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/test_InterpKernelDEC.py)
-SET_TESTS_PROPERTIES(PyPara_InterpKernelDEC_Proc5 PROPERTIES ENVIRONMENT "${tests_env}")
-
-#ADD_TEST(NAME PyPara_NonCoincidentDEC_Proc5
-#         COMMAND ${MPIEXEC} -np 5  ${_oversub_opt} ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/test_NonCoincidentDEC.py)
-#SET_TESTS_PROPERTIES(PyPara_NonCoincidentDEC_Proc5 PROPERTIES ENVIRONMENT "${tests_env}")
-
-ADD_TEST(NAME PyPara_StructuredCoincidentDEC_Proc4
-         COMMAND ${MPIEXEC} -np 4  ${_oversub_opt} ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/test_StructuredCoincidentDEC.py)
-SET_TESTS_PROPERTIES(PyPara_StructuredCoincidentDEC_Proc4 PROPERTIES ENVIRONMENT "${tests_env}")
-
-ADD_TEST(NAME PyPara_OverlapDEC_Proc4
-         COMMAND ${MPIEXEC} -np 4  ${_oversub_opt} ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/test_OverlapDEC.py)
-SET_TESTS_PROPERTIES(PyPara_OverlapDEC_Proc4 PROPERTIES ENVIRONMENT "${tests_env}")
-
 SET(_tst_scripts
   test_InterpKernelDEC.py
   test_NonCoincidentDEC.py
index 3a6453750d6479466982c5613d880c4ee356e0e4..ad4ff4ca89740bb605a7cb6621af57d1c2a65ce0 100644 (file)
@@ -25,27 +25,32 @@ SET(TEST_NAMES ParaMEDMEMTest)
 # force mpiexec to use PATH env var to detect right python into mpiexec command line
 set(PATH_FOR_PYTHON $ENV{PATH})
 
-set(tfile PyPara_Basics_Proc2)
-set(TEST_NAME ${COMPONENT_NAME}_${TEST_NAMES}_${tfile})
-add_test(${TEST_NAME} ${MPIEXEC} -np 2 ${_oversub_opt} -path "${PATH_FOR_PYTHON}" python3 test_BasicOperation.py)
-set_tests_properties(${TEST_NAME} PROPERTIES LABELS "${COMPONENT_NAME}" TIMEOUT ${TIMEOUT})
-
-set(tfile PyPara_InterpKernelDEC_Proc4)
-set(TEST_NAME ${COMPONENT_NAME}_${TEST_NAMES}_${tfile})
-add_test(${TEST_NAME} ${MPIEXEC} -np 4 ${_oversub_opt} -path "${PATH_FOR_PYTHON}" python3 test_InterpKernelDEC.py)
-set_tests_properties(${TEST_NAME} PROPERTIES LABELS "${COMPONENT_NAME}" TIMEOUT ${TIMEOUT})
-
-set(tfile PyPara_InterpKernelDEC_Proc5)
-set(TEST_NAME ${COMPONENT_NAME}_${TEST_NAMES}_${tfile})
-add_test(${TEST_NAME} ${MPIEXEC} -np 5 ${_oversub_opt} -path "${PATH_FOR_PYTHON}" python3 test_InterpKernelDEC.py)
-set_tests_properties(${TEST_NAME} PROPERTIES LABELS "${COMPONENT_NAME}" TIMEOUT ${TIMEOUT})
-
-set(tfile PyPara_StructuredCoincidentDEC_Proc4)
-set(TEST_NAME ${COMPONENT_NAME}_${TEST_NAMES}_${tfile})
-add_test(${TEST_NAME} ${MPIEXEC} -np 4 ${_oversub_opt} -path "${PATH_FOR_PYTHON}" python3 test_StructuredCoincidentDEC.py)
-set_tests_properties(${TEST_NAME} PROPERTIES LABELS "${COMPONENT_NAME}" TIMEOUT ${TIMEOUT})
-
-set(tfile PyPara_OverlapDEC_Proc4)
-set(TEST_NAME ${COMPONENT_NAME}_${TEST_NAMES}_${tfile})
-add_test(${TEST_NAME} ${MPIEXEC} -np 4 ${_oversub_opt} -path "${PATH_FOR_PYTHON}" python3 test_OverlapDEC.py)
-set_tests_properties(${TEST_NAME} PROPERTIES LABELS "${COMPONENT_NAME}" TIMEOUT ${TIMEOUT})
+IF(MEDCOUPLING_BUILD_PY_TESTS)
+
+
+    set(tfile PyPara_Basics_Proc2)
+    set(TEST_NAME ${COMPONENT_NAME}_${TEST_NAMES}_${tfile})
+    add_test(${TEST_NAME} ${MPIEXEC} -np 2 ${_oversub_opt} -path "${PATH_FOR_PYTHON}" python3 test_BasicOperation.py)
+    set_tests_properties(${TEST_NAME} PROPERTIES LABELS "${COMPONENT_NAME}" TIMEOUT ${TIMEOUT})
+    
+    set(tfile PyPara_InterpKernelDEC_Proc4)
+    set(TEST_NAME ${COMPONENT_NAME}_${TEST_NAMES}_${tfile})
+    add_test(${TEST_NAME} ${MPIEXEC} -np 4 ${_oversub_opt} -path "${PATH_FOR_PYTHON}" python3 test_InterpKernelDEC.py)
+    set_tests_properties(${TEST_NAME} PROPERTIES LABELS "${COMPONENT_NAME}" TIMEOUT ${TIMEOUT})
+    
+    set(tfile PyPara_InterpKernelDEC_Proc5)
+    set(TEST_NAME ${COMPONENT_NAME}_${TEST_NAMES}_${tfile})
+    add_test(${TEST_NAME} ${MPIEXEC} -np 5 ${_oversub_opt} -path "${PATH_FOR_PYTHON}" python3 test_InterpKernelDEC.py)
+    set_tests_properties(${TEST_NAME} PROPERTIES LABELS "${COMPONENT_NAME}" TIMEOUT ${TIMEOUT})
+    
+    set(tfile PyPara_StructuredCoincidentDEC_Proc4)
+    set(TEST_NAME ${COMPONENT_NAME}_${TEST_NAMES}_${tfile})
+    add_test(${TEST_NAME} ${MPIEXEC} -np 4 ${_oversub_opt} -path "${PATH_FOR_PYTHON}" python3 test_StructuredCoincidentDEC.py)
+    set_tests_properties(${TEST_NAME} PROPERTIES LABELS "${COMPONENT_NAME}" TIMEOUT ${TIMEOUT})
+    
+    set(tfile PyPara_OverlapDEC_Proc4)
+    set(TEST_NAME ${COMPONENT_NAME}_${TEST_NAMES}_${tfile})
+    add_test(${TEST_NAME} ${MPIEXEC} -np 4 ${_oversub_opt} -path "${PATH_FOR_PYTHON}" python3 test_OverlapDEC.py)
+    set_tests_properties(${TEST_NAME} PROPERTIES LABELS "${COMPONENT_NAME}" TIMEOUT ${TIMEOUT})
+
+ENDIF()
\ No newline at end of file
index 4ddf50cc2166aa5c431d7bc45ab628e9e36e4d6d..4cbd51659c5784958154ce07e6d5441323d4ecec 100644 (file)
@@ -113,7 +113,11 @@ INSTALL(TARGETS _medcoupling DESTINATION ${MEDCOUPLING_INSTALL_PYTHON})
 INSTALL(FILES medcoupling.i medcoupling_pycode DESTINATION ${MEDCOUPLING_INSTALL_HEADERS})
 SALOME_INSTALL_SCRIPTS(${CMAKE_CURRENT_BINARY_DIR}/medcoupling.py ${MEDCOUPLING_INSTALL_PYTHON} EXTRA_DPYS "${SWIG_MODULE_medcoupling_REAL_NAME}")
 
-INCLUDE(tests.set)
+
+IF(MEDCOUPLING_BUILD_PY_TESTS)
+    INCLUDE(tests.set)
+ENDIF()
+
 SALOME_GENERATE_TESTS_ENVIRONMENT(tests_env)
 
 FOREACH(test ${BASE_TESTS})
index ae9192d2f3634f462a146c4bbb74aa780267f876..90af88cd158dd51c5337b2bc8fdcbc9ff5942f16 100644 (file)
@@ -17,7 +17,9 @@
 # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 #
 
-INCLUDE(tests.set)
+IF(MEDCOUPLING_BUILD_PY_TESTS)
+    INCLUDE(tests.set)
+ENDIF()
 
 FOREACH(tfile ${BASE_TESTS})
   GET_FILENAME_COMPONENT(BASE_NAME ${tfile} NAME_WE)
index 447f57ae73e04d52f91b9b3cf5d7f9bfe548e163..74ccab6e718a3600644190a655a4717606a6f4ed 100644 (file)
@@ -78,13 +78,15 @@ SALOME_INSTALL_SCRIPTS(${CMAKE_CURRENT_BINARY_DIR}/MEDRenumber.py ${MEDCOUPLING_
 INSTALL(FILES MEDRenumber.i MEDRenumberCommon.i MEDRenumberImpl.i DESTINATION ${MEDCOUPLING_INSTALL_HEADERS})
 INSTALL(FILES MEDRenumberTest.py DESTINATION ${MEDCOUPLING_INSTALL_SCRIPT_PYTHON})
 
-SALOME_ACCUMULATE_ENVIRONMENT(PYTHONPATH NOCHECK ${CMAKE_CURRENT_BINARY_DIR}/../PyWrapping)
-SALOME_GENERATE_TESTS_ENVIRONMENT(tests_env)
-ADD_TEST(MEDRenumberTest ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/MEDRenumberTest.py)
-SET_TESTS_PROPERTIES(MEDRenumberTest PROPERTIES ENVIRONMENT "${tests_env}")
-IF(MEDCOUPLING_ENABLE_PARTITIONER)
-  ADD_TEST(MEDRenumberUserGuide ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/UsersGuideExamplesTest.py)
-  SET_TESTS_PROPERTIES(MEDRenumberUserGuide PROPERTIES ENVIRONMENT "${tests_env}")
+IF(MEDCOUPLING_BUILD_PY_TESTS)
+    SALOME_ACCUMULATE_ENVIRONMENT(PYTHONPATH NOCHECK ${CMAKE_CURRENT_BINARY_DIR}/../PyWrapping)
+    SALOME_GENERATE_TESTS_ENVIRONMENT(tests_env)
+    ADD_TEST(MEDRenumberTest ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/MEDRenumberTest.py)
+    SET_TESTS_PROPERTIES(MEDRenumberTest PROPERTIES ENVIRONMENT "${tests_env}")
+    IF(MEDCOUPLING_ENABLE_PARTITIONER)
+      ADD_TEST(MEDRenumberUserGuide ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/UsersGuideExamplesTest.py)
+      SET_TESTS_PROPERTIES(MEDRenumberUserGuide PROPERTIES ENVIRONMENT "${tests_env}")
+    ENDIF()
 ENDIF()
 
 # Application tests
index bc213d7a2c1248835241a6767c6442433461b9ce..61ff90489852fa5ce1517d8bd5e8adf69642b996 100644 (file)
@@ -21,20 +21,22 @@ SET(TEST_NAMES
   MEDRenumberTest
 )
 
-FOREACH(tfile ${TEST_NAMES})
-  SET(TEST_NAME ${COMPONENT_NAME}_${tfile})
-  ADD_TEST(${TEST_NAME} python ${tfile}.py)
-  SET_TESTS_PROPERTIES(${TEST_NAME} PROPERTIES
-    LABELS "${COMPONENT_NAME}"
-    TIMEOUT ${TIMEOUT}
-    ENVIRONMENT "PYTHONPATH=../../bin:$ENV{PYTHONPATH}"
-    )
-ENDFOREACH()
-
-SET(TEST_NAME ${COMPONENT_NAME}_RENUMBER_Swig_MEDRenumberUserGuide)
-ADD_TEST(${TEST_NAME} python UsersGuideExamplesTest.py)
-SET_TESTS_PROPERTIES(${TEST_NAME} PROPERTIES
-  LABELS "${COMPONENT_NAME}"
-  TIMEOUT ${TIMEOUT}
-  ENVIRONMENT "PYTHONPATH=../../bin:$ENV{PYTHONPATH}"
+IF(MEDCOUPLING_BUILD_PY_TESTS)
+    FOREACH(tfile ${TEST_NAMES})
+      SET(TEST_NAME ${COMPONENT_NAME}_${tfile})
+      ADD_TEST(${TEST_NAME} python ${tfile}.py)
+      SET_TESTS_PROPERTIES(${TEST_NAME} PROPERTIES
+        LABELS "${COMPONENT_NAME}"
+        TIMEOUT ${TIMEOUT}
+        ENVIRONMENT "PYTHONPATH=../../bin:$ENV{PYTHONPATH}"
+        )
+    ENDFOREACH()
+    
+    SET(TEST_NAME ${COMPONENT_NAME}_RENUMBER_Swig_MEDRenumberUserGuide)
+    ADD_TEST(${TEST_NAME} python UsersGuideExamplesTest.py)
+    SET_TESTS_PROPERTIES(${TEST_NAME} PROPERTIES
+      LABELS "${COMPONENT_NAME}"
+      TIMEOUT ${TIMEOUT}
+      ENVIRONMENT "PYTHONPATH=../../bin:$ENV{PYTHONPATH}"
   )
+ENDIF()