From de3b165df6050d916f61a65959fed5b2937d441d Mon Sep 17 00:00:00 2001 From: abn Date: Fri, 29 Apr 2022 20:45:56 +0200 Subject: [PATCH] Introducing MEDCOUPLING_BUILD_PY_TESTS (default ON) to allow disabling Python tests. --- CMakeLists.txt | 5 +- src/ICoCo/Swig/CMakeLists.txt | 4 +- src/ICoCo/Swig/CTestTestfileInstall.cmake | 4 +- src/MEDCoupling_Swig/CMakeLists.txt | 5 +- .../CTestTestfileInstall.cmake | 4 +- src/MEDLoader/Swig/CMakeLists.txt | 4 +- src/MEDLoader/Swig/CTestTestfileInstall.cmake | 4 +- src/MEDPartitioner_Swig/CMakeLists.txt | 14 ++-- src/ParaMEDMEM_Swig/CMakeLists.txt | 64 ++++++++++--------- .../CTestTestfileInstall.cmake.in | 53 ++++++++------- src/PyWrapping/CMakeLists.txt | 6 +- src/PyWrapping/CTestTestfileInstall.cmake | 4 +- src/RENUMBER_Swig/CMakeLists.txt | 16 +++-- src/RENUMBER_Swig/CTestTestfileInstall.cmake | 34 +++++----- 14 files changed, 126 insertions(+), 95 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 2a84ec3d1..cbd863df6 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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) diff --git a/src/ICoCo/Swig/CMakeLists.txt b/src/ICoCo/Swig/CMakeLists.txt index 620da515e..a50c05ca3 100644 --- a/src/ICoCo/Swig/CMakeLists.txt +++ b/src/ICoCo/Swig/CMakeLists.txt @@ -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) diff --git a/src/ICoCo/Swig/CTestTestfileInstall.cmake b/src/ICoCo/Swig/CTestTestfileInstall.cmake index f6228fc81..6178f58b2 100644 --- a/src/ICoCo/Swig/CTestTestfileInstall.cmake +++ b/src/ICoCo/Swig/CTestTestfileInstall.cmake @@ -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) diff --git a/src/MEDCoupling_Swig/CMakeLists.txt b/src/MEDCoupling_Swig/CMakeLists.txt index 84e2beff7..a929b3da9 100644 --- a/src/MEDCoupling_Swig/CMakeLists.txt +++ b/src/MEDCoupling_Swig/CMakeLists.txt @@ -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}) diff --git a/src/MEDCoupling_Swig/CTestTestfileInstall.cmake b/src/MEDCoupling_Swig/CTestTestfileInstall.cmake index f6228fc81..6178f58b2 100644 --- a/src/MEDCoupling_Swig/CTestTestfileInstall.cmake +++ b/src/MEDCoupling_Swig/CTestTestfileInstall.cmake @@ -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) diff --git a/src/MEDLoader/Swig/CMakeLists.txt b/src/MEDLoader/Swig/CMakeLists.txt index 36be2c718..f5a9ced7f 100644 --- a/src/MEDLoader/Swig/CMakeLists.txt +++ b/src/MEDLoader/Swig/CMakeLists.txt @@ -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}) diff --git a/src/MEDLoader/Swig/CTestTestfileInstall.cmake b/src/MEDLoader/Swig/CTestTestfileInstall.cmake index f6228fc81..6178f58b2 100644 --- a/src/MEDLoader/Swig/CTestTestfileInstall.cmake +++ b/src/MEDLoader/Swig/CTestTestfileInstall.cmake @@ -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) diff --git a/src/MEDPartitioner_Swig/CMakeLists.txt b/src/MEDPartitioner_Swig/CMakeLists.txt index 149935fe5..dedb560bd 100644 --- a/src/MEDPartitioner_Swig/CMakeLists.txt +++ b/src/MEDPartitioner_Swig/CMakeLists.txt @@ -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 diff --git a/src/ParaMEDMEM_Swig/CMakeLists.txt b/src/ParaMEDMEM_Swig/CMakeLists.txt index 1f07a5ac3..aebc1b4c7 100644 --- a/src/ParaMEDMEM_Swig/CMakeLists.txt +++ b/src/ParaMEDMEM_Swig/CMakeLists.txt @@ -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 diff --git a/src/ParaMEDMEM_Swig/CTestTestfileInstall.cmake.in b/src/ParaMEDMEM_Swig/CTestTestfileInstall.cmake.in index 3a6453750..ad4ff4ca8 100644 --- a/src/ParaMEDMEM_Swig/CTestTestfileInstall.cmake.in +++ b/src/ParaMEDMEM_Swig/CTestTestfileInstall.cmake.in @@ -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 diff --git a/src/PyWrapping/CMakeLists.txt b/src/PyWrapping/CMakeLists.txt index 4ddf50cc2..4cbd51659 100644 --- a/src/PyWrapping/CMakeLists.txt +++ b/src/PyWrapping/CMakeLists.txt @@ -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}) diff --git a/src/PyWrapping/CTestTestfileInstall.cmake b/src/PyWrapping/CTestTestfileInstall.cmake index ae9192d2f..90af88cd1 100644 --- a/src/PyWrapping/CTestTestfileInstall.cmake +++ b/src/PyWrapping/CTestTestfileInstall.cmake @@ -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) diff --git a/src/RENUMBER_Swig/CMakeLists.txt b/src/RENUMBER_Swig/CMakeLists.txt index 447f57ae7..74ccab6e7 100644 --- a/src/RENUMBER_Swig/CMakeLists.txt +++ b/src/RENUMBER_Swig/CMakeLists.txt @@ -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 diff --git a/src/RENUMBER_Swig/CTestTestfileInstall.cmake b/src/RENUMBER_Swig/CTestTestfileInstall.cmake index bc213d7a2..61ff90489 100644 --- a/src/RENUMBER_Swig/CTestTestfileInstall.cmake +++ b/src/RENUMBER_Swig/CTestTestfileInstall.cmake @@ -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() -- 2.39.2