From 017133335b762d0970c19007508b0ee72da27107 Mon Sep 17 00:00:00 2001 From: vsr Date: Fri, 22 May 2020 11:47:33 +0300 Subject: [PATCH] Rearrange tests --- CMakeLists.txt | 25 +++------ CTestTestfileInstall.cmake | 27 +++++++++ doc/salome/CMakeLists.txt | 10 +++- .../{gui/SMESH => }/collect_mesh_methods.py | 0 doc/salome/examples/CMakeLists.txt | 53 +++++++++++------- .../examples/CTestTestfileInstall.cmake | 10 ++-- doc/salome/examples/testme.py | 56 ------------------- doc/salome/examples/tests.set | 2 - doc/salome/gui/SMESH/CMakeLists.txt | 4 +- src/Tools/CMakeLists.txt | 7 +++ src/Tools/CTestTestfileInstall.cmake | 20 +++++++ src/Tools/MacMesh/CMakeLists.txt | 30 +++++++--- src/Tools/MacMesh/CTestTestfileInstall.cmake | 29 ++++++++++ test/CMakeLists.txt | 37 +++++++----- test/CTestTestfileInstall.cmake | 27 +++++++++ test/tests.set | 35 ++++++++++++ 16 files changed, 241 insertions(+), 131 deletions(-) create mode 100644 CTestTestfileInstall.cmake rename doc/salome/{gui/SMESH => }/collect_mesh_methods.py (100%) delete mode 100755 doc/salome/examples/testme.py create mode 100644 src/Tools/CTestTestfileInstall.cmake create mode 100644 src/Tools/MacMesh/CTestTestfileInstall.cmake create mode 100644 test/CTestTestfileInstall.cmake create mode 100644 test/tests.set diff --git a/CMakeLists.txt b/CMakeLists.txt index e2434f379..87740544d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -177,20 +177,6 @@ ELSE(EXISTS ${GEOM_ROOT_DIR}) MESSAGE(FATAL_ERROR "We absolutely need a Salome GEOM, please define GEOM_ROOT_DIR") ENDIF(EXISTS ${GEOM_ROOT_DIR}) -# Find SHAPERSTUDY -# ================ -SET(WITH_SHAPER_STUDY OFF) -SET(SHAPERSTUDY_ROOT_DIR $ENV{SHAPERSTUDY_ROOT_DIR} CACHE PATH "Path to the Salome SHAPERSTUDY") -IF(EXISTS ${SHAPERSTUDY_ROOT_DIR}) - FIND_PACKAGE(SalomeSHAPERSTUDY) - IF(SalomeSHAPERSTUDY_FOUND) - SET(WITH_SHAPER_STUDY ON) - ENDIF() -ENDIF(EXISTS ${SHAPERSTUDY_ROOT_DIR}) -IF(NOT WITH_SHAPER_STUDY AND SALOME_BUILD_TESTS) - MESSAGE(WARNING "SHAPERSTUDY is not found; the corresponding tests will be omitted") -ENDIF() - ## ## SMESH specifics ## @@ -290,9 +276,7 @@ ADD_SUBDIRECTORY(adm_local) ADD_SUBDIRECTORY(resources) ADD_SUBDIRECTORY(bin) ADD_SUBDIRECTORY(src) -IF(SALOME_BUILD_DOC) - ADD_SUBDIRECTORY(doc) -ENDIF() +ADD_SUBDIRECTORY(doc) IF(SALOME_BUILD_TESTS) ADD_SUBDIRECTORY(test) ENDIF() @@ -371,3 +355,10 @@ INSTALL(FILES # Install the export set for use with the install-tree INSTALL(EXPORT ${PROJECT_NAME}TargetGroup DESTINATION "${SALOME_INSTALL_CMAKE_LOCAL}" FILE ${PROJECT_NAME}Targets.cmake) + +IF(SALOME_BUILD_TESTS) + # Application tests + INSTALL(FILES CTestTestfileInstall.cmake + DESTINATION ${SALOME_INSTALL_SCRIPT_SCRIPTS}/test + RENAME CTestTestfile.cmake) +ENDIF() diff --git a/CTestTestfileInstall.cmake b/CTestTestfileInstall.cmake new file mode 100644 index 000000000..99929d8d2 --- /dev/null +++ b/CTestTestfileInstall.cmake @@ -0,0 +1,27 @@ +# Copyright (C) 2017-2020 CEA/DEN, EDF R&D, OPEN CASCADE +# +# 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(SALOME_TEST_DRIVER "$ENV{KERNEL_ROOT_DIR}/bin/salome/appliskel/salome_test_driver.py") + +SET(COMPONENT_NAME SMESH) +SET(TIMEOUT 300) + +SUBDIRS(examples) +SUBDIRS(tests) +SUBDIRS(tools) diff --git a/doc/salome/CMakeLists.txt b/doc/salome/CMakeLists.txt index ccc73ba43..08e99e1be 100644 --- a/doc/salome/CMakeLists.txt +++ b/doc/salome/CMakeLists.txt @@ -20,6 +20,10 @@ # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com # -ADD_SUBDIRECTORY(tui) -ADD_SUBDIRECTORY(gui) -ADD_SUBDIRECTORY(examples) \ No newline at end of file +ADD_SUBDIRECTORY(examples) +IF(SALOME_BUILD_DOC) + ADD_SUBDIRECTORY(tui) + ADD_SUBDIRECTORY(gui) +ENDIF() + +SALOME_INSTALL_SCRIPTS(collect_mesh_methods.py ${SALOME_INSTALL_BINS}) diff --git a/doc/salome/gui/SMESH/collect_mesh_methods.py b/doc/salome/collect_mesh_methods.py similarity index 100% rename from doc/salome/gui/SMESH/collect_mesh_methods.py rename to doc/salome/collect_mesh_methods.py diff --git a/doc/salome/examples/CMakeLists.txt b/doc/salome/examples/CMakeLists.txt index 8121124f7..ce20e4b70 100644 --- a/doc/salome/examples/CMakeLists.txt +++ b/doc/salome/examples/CMakeLists.txt @@ -19,31 +19,42 @@ INCLUDE(tests.set) -SET(TEST_REINIT_SALOME "False") SALOME_CONFIGURE_FILE(tests.py.in tests.py) -SALOME_GENERATE_TESTS_ENVIRONMENT(tests_env) +# Install examples -IF(SMESH_JOIN_TESTS) - ADD_TEST(NAME SMESH_examples COMMAND ${PYTHON_EXECUTABLE} -B ${CMAKE_SOURCE_DIR}/doc/salome/examples/testme.py tests.py) -ELSE(SMESH_JOIN_TESTS) - FOREACH(test ${GOOD_TESTS}) - GET_FILENAME_COMPONENT(testname ${test} NAME_WE) - ADD_TEST(NAME ${testname} - COMMAND ${PYTHON_EXECUTABLE} -B ${CMAKE_SOURCE_DIR}/doc/salome/examples/testme.py ${CMAKE_CURRENT_SOURCE_DIR}/${test}) - SET_TESTS_PROPERTIES(${testname} PROPERTIES ENVIRONMENT "${tests_env}") - ENDFOREACH() -ENDIF(SMESH_JOIN_TESTS) - -# install Python scripts +SET(EXAMPLES_TESTS ${BAD_TESTS} ${GOOD_TESTS}) SALOME_INSTALL_SCRIPTS("${EXAMPLES_TESTS}" ${SALOME_INSTALL_DOC}/examples/SMESH) -# Application tests +# Tests + +IF(SALOME_BUILD_TESTS) + + SET(TEST_REINIT_SALOME "False") + SET(TEST_HELPER ${KERNEL_ROOT_DIR}/bin/salome/test_helper.py) + + SALOME_GENERATE_TESTS_ENVIRONMENT(tests_env) + + IF(SMESH_JOIN_TESTS) + ADD_TEST(NAME all_examples COMMAND ${PYTHON_EXECUTABLE} -B ${TEST_HELPER} tests.py) + ELSE(SMESH_JOIN_TESTS) + FOREACH(test ${GOOD_TESTS}) + GET_FILENAME_COMPONENT(testname ${test} NAME_WE) + ADD_TEST(NAME ${testname} + COMMAND ${PYTHON_EXECUTABLE} -B ${TEST_HELPER} ${CMAKE_CURRENT_SOURCE_DIR}/${test}) + SET_TESTS_PROPERTIES(${testname} PROPERTIES ENVIRONMENT "${tests_env}") + ENDFOREACH() + ENDIF(SMESH_JOIN_TESTS) + + # Application tests + # Note: we don't install test scripts as they are already installed to the documentation folder + + SET(TEST_INSTALL_DIRECTORY ${SALOME_INSTALL_SCRIPT_SCRIPTS}/test/examples) -SET(TEST_INSTALL_DIRECTORY ${SALOME_INSTALL_SCRIPT_SCRIPTS}/test) -INSTALL(FILES ${GOOD_TESTS} ${BAD_TESTS} DESTINATION ${TEST_INSTALL_DIRECTORY}) + CONFIGURE_FILE(CTestTestfileInstall.cmake ${CMAKE_CURRENT_BINARY_DIR}/CTestTestfileInstall.cmake @ONLY) + INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/CTestTestfileInstall.cmake + DESTINATION ${TEST_INSTALL_DIRECTORY} + RENAME CTestTestfile.cmake) + INSTALL(FILES tests.set DESTINATION ${TEST_INSTALL_DIRECTORY}) -INSTALL(FILES CTestTestfileInstall.cmake - DESTINATION ${TEST_INSTALL_DIRECTORY} - RENAME CTestTestfile.cmake) -INSTALL(FILES tests.set DESTINATION ${TEST_INSTALL_DIRECTORY}) +ENDIF(SALOME_BUILD_TESTS) diff --git a/doc/salome/examples/CTestTestfileInstall.cmake b/doc/salome/examples/CTestTestfileInstall.cmake index 9a38643c1..e7cf79647 100644 --- a/doc/salome/examples/CTestTestfileInstall.cmake +++ b/doc/salome/examples/CTestTestfileInstall.cmake @@ -17,15 +17,13 @@ # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com # -INCLUDE(tests.set) +SET(TESTS_DIR "$ENV{SMESH_ROOT_DIR}/@SALOME_INSTALL_DOC@/examples/SMESH") -SET(SALOME_TEST_DRIVER "$ENV{KERNEL_ROOT_DIR}/bin/salome/appliskel/salome_test_driver.py") -SET(COMPONENT_NAME SMESH) -SET(TIMEOUT 300) +INCLUDE(tests.set) FOREACH(tfile ${GOOD_TESTS} ${BAD_TESTS}) GET_FILENAME_COMPONENT(BASE_NAME ${tfile} NAME_WE) - SET(TEST_NAME SMESH_${BASE_NAME}) - ADD_TEST(${TEST_NAME} python ${SALOME_TEST_DRIVER} ${TIMEOUT} ${tfile}) + SET(TEST_NAME ${COMPONENT_NAME}_${BASE_NAME}) + ADD_TEST(${TEST_NAME} python ${SALOME_TEST_DRIVER} ${TIMEOUT} ${TESTS_DIR}/${tfile}) SET_TESTS_PROPERTIES(${TEST_NAME} PROPERTIES LABELS "${COMPONENT_NAME}") ENDFOREACH() diff --git a/doc/salome/examples/testme.py b/doc/salome/examples/testme.py deleted file mode 100755 index 7babeeacc..000000000 --- a/doc/salome/examples/testme.py +++ /dev/null @@ -1,56 +0,0 @@ -#!/usr/bin/env python3 -# Copyright (C) 2007-2020 CEA/DEN, EDF R&D, OPEN CASCADE -# -# 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 -# - - -import unittest, sys, os - -class SalomeSession(object): - def __init__(self, script): - import runSalome - run_script = "runSalome.py" - if sys.platform == 'win32': - module_dir = os.getenv("KERNEL_ROOT_DIR") - if module_dir: run_script = os.path.join(module_dir, "bin", "salome", run_script) - pass - sys.argv = [run_script] - sys.argv += ["--terminal"] - sys.argv += ["--modules=GEOM,SHAPER,SHAPERSTUDY,SMESH"] - sys.argv += ["%s" % script] - if sys.platform == 'win32': - main_module_path = sys.modules['__main__'].__file__ - sys.modules['__main__'].__file__ = '' - clt, d = runSalome.main() - if sys.platform == 'win32': - sys.modules['__main__'].__file__ = main_module_path - return - - def __del__(self): - port = os.getenv('NSPORT') - import killSalomeWithPort - killSalomeWithPort.killMyPort(port) - return - pass - -class MyTest(unittest.TestCase): - def testFunction(self): - SalomeSession(sys.argv[1]) - pass - -unittest.main(argv=sys.argv[:1]) diff --git a/doc/salome/examples/tests.set b/doc/salome/examples/tests.set index 4f341f55e..767ac77c8 100644 --- a/doc/salome/examples/tests.set +++ b/doc/salome/examples/tests.set @@ -183,5 +183,3 @@ SET(GOOD_TESTS quad_medial_axis_algo.py defining_hypotheses_len_near_vertex.py ) - -SET(EXAMPLES_TESTS ${BAD_TESTS} ${GOOD_TESTS} testme.py) diff --git a/doc/salome/gui/SMESH/CMakeLists.txt b/doc/salome/gui/SMESH/CMakeLists.txt index 644a69b5e..8798c825c 100644 --- a/doc/salome/gui/SMESH/CMakeLists.txt +++ b/doc/salome/gui/SMESH/CMakeLists.txt @@ -19,10 +19,8 @@ INCLUDE(UseSphinx) -SALOME_INSTALL_SCRIPTS(collect_mesh_methods.py ${SALOME_INSTALL_BINS}) - #SET(DOC_SMESH_MeshersList StdMeshers) -SET(smesh_file "${CMAKE_CURRENT_SOURCE_DIR}/collect_mesh_methods.py") +SET(smesh_file "${CMAKE_SOURCE_DIR}/doc/salome/collect_mesh_methods.py") SET(smesh_merge_file "${CMAKE_CURRENT_SOURCE_DIR}/merge_mesh_class.py") # Define requared environment variables diff --git a/src/Tools/CMakeLists.txt b/src/Tools/CMakeLists.txt index de8baf90a..6275ca1a7 100644 --- a/src/Tools/CMakeLists.txt +++ b/src/Tools/CMakeLists.txt @@ -37,3 +37,10 @@ SET(plugin_SCRIPTS # --- rules --- SALOME_INSTALL_SCRIPTS("${plugin_SCRIPTS}" ${SALOME_SMESH_INSTALL_PLUGINS}) + +IF(SALOME_BUILD_TESTS) + SET(TEST_INSTALL_DIRECTORY ${SALOME_INSTALL_SCRIPT_SCRIPTS}/test/tools) + INSTALL(FILES CTestTestfileInstall.cmake + DESTINATION ${TEST_INSTALL_DIRECTORY} + RENAME CTestTestfile.cmake) +ENDIF() diff --git a/src/Tools/CTestTestfileInstall.cmake b/src/Tools/CTestTestfileInstall.cmake new file mode 100644 index 000000000..7145456e6 --- /dev/null +++ b/src/Tools/CTestTestfileInstall.cmake @@ -0,0 +1,20 @@ +# Copyright (C) 2017-2020 CEA/DEN, EDF R&D, OPEN CASCADE +# +# 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 +# + +SUBDIRS(MacMesh) diff --git a/src/Tools/MacMesh/CMakeLists.txt b/src/Tools/MacMesh/CMakeLists.txt index eb6b82fcb..cb1f07743 100644 --- a/src/Tools/MacMesh/CMakeLists.txt +++ b/src/Tools/MacMesh/CMakeLists.txt @@ -49,18 +49,32 @@ SET(plugin_SCRIPTS MacMesh/PublishGroups.py MacMesh/SharpAngle.py ) -SET(sample_SCRIPT +SET(sample_SCRIPTS ${CMAKE_CURRENT_BINARY_DIR}/PressureValve.py ) # --- rules --- SALOME_INSTALL_SCRIPTS("${plugin_SCRIPTS}" ${MACMESH_INSTALL_PY}) -SALOME_INSTALL_SCRIPTS("${sample_SCRIPT}" ${SALOME_INSTALL_SCRIPT_PYTHON} DEF_PERMS) +SALOME_INSTALL_SCRIPTS("${sample_SCRIPTS}" ${SALOME_INSTALL_DOC}/examples/SMESH DEF_PERMS) -SET(testname MacMesh_Example_PressureValve) -SALOME_GENERATE_TESTS_ENVIRONMENT(tests_env) -ADD_TEST( - NAME ${testname} - COMMAND ${PYTHON_EXECUTABLE} -B ${CMAKE_SOURCE_DIR}/doc/salome/examples/testme.py ${sample_SCRIPT}) -SET_TESTS_PROPERTIES(${testname} PROPERTIES ENVIRONMENT "${tests_env}") +IF(SALOME_BUILD_TESTS) + SET(TEST_HELPER ${KERNEL_ROOT_DIR}/bin/salome/test_helper.py) + SALOME_GENERATE_TESTS_ENVIRONMENT(tests_env) + FOREACH(test ${sample_SCRIPTS}) + GET_FILENAME_COMPONENT(testname ${test} NAME_WE) + ADD_TEST(NAME MacMesh_${testname} + COMMAND ${PYTHON_EXECUTABLE} -B ${TEST_HELPER} ${test}) + SET_TESTS_PROPERTIES(MacMesh_${testname} PROPERTIES ENVIRONMENT "${tests_env}") + ENDFOREACH() + + # Application tests + # Note: we don't install test scripts as they are already installed to the documentation folder + + SET(TEST_INSTALL_DIRECTORY ${SALOME_INSTALL_SCRIPT_SCRIPTS}/test/tools/MacMesh) + + CONFIGURE_FILE(CTestTestfileInstall.cmake ${CMAKE_CURRENT_BINARY_DIR}/CTestTestfileInstall.cmake @ONLY) + INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/CTestTestfileInstall.cmake + DESTINATION ${TEST_INSTALL_DIRECTORY} + RENAME CTestTestfile.cmake) +ENDIF() diff --git a/src/Tools/MacMesh/CTestTestfileInstall.cmake b/src/Tools/MacMesh/CTestTestfileInstall.cmake new file mode 100644 index 000000000..4d9a06476 --- /dev/null +++ b/src/Tools/MacMesh/CTestTestfileInstall.cmake @@ -0,0 +1,29 @@ +# Copyright (C) 2015-2020 CEA/DEN, EDF R&D, OPEN CASCADE +# +# 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(TESTS_DIR "$ENV{SMESH_ROOT_DIR}/@SALOME_INSTALL_DOC@/examples/SMESH") + +SET(TESTS PressureValve.py) + +FOREACH(tfile ${TESTS}) + GET_FILENAME_COMPONENT(BASE_NAME ${tfile} NAME_WE) + SET(TEST_NAME ${COMPONENT_NAME}_${BASE_NAME}) + ADD_TEST(${TEST_NAME} python ${SALOME_TEST_DRIVER} ${TIMEOUT} ${TESTS_DIR}/${tfile}) + SET_TESTS_PROPERTIES(${TEST_NAME} PROPERTIES LABELS "${COMPONENT_NAME}") +ENDFOREACH() diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 4e58f7d62..f0bd76a14 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -20,23 +20,30 @@ # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com # +INCLUDE(tests.set) + +# For 'make test' + SALOME_GENERATE_TESTS_ENVIRONMENT(_test_env) -SET(_test_helper ${CMAKE_SOURCE_DIR}/doc/salome/examples/testme.py) +SET(TEST_HELPER ${KERNEL_ROOT_DIR}/bin/salome/test_helper.py) + +FOREACH(test ${GOOD_TESTS}) + GET_FILENAME_COMPONENT(testname ${test} NAME_WE) + ADD_TEST(NAME ${testname} + COMMAND ${PYTHON_EXECUTABLE} -B ${TEST_HELPER} ${CMAKE_CURRENT_SOURCE_DIR}/${test}) + SET_TESTS_PROPERTIES(${testname} PROPERTIES ENVIRONMENT "${tests_env}") +ENDFOREACH() + +# Application tests -# Tests from RESTRICTED repository ----------------------------------- +SET(TEST_INSTALL_DIRECTORY ${SALOME_INSTALL_SCRIPT_SCRIPTS}/test/tests) -SET(RESTRICTED_ROOT_DIR $ENV{RESTRICTED_ROOT_DIR} CACHE PATH "Path to the restricted repository") +INSTALL(FILES CTestTestfileInstall.cmake + DESTINATION ${TEST_INSTALL_DIRECTORY} + RENAME CTestTestfile.cmake) -IF(WITH_SHAPER_STUDY AND EXISTS ${RESTRICTED_ROOT_DIR}) - FILE(GLOB _restricted_tests "${RESTRICTED_ROOT_DIR}/SMESH/*.py") - FOREACH(_test ${_restricted_tests}) - GET_FILENAME_COMPONENT(_test_name ${_test} NAME_WE) - ADD_TEST(NAME ${_test_name} - COMMAND ${PYTHON_EXECUTABLE} -B ${_test_helper} ${_test}) - SET_TESTS_PROPERTIES(${_test_name} PROPERTIES ENVIRONMENT "${_test_env}") - ENDFOREACH() -ELSE() - MESSAGE(WARNING "Tests from RESTRICTED repository aren't available") -ENDIF() +INSTALL(FILES tests.set DESTINATION ${TEST_INSTALL_DIRECTORY}) -# -------------------------------------------------------------------- +# WARNING! DO NOT INSTALL RESTRICTED_TESTS HERE!!!! +SET(ALL_TESTS ${BAD_TESTS} ${GOOD_TESTS}) +SALOME_INSTALL_SCRIPTS("${ALL_TESTS}" ${TEST_INSTALL_DIRECTORY}) diff --git a/test/CTestTestfileInstall.cmake b/test/CTestTestfileInstall.cmake new file mode 100644 index 000000000..2d44e9a51 --- /dev/null +++ b/test/CTestTestfileInstall.cmake @@ -0,0 +1,27 @@ +# Copyright (C) 2015-2020 CEA/DEN, EDF R&D, OPEN CASCADE +# +# 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 +# + +INCLUDE(tests.set) + +FOREACH(tfile ${GOOD_TESTS} ${BAD_TESTS} ${RESTRICTED_TESTS}) + GET_FILENAME_COMPONENT(BASE_NAME ${tfile} NAME_WE) + SET(TEST_NAME ${COMPONENT_NAME}_${BASE_NAME}) + ADD_TEST(${TEST_NAME} python ${SALOME_TEST_DRIVER} ${TIMEOUT} ${tfile}) + SET_TESTS_PROPERTIES(${TEST_NAME} PROPERTIES LABELS "${COMPONENT_NAME}") +ENDFOREACH() diff --git a/test/tests.set b/test/tests.set new file mode 100644 index 000000000..98d9c229d --- /dev/null +++ b/test/tests.set @@ -0,0 +1,35 @@ +# Copyright (C) 2015-2020 CEA/DEN, EDF R&D, OPEN CASCADE +# +# 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 +# + +# test cases that can't be used for testing because they use external mesher plug-ins +SET(BAD_TESTS) + +# test cases that can be used for testing because they don't use external mesher plug-ins +SET(GOOD_TESTS) + +# test cases from RESTRICTED repositpory +SET(RESTRICTED_ROOT_DIR $ENV{RESTRICTED_ROOT_DIR}) + +SET(RESTRICTED_TESTS) +IF(EXISTS ${RESTRICTED_ROOT_DIR}) + FILE(GLOB _restricted_tests "${RESTRICTED_ROOT_DIR}/SMESH/*.py") + FOREACH(_test ${_restricted_tests}) + LIST(APPEND RESTRICTED_TESTS ${_test}) + ENDFOREACH() +ENDIF() -- 2.39.2