1 # Copyright (C) 2021 CEA/DEN, EDF R&D
3 # This library is free software; you can redistribute it and/or
4 # modify it under the terms of the GNU Lesser General Public
5 # License as published by the Free Software Foundation; either
6 # version 2.1 of the License, or (at your option) any later version.
8 # This library is distributed in the hope that it will be useful,
9 # but WITHOUT ANY WARRANTY; without even the implied warranty of
10 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 # Lesser General Public License for more details.
13 # You should have received a copy of the GNU Lesser General Public
14 # License along with this library; if not, write to the Free Software
15 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
22 ADD_UNIT_TESTS(${TEST_NAMES})
26 set(TEST_INSTALL_DIRECTORY "${SALOME_SHAPER_INSTALL_TESTS}/ExchangePlugin")
28 install(FILES CTestTestfileInstall.cmake
29 DESTINATION ${TEST_INSTALL_DIRECTORY}
30 RENAME CTestTestfile.cmake)
31 install(FILES tests.set DESTINATION ${TEST_INSTALL_DIRECTORY})
34 foreach(tfile ${TEST_NAMES})
35 list(APPEND TMP_TESTS_NAMES "${tfile}")
36 endforeach(tfile ${TEST_NAMES})
38 # tests which require SALOME GUI
39 include(tests_gui.set)
40 SALOME_GENERATE_TESTS_ENVIRONMENT(tests_env)
41 set(COMPONENT_NAME "ExchangePlugin")
42 foreach(tfile ${TEST_WITH_GUI_NAMES})
43 # Strip the ".py" suffix
44 get_filename_component(TEST_NAME ${tfile} NAME_WE)
45 # -B ${CMAKE_SOURCE_DIR}/doc/salome/examples/testme.py
46 set(TEST_NAME ${COMPONENT_NAME}_${TEST_NAME})
47 add_test(NAME ${TEST_NAME}
48 COMMAND ${PYTHON_EXECUTABLE} -B ${CMAKE_CURRENT_SOURCE_DIR}/testme.py ${CMAKE_CURRENT_SOURCE_DIR}/${tfile})
49 set_tests_properties(${TEST_NAME} PROPERTIES ENVIRONMENT "${tests_env};SHAPER_UNIT_TEST_IN_PROGRESS=1")
50 set_tests_properties(${TEST_NAME} PROPERTIES LABELS "${COMPONENT_NAME}")
53 list(APPEND TMP_TESTS_NAMES "${tfile}")
56 install(FILES ${TMP_TESTS_NAMES} DESTINATION ${TEST_INSTALL_DIRECTORY})
58 install(FILES testme.py DESTINATION ${TEST_INSTALL_DIRECTORY}
59 PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE
60 GROUP_READ GROUP_EXECUTE
61 WORLD_READ WORLD_EXECUTE)
63 install(FILES tests_gui.set DESTINATION ${TEST_INSTALL_DIRECTORY})
64 install(DIRECTORY data DESTINATION ${TEST_INSTALL_DIRECTORY})