From 741cc009133588fab07c8ab5d24606fadd76b044 Mon Sep 17 00:00:00 2001 From: =?utf8?q?C=C3=A9dric=20Aguerre?= Date: Mon, 18 Jul 2016 14:46:27 +0200 Subject: [PATCH] [MEDCalc] folder organization for salome test --- CTestTestfileInstall.cmake | 2 +- src/MEDCalc/CMakeLists.txt | 7 +-- src/MEDCalc/test/CMakeLists.txt | 35 +++--------- src/MEDCalc/test/CTestTestfileInstall.cmake | 14 +---- src/MEDCalc/test/gui/CMakeLists.txt | 52 ++++++++++++++++++ .../test/gui/CTestTestfileInstall.cmake | 31 +++++++++++ src/MEDCalc/test/{ => gui}/README.txt | 0 .../test/{ => gui}/baselines/CMakeLists.txt | 0 .../{ => gui}/baselines/test_scalarmap.png | Bin src/MEDCalc/test/{ => gui}/guiTester.pro | 0 .../test/{ => gui}/medcalc_testutils.py.in | 13 ++--- .../{ => gui}/medfiles/test_scalarmap.med | Bin .../{ => gui}/scenarios/test_scalarmap.xml | 0 src/MEDCalc/test/{ => gui}/test_qttesting.py | 0 src/MEDCalc/test/{ => gui}/test_scalarmap.py | 0 src/MEDCalc/test/tui/CMakeLists.txt | 23 ++++++++ .../test/tui/CTestTestfileInstall.cmake | 18 ++++++ 17 files changed, 143 insertions(+), 52 deletions(-) create mode 100644 src/MEDCalc/test/gui/CMakeLists.txt create mode 100644 src/MEDCalc/test/gui/CTestTestfileInstall.cmake rename src/MEDCalc/test/{ => gui}/README.txt (100%) rename src/MEDCalc/test/{ => gui}/baselines/CMakeLists.txt (100%) rename src/MEDCalc/test/{ => gui}/baselines/test_scalarmap.png (100%) rename src/MEDCalc/test/{ => gui}/guiTester.pro (100%) rename src/MEDCalc/test/{ => gui}/medcalc_testutils.py.in (83%) rename src/MEDCalc/test/{ => gui}/medfiles/test_scalarmap.med (100%) rename src/MEDCalc/test/{ => gui}/scenarios/test_scalarmap.xml (100%) rename src/MEDCalc/test/{ => gui}/test_qttesting.py (100%) rename src/MEDCalc/test/{ => gui}/test_scalarmap.py (100%) create mode 100644 src/MEDCalc/test/tui/CMakeLists.txt create mode 100644 src/MEDCalc/test/tui/CTestTestfileInstall.cmake diff --git a/CTestTestfileInstall.cmake b/CTestTestfileInstall.cmake index 0fb26934a..c590d9976 100644 --- a/CTestTestfileInstall.cmake +++ b/CTestTestfileInstall.cmake @@ -20,5 +20,5 @@ SET(COMPONENT_NAME MEDCALC) SET(TIMEOUT 300) -SUBDIRS(MEDCalculator) +#SUBDIRS(MEDCalculator) SUBDIRS(MEDCalc) diff --git a/src/MEDCalc/CMakeLists.txt b/src/MEDCalc/CMakeLists.txt index 560ecadd9..2db954b42 100644 --- a/src/MEDCalc/CMakeLists.txt +++ b/src/MEDCalc/CMakeLists.txt @@ -22,13 +22,10 @@ ADD_SUBDIRECTORY(res) IF(SALOME_BUILD_GUI) ADD_SUBDIRECTORY(gui) - - IF(SALOME_MED_WITH_QTTESTING) - ADD_SUBDIRECTORY(test) - ENDIF() - ENDIF() +ADD_SUBDIRECTORY(test) + IF(SALOME_MED_ENABLE_PYTHON) ADD_SUBDIRECTORY(tui) ADD_SUBDIRECTORY(exe) diff --git a/src/MEDCalc/test/CMakeLists.txt b/src/MEDCalc/test/CMakeLists.txt index 329a4d3ae..72cf4a1a5 100644 --- a/src/MEDCalc/test/CMakeLists.txt +++ b/src/MEDCalc/test/CMakeLists.txt @@ -17,36 +17,17 @@ # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com # -SALOME_CONFIGURE_FILE(medcalc_testutils.py.in ${CMAKE_CURRENT_BINARY_DIR}/medcalc_testutils.py) +IF(SALOME_BUILD_GUI) + IF(SALOME_MED_WITH_QTTESTING) + ADD_SUBDIRECTORY(gui) + ENDIF() +ENDIF() -SET(_test_scripts - test_scalarmap.py -) +IF(SALOME_MED_ENABLE_PYTHON) + ADD_SUBDIRECTORY(tui) +ENDIF() -SET(_test_scenarii - scenarios/test_scalarmap.xml -) - -SET(_test_baselines - baselines/test_scalarmap.png -) - -SET(_test_files - medfiles/test_scalarmap.med -) - -# Install rules SET(TEST_INSTALL_DIRECTORY ${SALOME_MED_INSTALL_TEST}/MEDCalc) - -SALOME_INSTALL_SCRIPTS(test_qttesting.py ${TEST_INSTALL_DIRECTORY}) -SALOME_INSTALL_SCRIPTS(${CMAKE_CURRENT_BINARY_DIR}/medcalc_testutils.py ${TEST_INSTALL_DIRECTORY}) - -SALOME_INSTALL_SCRIPTS("${_test_scripts}" ${SALOME_INSTALL_PYTHON}/tests) - -INSTALL(FILES ${_test_scenarii} DESTINATION ${SALOME_MED_INSTALL_RES_DATA}/tests/scenarios) -INSTALL(FILES ${_test_baselines} DESTINATION ${SALOME_MED_INSTALL_RES_DATA}/tests/baselines) -INSTALL(FILES ${_test_files} DESTINATION ${SALOME_MED_INSTALL_RES_DATA}/tests/medfiles) - INSTALL(FILES CTestTestfileInstall.cmake DESTINATION ${TEST_INSTALL_DIRECTORY} RENAME CTestTestfile.cmake) diff --git a/src/MEDCalc/test/CTestTestfileInstall.cmake b/src/MEDCalc/test/CTestTestfileInstall.cmake index ef479a14e..554cb897e 100644 --- a/src/MEDCalc/test/CTestTestfileInstall.cmake +++ b/src/MEDCalc/test/CTestTestfileInstall.cmake @@ -17,15 +17,5 @@ # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com # -SET(TEST_NAMES - test_qttesting -) - -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} - ) -ENDFOREACH() +SUBDIRS(gui) +SUBDIRS(tui) diff --git a/src/MEDCalc/test/gui/CMakeLists.txt b/src/MEDCalc/test/gui/CMakeLists.txt new file mode 100644 index 000000000..cb6df7349 --- /dev/null +++ b/src/MEDCalc/test/gui/CMakeLists.txt @@ -0,0 +1,52 @@ +# Copyright (C) 2012-2016 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 +# + +SALOME_CONFIGURE_FILE(medcalc_testutils.py.in ${CMAKE_CURRENT_BINARY_DIR}/medcalc_testutils.py) + +SET(_test_scripts + test_scalarmap.py +) + +SET(_test_scenarii + scenarios/test_scalarmap.xml +) + +SET(_test_baselines + baselines/test_scalarmap.png +) + +SET(_test_files + medfiles/test_scalarmap.med +) + +# Install rules +SET(TEST_INSTALL_DIRECTORY ${SALOME_MED_INSTALL_TEST}/MEDCalc/gui) + +SALOME_INSTALL_SCRIPTS(test_qttesting.py ${TEST_INSTALL_DIRECTORY}) +SALOME_INSTALL_SCRIPTS(${CMAKE_CURRENT_BINARY_DIR}/medcalc_testutils.py ${TEST_INSTALL_DIRECTORY}) + +SALOME_INSTALL_SCRIPTS("${_test_scripts}" ${SALOME_INSTALL_PYTHON}/tests) + +INSTALL(FILES ${_test_scenarii} DESTINATION ${SALOME_MED_INSTALL_RES_DATA}/tests/gui/scenarios) +INSTALL(FILES ${_test_baselines} DESTINATION ${SALOME_MED_INSTALL_RES_DATA}/tests/gui/baselines) +INSTALL(FILES ${_test_files} DESTINATION ${SALOME_MED_INSTALL_RES_DATA}/tests/gui/medfiles) + +INSTALL(FILES CTestTestfileInstall.cmake + DESTINATION ${TEST_INSTALL_DIRECTORY} + RENAME CTestTestfile.cmake) diff --git a/src/MEDCalc/test/gui/CTestTestfileInstall.cmake b/src/MEDCalc/test/gui/CTestTestfileInstall.cmake new file mode 100644 index 000000000..ef479a14e --- /dev/null +++ b/src/MEDCalc/test/gui/CTestTestfileInstall.cmake @@ -0,0 +1,31 @@ +# Copyright (C) 2016 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(TEST_NAMES + test_qttesting +) + +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} + ) +ENDFOREACH() diff --git a/src/MEDCalc/test/README.txt b/src/MEDCalc/test/gui/README.txt similarity index 100% rename from src/MEDCalc/test/README.txt rename to src/MEDCalc/test/gui/README.txt diff --git a/src/MEDCalc/test/baselines/CMakeLists.txt b/src/MEDCalc/test/gui/baselines/CMakeLists.txt similarity index 100% rename from src/MEDCalc/test/baselines/CMakeLists.txt rename to src/MEDCalc/test/gui/baselines/CMakeLists.txt diff --git a/src/MEDCalc/test/baselines/test_scalarmap.png b/src/MEDCalc/test/gui/baselines/test_scalarmap.png similarity index 100% rename from src/MEDCalc/test/baselines/test_scalarmap.png rename to src/MEDCalc/test/gui/baselines/test_scalarmap.png diff --git a/src/MEDCalc/test/guiTester.pro b/src/MEDCalc/test/gui/guiTester.pro similarity index 100% rename from src/MEDCalc/test/guiTester.pro rename to src/MEDCalc/test/gui/guiTester.pro diff --git a/src/MEDCalc/test/medcalc_testutils.py.in b/src/MEDCalc/test/gui/medcalc_testutils.py.in similarity index 83% rename from src/MEDCalc/test/medcalc_testutils.py.in rename to src/MEDCalc/test/gui/medcalc_testutils.py.in index 61fe9d124..bcdf7f9a3 100644 --- a/src/MEDCalc/test/medcalc_testutils.py.in +++ b/src/MEDCalc/test/gui/medcalc_testutils.py.in @@ -19,23 +19,22 @@ import os -def __getRootDir(): +def __getRootDir(): rootDir = os.environ.get("MED_ROOT_DIR", "") - return rootDir + return rootDir def GetScriptDir(): relativeDir = "@SALOME_INSTALL_PYTHON@/tests" return os.path.join(__getRootDir(), relativeDir) def GetScenarioDir(): - relativeDir = "@SALOME_MED_INSTALL_RES_DATA@/tests/scenarios" + relativeDir = "@SALOME_MED_INSTALL_RES_DATA@/tests/gui/scenarios" return os.path.join(__getRootDir(), relativeDir) def GetBaselineDir(): - relativeDir = "@SALOME_MED_INSTALL_RES_DATA@/tests/baselines" + relativeDir = "@SALOME_MED_INSTALL_RES_DATA@/tests/gui/baselines" return os.path.join(__getRootDir(), relativeDir) - + def GetMEDFileDir(): - relativeDir = "@SALOME_MED_INSTALL_RES_DATA@/tests/medfiles" + relativeDir = "@SALOME_MED_INSTALL_RES_DATA@/tests/gui/medfiles" return os.path.join(__getRootDir(), relativeDir) - diff --git a/src/MEDCalc/test/medfiles/test_scalarmap.med b/src/MEDCalc/test/gui/medfiles/test_scalarmap.med similarity index 100% rename from src/MEDCalc/test/medfiles/test_scalarmap.med rename to src/MEDCalc/test/gui/medfiles/test_scalarmap.med diff --git a/src/MEDCalc/test/scenarios/test_scalarmap.xml b/src/MEDCalc/test/gui/scenarios/test_scalarmap.xml similarity index 100% rename from src/MEDCalc/test/scenarios/test_scalarmap.xml rename to src/MEDCalc/test/gui/scenarios/test_scalarmap.xml diff --git a/src/MEDCalc/test/test_qttesting.py b/src/MEDCalc/test/gui/test_qttesting.py similarity index 100% rename from src/MEDCalc/test/test_qttesting.py rename to src/MEDCalc/test/gui/test_qttesting.py diff --git a/src/MEDCalc/test/test_scalarmap.py b/src/MEDCalc/test/gui/test_scalarmap.py similarity index 100% rename from src/MEDCalc/test/test_scalarmap.py rename to src/MEDCalc/test/gui/test_scalarmap.py diff --git a/src/MEDCalc/test/tui/CMakeLists.txt b/src/MEDCalc/test/tui/CMakeLists.txt new file mode 100644 index 000000000..6bb09a53d --- /dev/null +++ b/src/MEDCalc/test/tui/CMakeLists.txt @@ -0,0 +1,23 @@ +# Copyright (C) 2016 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(TEST_INSTALL_DIRECTORY ${SALOME_MED_INSTALL_TEST}/MEDCalc/tui) +INSTALL(FILES CTestTestfileInstall.cmake + DESTINATION ${TEST_INSTALL_DIRECTORY} + RENAME CTestTestfile.cmake) diff --git a/src/MEDCalc/test/tui/CTestTestfileInstall.cmake b/src/MEDCalc/test/tui/CTestTestfileInstall.cmake new file mode 100644 index 000000000..f361715a6 --- /dev/null +++ b/src/MEDCalc/test/tui/CTestTestfileInstall.cmake @@ -0,0 +1,18 @@ +# Copyright (C) 2016 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 +# -- 2.39.2