From 678cc49ae383ed1e084a637e57ab30f1a1a4d13a Mon Sep 17 00:00:00 2001 From: vsr Date: Mon, 25 May 2020 21:13:19 +0300 Subject: [PATCH] Rearrange tests --- src/tests/Test/CMakeLists.txt | 35 ++++++++++++----------- src/tests/Test/CTestTestfileInstall.cmake | 25 ++++------------ src/tests/Test/tests.set | 34 ++++++++++++++++++++++ 3 files changed, 58 insertions(+), 36 deletions(-) create mode 100644 src/tests/Test/tests.set diff --git a/src/tests/Test/CMakeLists.txt b/src/tests/Test/CMakeLists.txt index 1b1e6153..9099937c 100644 --- a/src/tests/Test/CMakeLists.txt +++ b/src/tests/Test/CMakeLists.txt @@ -17,26 +17,27 @@ # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com # -# For salome test -SET(HOMARD_TEST_FILES - test_1.py - test_2.py - test_3.py - test_4.py - test_5.py - test_6.py - tutorial_1.py - tutorial_2.py - tutorial_3.py - tutorial_4.py - tutorial_5.py - tutorial_6.py - test_util.py -) +INCLUDE(tests.set) + +# For make test + +SET(SALOME_TEST_DRIVER "${KERNEL_ROOT_DIR}/bin/salome/appliskel/salome_test_driver.py") +SET(TIMEOUT 500) +SALOME_GENERATE_TESTS_ENVIRONMENT(tests_env) +FOREACH(tfile ${HOMARD_TEST_FILES}) + GET_FILENAME_COMPONENT(TEST_NAME ${tfile} NAME_WE) + ADD_TEST(NAME ${TEST_NAME} + COMMAND ${PYTHON_EXECUTABLE} -B ${SALOME_TEST_DRIVER} ${TIMEOUT} ${CMAKE_CURRENT_SOURCE_DIR}/${tfile}) + SET_TESTS_PROPERTIES(${TEST_NAME} PROPERTIES ENVIRONMENT "${tests_env}") +ENDFOREACH() + +# For salome test INSTALL(FILES ${HOMARD_TEST_FILES} DESTINATION ${SALOME_HOMARD_INSTALL_TEST}) INSTALL(FILES CTestTestfileInstall.cmake DESTINATION ${SALOME_HOMARD_INSTALL_TEST} - RENAME CTestTestfile.cmake) \ No newline at end of file + RENAME CTestTestfile.cmake) + +INSTALL(FILES tests.set DESTINATION ${SALOME_HOMARD_INSTALL_TEST}) diff --git a/src/tests/Test/CTestTestfileInstall.cmake b/src/tests/Test/CTestTestfileInstall.cmake index 08ca692b..dc4154d9 100644 --- a/src/tests/Test/CTestTestfileInstall.cmake +++ b/src/tests/Test/CTestTestfileInstall.cmake @@ -17,28 +17,15 @@ # 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") +INCLUDE(tests.set) +SET(SALOME_TEST_DRIVER "$ENV{KERNEL_ROOT_DIR}/bin/salome/appliskel/salome_test_driver.py") SET(COMPONENT_NAME HOMARD) -SET(TIMEOUT 500) - -SET(HOMARD_TEST_FILES -test_1 -test_2 -test_3 -test_4 -test_5 -test_6 -tutorial_1 -tutorial_2 -tutorial_3 -tutorial_4 -tutorial_5 -tutorial_6 -) +SET(TIMEOUT 500) FOREACH(tfile ${HOMARD_TEST_FILES}) - SET(TEST_NAME HOMARD_${tfile}) - ADD_TEST(${TEST_NAME} python ${SALOME_TEST_DRIVER} ${TIMEOUT} ${tfile}.py) + GET_FILENAME_COMPONENT(TEST_NAME ${tfile} NAME_WE) + SET(TEST_NAME ${COMPONENT_NAME}_${tfile}) + ADD_TEST(${TEST_NAME} python ${SALOME_TEST_DRIVER} ${TIMEOUT} ${tfile}) SET_TESTS_PROPERTIES(${TEST_NAME} PROPERTIES LABELS "${COMPONENT_NAME}") ENDFOREACH() diff --git a/src/tests/Test/tests.set b/src/tests/Test/tests.set new file mode 100644 index 00000000..7bffd60f --- /dev/null +++ b/src/tests/Test/tests.set @@ -0,0 +1,34 @@ +# Copyright (C) 2016-2020 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(HOMARD_TEST_FILES + test_1.py + test_2.py + test_3.py + test_4.py + test_5.py + test_6.py + tutorial_1.py + tutorial_2.py + tutorial_3.py + tutorial_4.py + tutorial_5.py + tutorial_6.py + test_util.py +) -- 2.39.2