-# Copyright (C) 2012-2016 CEA/DEN, EDF R&D
+# Copyright (C) 2012-2017 CEA/DEN, EDF R&D
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
+INCLUDE(tests.set)
+
INCLUDE(${SWIG_USE_FILE})
ADD_DEFINITIONS(${PYTHON_DEFINITIONS} ${NUMPY_DEFINITIONS} ${SCIPY_DEFINITIONS})
MEDCouplingTypemaps.i)
SET (MC_pyTestFiles
- MEDCouplingBasicsTest1.py
- MEDCouplingBasicsTest2.py
- MEDCouplingBasicsTest3.py
- MEDCouplingBasicsTest4.py
- MEDCouplingBasicsTest5.py
- MEDCouplingBasicsTest6.py
- MEDCouplingIntersectTest.py
- MEDCouplingRemapperTest.py
+ ${ALL_TESTS}
MEDCouplingDataForTest.py
- MEDCouplingNumPyTest.py
- MEDCouplingPickleTest.py
)
SET (MC_Swig_interf
INSTALL(FILES ${MC_Swig_interf} DESTINATION ${MEDCOUPLING_INSTALL_HEADERS})
INSTALL(FILES ${MC_pyTestFiles} DESTINATION ${MEDCOUPLING_INSTALL_SCRIPT_PYTHON})
-INSTALL(FILES MEDCouplingExamplesTest.py DESTINATION ${MEDCOUPLING_INSTALL_SCRIPT_PYTHON})
SALOME_GENERATE_TESTS_ENVIRONMENT(tests_env)
-ADD_TEST(MEDCouplingBasicsTest1 ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/MEDCouplingBasicsTest1.py)
-SET_TESTS_PROPERTIES(MEDCouplingBasicsTest1 PROPERTIES ENVIRONMENT "${tests_env}")
-ADD_TEST(MEDCouplingBasicsTest2 ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/MEDCouplingBasicsTest2.py)
-SET_TESTS_PROPERTIES(MEDCouplingBasicsTest2 PROPERTIES ENVIRONMENT "${tests_env}")
-ADD_TEST(MEDCouplingBasicsTest3 ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/MEDCouplingBasicsTest3.py)
-SET_TESTS_PROPERTIES(MEDCouplingBasicsTest3 PROPERTIES ENVIRONMENT "${tests_env}")
-ADD_TEST(MEDCouplingBasicsTest4 ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/MEDCouplingBasicsTest4.py)
-SET_TESTS_PROPERTIES(MEDCouplingBasicsTest4 PROPERTIES ENVIRONMENT "${tests_env}")
-ADD_TEST(MEDCouplingBasicsTest5 ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/MEDCouplingBasicsTest5.py)
-SET_TESTS_PROPERTIES(MEDCouplingBasicsTest5 PROPERTIES ENVIRONMENT "${tests_env}")
-ADD_TEST(MEDCouplingBasicsTest6 ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/MEDCouplingBasicsTest6.py)
-SET_TESTS_PROPERTIES(MEDCouplingBasicsTest6 PROPERTIES ENVIRONMENT "${tests_env}")
-ADD_TEST(MEDCouplingIntersectTest ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/MEDCouplingIntersectTest.py)
-SET_TESTS_PROPERTIES(MEDCouplingIntersectTest PROPERTIES ENVIRONMENT "${tests_env}")
-ADD_TEST(MEDCouplingExamplesTest ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/MEDCouplingExamplesTest.py)
-SET_TESTS_PROPERTIES(MEDCouplingExamplesTest PROPERTIES ENVIRONMENT "${tests_env}")
-ADD_TEST(MEDCouplingRemapperTest ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/MEDCouplingRemapperTest.py)
-SET_TESTS_PROPERTIES(MEDCouplingRemapperTest PROPERTIES ENVIRONMENT "${tests_env}")
+FOREACH(test ${BASE_TESTS})
+ GET_FILENAME_COMPONENT(testname ${test} NAME_WE)
+ ADD_TEST(NAME ${testname}
+ COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/${test})
+ SET_TESTS_PROPERTIES(${testname} PROPERTIES ENVIRONMENT "${tests_env}")
+ENDFOREACH()
IF(NUMPY_FOUND)
- ADD_TEST(MEDCouplingNumPyTest ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/MEDCouplingNumPyTest.py)
- SET_TESTS_PROPERTIES(MEDCouplingNumPyTest PROPERTIES ENVIRONMENT "${tests_env}")
- ADD_TEST(MEDCouplingPickleTest ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/MEDCouplingPickleTest.py)
- SET_TESTS_PROPERTIES(MEDCouplingPickleTest PROPERTIES ENVIRONMENT "${tests_env}")
+ FOREACH(test ${NUMPY_TESTS})
+ GET_FILENAME_COMPONENT(testname ${test} NAME_WE)
+ ADD_TEST(NAME ${testname}
+ COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/${test})
+ SET_TESTS_PROPERTIES(${testname} PROPERTIES ENVIRONMENT "${tests_env}")
+ ENDFOREACH()
ENDIF(NUMPY_FOUND)
# Application tests
SET(TEST_INSTALL_DIRECTORY ${MEDCOUPLING_INSTALL_TESTS}/MEDCoupling_Swig)
-LIST(APPEND MC_pyTestFiles MEDCouplingExamplesTest.py)
INSTALL(FILES ${MC_pyTestFiles} DESTINATION ${TEST_INSTALL_DIRECTORY})
INSTALL(FILES CTestTestfileInstall.cmake
-# Copyright (C) 2015-2016 CEA/DEN, EDF R&D
+# Copyright (C) 2015-2017 CEA/DEN, EDF R&D
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
-SET(TEST_NAMES
- MEDCouplingBasicsTest1
- MEDCouplingBasicsTest2
- MEDCouplingBasicsTest3
- MEDCouplingBasicsTest4
- MEDCouplingBasicsTest5
- MEDCouplingBasicsTest6
- MEDCouplingIntersectTest
- MEDCouplingExamplesTest
- MEDCouplingRemapperTest
- # if numpy is used
- MEDCouplingNumPyTest
- MEDCouplingPickleTest
-)
+INCLUDE(tests.set)
-FOREACH(tfile ${TEST_NAMES})
- SET(TEST_NAME ${COMPONENT_NAME}_${tfile})
- ADD_TEST(${TEST_NAME} python ${tfile}.py)
+FOREACH(tfile ${ALL_TESTS})
+ GET_FILENAME_COMPONENT(BASE_NAME ${tfile} NAME_WE)
+ SET(TEST_NAME ${COMPONENT_NAME}_${BASE_NAME})
+ ADD_TEST(${TEST_NAME} python ${tfile})
SET_TESTS_PROPERTIES(${TEST_NAME} PROPERTIES
LABELS "${COMPONENT_NAME}"
TIMEOUT ${TIMEOUT}
--- /dev/null
+# Copyright (C) 2017 CEA/DEN, EDF R&D
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+#
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+#
+
+SET(BASE_TESTS
+ MEDCouplingBasicsTest1.py
+ MEDCouplingBasicsTest2.py
+ MEDCouplingBasicsTest3.py
+ MEDCouplingBasicsTest4.py
+ MEDCouplingBasicsTest5.py
+ MEDCouplingBasicsTest6.py
+ MEDCouplingIntersectTest.py
+ MEDCouplingExamplesTest.py
+ MEDCouplingRemapperTest.py
+)
+
+# if numpy is used
+SET(NUMPY_TESTS
+ MEDCouplingNumPyTest.py
+ MEDCouplingPickleTest.py
+)
+
+SET(ALL_TESTS ${BASE_TESTS} ${NUMPY_TESTS})
-# Copyright (C) 2012-2016 CEA/DEN, EDF R&D
+# Copyright (C) 2012-2017 CEA/DEN, EDF R&D
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
INSTALL(FILES MEDLoaderSplitter.py DESTINATION ${MEDCOUPLING_INSTALL_PYTHON})
-INSTALL(FILES MEDLoaderDataForTest.py MEDLoaderTest1.py MEDLoaderTest2.py MEDLoaderTest3.py MEDLoaderTest123.py MEDLoaderTest4.py SauvLoaderTest.py MEDLoaderExamplesTest.py MEDLoaderCouplingTrainingSession.py CaseIO.py CaseReader.py CaseWriter.py VTKReader.py medutilities.py DESTINATION ${MEDCOUPLING_INSTALL_SCRIPT_SCRIPTS})
+
+INSTALL(FILES ${ALL_TESTS} MEDLoaderDataForTest.py MEDLoaderTest1.py MEDLoaderTest2.py MEDLoaderTest3.py CaseIO.py CaseReader.py CaseWriter.py VTKReader.py medutilities.py DESTINATION ${MEDCOUPLING_INSTALL_SCRIPT_SCRIPTS})
INSTALL(FILES med2sauv PERMISSIONS OWNER_EXECUTE OWNER_WRITE OWNER_READ GROUP_EXECUTE GROUP_READ WORLD_EXECUTE WORLD_READ DESTINATION ${MEDCOUPLING_INSTALL_BINS} )
INSTALL(FILES sauv2med PERMISSIONS OWNER_EXECUTE OWNER_WRITE OWNER_READ GROUP_EXECUTE GROUP_READ WORLD_EXECUTE WORLD_READ DESTINATION ${MEDCOUPLING_INSTALL_BINS} )
SALOME_GENERATE_TESTS_ENVIRONMENT(tests_env)
-ADD_TEST(MEDLoaderTest1_2_3 ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/MEDLoaderTest123.py)
-SET_TESTS_PROPERTIES(MEDLoaderTest1_2_3 PROPERTIES ENVIRONMENT "${tests_env}")
-
-ADD_TEST(MEDLoaderTest4 ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/MEDLoaderTest4.py)
-SET_TESTS_PROPERTIES(MEDLoaderTest4 PROPERTIES ENVIRONMENT "${tests_env}")
-
-ADD_TEST(MEDLoaderExamplesTest ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/MEDLoaderExamplesTest.py)
-SET_TESTS_PROPERTIES(MEDLoaderExamplesTest PROPERTIES ENVIRONMENT "${tests_env}")
-ADD_TEST(SauvLoaderTest ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/SauvLoaderTest.py)
-SET_TESTS_PROPERTIES(SauvLoaderTest PROPERTIES ENVIRONMENT "${tests_env}")
+FOREACH(test ${BASE_TESTS})
+ GET_FILENAME_COMPONENT(testname ${test} NAME_WE)
+ ADD_TEST(NAME ${testname}
+ COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/${test})
+ SET_TESTS_PROPERTIES(${testname} PROPERTIES ENVIRONMENT "${tests_env}")
+ENDFOREACH()
IF(NUMPY_FOUND)
# Add Remapper to the Python path:
SALOME_ACCUMULATE_ENVIRONMENT(PYTHONPATH "${CMAKE_CURRENT_BINARY_DIR}/../../MEDCoupling_Swig")
SALOME_GENERATE_TESTS_ENVIRONMENT(tests_env)
- ADD_TEST(MEDLoaderCouplingTrainingSession ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/MEDLoaderCouplingTrainingSession.py)
- SET_TESTS_PROPERTIES(MEDLoaderCouplingTrainingSession PROPERTIES ENVIRONMENT "${tests_env}")
+ FOREACH(test ${NUMPY_TESTS})
+ GET_FILENAME_COMPONENT(testname ${test} NAME_WE)
+ ADD_TEST(NAME ${testname}
+ COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/${test})
+ SET_TESTS_PROPERTIES(${testname} PROPERTIES ENVIRONMENT "${tests_env}")
+ ENDFOREACH()
ENDIF(NUMPY_FOUND)
# Application tests
SET(TEST_INSTALL_DIRECTORY ${MEDCOUPLING_INSTALL_TESTS}/MEDLoader_Swig)
SET(MEDLOADER_TEST_FILES
+ ${ALL_TESTS}
MEDLoaderDataForTest.py
- MEDLoaderTest123.py
MEDLoaderTest1.py
MEDLoaderTest2.py
MEDLoaderTest3.py
- MEDLoaderTest4.py
- SauvLoaderTest.py
- MEDLoaderExamplesTest.py
- MEDLoaderCouplingTrainingSession.py
CaseIO.py
CaseReader.py
CaseWriter.py
-# Copyright (C) 2015-2016 CEA/DEN, EDF R&D
+# Copyright (C) 2015-2017 CEA/DEN, EDF R&D
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
-SET(TEST_NAMES
- MEDLoaderTest123
- MEDLoaderTest4
- MEDLoaderExamplesTest
- SauvLoaderTest
- # if numpy is used
- MEDLoaderCouplingTrainingSession
-)
+INCLUDE(tests.set)
-FOREACH(tfile ${TEST_NAMES})
- SET(TEST_NAME ${COMPONENT_NAME}_${tfile})
- ADD_TEST(${TEST_NAME} python ${tfile}.py)
+FOREACH(tfile ${ALL_TESTS})
+ GET_FILENAME_COMPONENT(BASE_NAME ${tfile} NAME_WE)
+ SET(TEST_NAME ${COMPONENT_NAME}_${BASE_NAME})
+ ADD_TEST(${TEST_NAME} python ${tfile})
SET_TESTS_PROPERTIES(${TEST_NAME} PROPERTIES
LABELS "${COMPONENT_NAME}"
TIMEOUT ${TIMEOUT}
--- /dev/null
+# Copyright (C) 2017 CEA/DEN, EDF R&D
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+#
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+#
+
+SET(BASE_TESTS
+ MEDLoaderTest123.py
+ MEDLoaderTest4.py
+ MEDLoaderExamplesTest.py
+ SauvLoaderTest.py
+)
+
+# if numpy is used
+SET(NUMPY_TESTS
+ MEDLoaderCouplingTrainingSession.py
+)
+
+SET(ALL_TESTS ${BASE_TESTS} ${NUMPY_TESTS})