Python tests.
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)
# (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)
# 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)
#
# 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})
# 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)
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})
# 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)
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
#
# 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
# 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
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})
# 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)
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
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()