]> SALOME platform Git repositories - plugins/gmshplugin.git/commitdiff
Salome HOME
Rearrange tests vsr/clean_up
authorvsr <vsr@opencascade.com>
Mon, 25 May 2020 16:58:35 +0000 (19:58 +0300)
committervsr <vsr@opencascade.com>
Mon, 25 May 2020 17:38:01 +0000 (20:38 +0300)
CMakeLists.txt
CTestTestfileInstall.cmake [new file with mode: 0644]
doc/salome/CMakeLists.txt
doc/salome/examples/CMakeLists.txt
doc/salome/examples/examples.set
doc/salome/gui/GMSHPLUGIN/CMakeLists.txt
tests/CMakeLists.txt
tests/CTestTestfileInstall.cmake [deleted file]
tests/tests.set

index ff16b06f61f584f9a5d42db1a6ad3d434b4f9ab5..04868ed1d61a36891a995842459c9e7d5c94abaf 100644 (file)
@@ -142,12 +142,6 @@ IF(EXISTS ${SMESH_ROOT_DIR})
       MESSAGE(FATAL_ERROR "We absolutely need a Salome SMESH with GUI, please set SALOME_BUILD_GUI=ON in SMESH module")
     ENDIF(NOT SALOME_SMESH_BUILD_GUI)
   ENDIF(SALOME_BUILD_GUI)
-  IF(SALOME_BUILD_DOC)
-    IF(NOT SALOME_SMESH_BUILD_DOC)
-      MESSAGE(FATAL_ERROR "We absolutely need a Salome SMESH documentation to build GMSHPLUGIN documentation. "
-                         "So, you should either set SALOME_BUILD_DOC=OFF in GMSHPLUGIN or set SALOME_BUILD_DOC=ON in SMESH module.")
-    ENDIF(NOT SALOME_SMESH_BUILD_DOC)
-  ENDIF(SALOME_BUILD_DOC)
 ELSE(EXISTS ${SMESH_ROOT_DIR})
   MESSAGE(FATAL_ERROR "We absolutely need a Salome SMESH, please define SMESH_ROOT_DIR")
 ENDIF(EXISTS ${SMESH_ROOT_DIR})
@@ -213,9 +207,7 @@ ADD_SUBDIRECTORY(bin)
 IF(SALOME_BUILD_TESTS)
   ADD_SUBDIRECTORY(tests)
 ENDIF(SALOME_BUILD_TESTS)
-IF(SALOME_BUILD_DOC)
-  ADD_SUBDIRECTORY(doc)
-ENDIF(SALOME_BUILD_DOC)
+ADD_SUBDIRECTORY(doc)
 
 # Header configuration
 # ====================
@@ -274,3 +266,12 @@ 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)
+  CONFIGURE_FILE(CTestTestfileInstall.cmake
+                 ${CMAKE_CURRENT_BINARY_DIR}/CTestTestfileInstall.cmake
+                 @ONLY)
+  INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/CTestTestfileInstall.cmake
+          DESTINATION ${SALOME_GMSHPLUGIN_INSTALL_TESTS}
+          RENAME CTestTestfile.cmake)
+ENDIF()
diff --git a/CTestTestfileInstall.cmake b/CTestTestfileInstall.cmake
new file mode 100644 (file)
index 0000000..ae83423
--- /dev/null
@@ -0,0 +1,36 @@
+# Copyright (C) 2012-2015  ALNEOS
+# Copyright (C) 2016-2020  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.alneos.com/ or email : contact@alneos.fr
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+#
+
+SET(TESTS_DIR "$ENV{GMSHPLUGIN_ROOT_DIR}/@SALOME_INSTALL_DOC@/examples/GMSHPLUGIN")
+
+INCLUDE(tests.set)
+INCLUDE(examples.set)
+
+SET(COMPONENT_NAME GMSHPLUGIN)
+SET(SALOME_TEST_DRIVER "$ENV{KERNEL_ROOT_DIR}/bin/salome/appliskel/salome_test_driver.py")
+SET(TIMEOUT 300)
+
+FOREACH(tfile ${TEST_SCRIPTS} ${EXAMPLE_SCRIPTS})
+  GET_FILENAME_COMPONENT(TEST_NAME ${tfile} NAME_WE)
+  SET(TEST_NAME "${COMPONENT_NAME}_${TEST_NAME}")
+  ADD_TEST(${TEST_NAME} python ${SALOME_TEST_DRIVER} ${TIMEOUT} ${TESTS_DIR}/${tfile})
+  SET_TESTS_PROPERTIES(${TEST_NAME} PROPERTIES LABELS "${COMPONENT_NAME}")
+ENDFOREACH()
index fc085921c4e43efb1de32a8b86edb25bbe67bd20..76372b38cdbc1507f919c9b9153e1aa5fe29d8e8 100644 (file)
@@ -20,4 +20,6 @@
 #
 
 ADD_SUBDIRECTORY(examples)
-ADD_SUBDIRECTORY(gui)
\ No newline at end of file
+IF(SALOME_BUILD_DOC)
+  ADD_SUBDIRECTORY(gui)
+ENDIF()
index 5d50b9716735e0eaae95d8f2af1b611b2a3830b1..361e88a4156486d4a934728e642cceb31c3c81e0 100644 (file)
 # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 #
 
-#FILE(GLOB files "${CMAKE_CURRENT_SOURCE_DIR}/*.py")
-#INSTALL(FILES ${files} DESTINATION ${SALOME_INSTALL_DOC}/examples/GMSHPLUGIN)
-
 INCLUDE(examples.set)
 
-SET(COMPONENT_NAME GMSHPLUGIN)
-SET(SALOME_TEST_DRIVER "$ENV{KERNEL_ROOT_DIR}/bin/salome/appliskel/salome_test_driver.py")
-SET(TIMEOUT        300)
+# Install examples
+
+INSTALL(FILES ${EXAMPLE_SCRIPTS} DESTINATION ${SALOME_INSTALL_DOC}/examples/GMSHPLUGIN)
+
+# Tests
 
-SET(TEST_INSTALL_DIRECTORY ${SALOME_GMSHPLUGIN_INSTALL_TESTS})
+IF(SALOME_BUILD_TESTS)
+  # make test
 
-# make test
-SALOME_GENERATE_TESTS_ENVIRONMENT(tests_env)
+  SET(SALOME_TEST_DRIVER "${KERNEL_ROOT_DIR}/bin/salome/appliskel/salome_test_driver.py")
+  SET(TIMEOUT 300)
+  SALOME_GENERATE_TESTS_ENVIRONMENT(tests_env)
 
-FOREACH(tfile ${EXAMPLE_NAMES})
-  SET(TEST_NAME ${COMPONENT_NAME}_${tfile})
-  ADD_TEST(NAME ${TEST_NAME}
-           COMMAND ${PYTHON_EXECUTABLE} -B ${SALOME_TEST_DRIVER} ${TIMEOUT} ${CMAKE_CURRENT_SOURCE_DIR}/${tfile}.py)
-  SET_TESTS_PROPERTIES(${TEST_NAME} PROPERTIES ENVIRONMENT "${tests_env}")
-  SET_TESTS_PROPERTIES(${TEST_NAME} PROPERTIES LABELS "${COMPONENT_NAME}")
-  INSTALL(FILES ${tfile}.py DESTINATION ${SALOME_INSTALL_DOC}/examples/GMSHPLUGIN)
-ENDFOREACH()
+  FOREACH(tfile ${EXAMPLE_SCRIPTS})
+    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()
 
-# salome test
-FOREACH(tfile ${EXAMPLE_NAMES})
-  INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/${tfile}.py
-          DESTINATION ${TEST_INSTALL_DIRECTORY})
-ENDFOREACH()
+  # salome test
 
-INSTALL(FILES examples.set DESTINATION ${TEST_INSTALL_DIRECTORY})
\ No newline at end of file
+  INSTALL(FILES examples.set DESTINATION ${SALOME_GMSHPLUGIN_INSTALL_TESTS})
+ENDIF()
index be7acf9836d7898543bd62d166cd5d1fa172c29b..8d34b4b1d5b645cdd7b64a30057fdc3720f140bb 100644 (file)
@@ -19,6 +19,6 @@
 # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 #
 
-SET(EXAMPLE_NAMES
-  gmshdemo
+SET(EXAMPLE_SCRIPTS
+  gmshdemo.py
 )
index 7c20c536ce47d82753568c3e6d3623ffbd9e21b5..f3bbd49715900edd9d01833dade49bdd0f92b2a6 100644 (file)
@@ -24,8 +24,8 @@ SALOME_CONFIGURE_FILE(doxyfile_py.in doxyfile_py)
 SALOME_CONFIGURE_FILE(static/header.html.in ${CMAKE_CURRENT_BINARY_DIR}/static/header.html)
 SALOME_CONFIGURE_FILE(static/header_py.html.in ${CMAKE_CURRENT_BINARY_DIR}/static/header_py.html)
 
-SET(smesh_file "$(SMESH_ROOT_DIR)/bin/salome/collect_mesh_methods.py")
-SET(kernel_file "$ENV{KERNEL_ROOT_DIR}/bin/salome/prepare_generating_doc.py")
+SET(smesh_file "${SMESH_ROOT_DIR}/bin/salome/collect_mesh_methods.py")
+SET(kernel_file "${KERNEL_ROOT_DIR}/bin/salome/prepare_generating_doc.py")
 
 SET(ADD_VAR)
 LIST(APPEND ADD_VAR SMESH_MeshersList=GMSHPlugin)
index 286daed3eed3831114727d0aef6fce86fe6a95e5..25d2186b2081e2aca9f0ca7a01944fa7a36f6a4f 100644 (file)
 
 INCLUDE(tests.set)
 
-SET(COMPONENT_NAME GMSHPLUGIN)
-SET(SALOME_TEST_DRIVER "$ENV{KERNEL_ROOT_DIR}/bin/salome/appliskel/salome_test_driver.py")
-SET(TIMEOUT        300)
-
-SET(TEST_INSTALL_DIRECTORY ${SALOME_GMSHPLUGIN_INSTALL_TESTS})
-
-# make test
-SALOME_GENERATE_TESTS_ENVIRONMENT(tests_env)
-
-FOREACH(tfile ${TEST_NAMES})
-  SET(TEST_NAME ${COMPONENT_NAME}_${tfile})
-  ADD_TEST(NAME ${TEST_NAME}
-           COMMAND ${PYTHON_EXECUTABLE} -B ${SALOME_TEST_DRIVER} ${TIMEOUT} ${CMAKE_CURRENT_SOURCE_DIR}/${tfile}.py)
-  SET_TESTS_PROPERTIES(${TEST_NAME} PROPERTIES ENVIRONMENT "${tests_env}")
-  SET_TESTS_PROPERTIES(${TEST_NAME} PROPERTIES LABELS "${COMPONENT_NAME}")
-ENDFOREACH()
-
-# salome test
-FOREACH(tfile ${TEST_NAMES})
-  INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/${tfile}.py
-          DESTINATION ${TEST_INSTALL_DIRECTORY})
-ENDFOREACH()
-
-INSTALL(FILES CTestTestfileInstall.cmake
-  DESTINATION ${TEST_INSTALL_DIRECTORY}
-  RENAME CTestTestfile.cmake)
-
-INSTALL(FILES tests.set DESTINATION ${TEST_INSTALL_DIRECTORY})
\ No newline at end of file
+# Install tests
+
+INSTALL(FILES ${TEST_SCRIPTS} DESTINATION ${SALOME_INSTALL_DOC}/examples/GMSHPLUGIN)
+
+# Tests
+
+IF(SALOME_BUILD_TESTS)
+  # make test
+
+  SET(SALOME_TEST_DRIVER "${KERNEL_ROOT_DIR}/bin/salome/appliskel/salome_test_driver.py")
+  SET(TIMEOUT 300)
+  SALOME_GENERATE_TESTS_ENVIRONMENT(tests_env)
+
+  FOREACH(tfile ${TEST_SCRIPTS})
+    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()
+
+  # salome test
+
+  INSTALL(FILES tests.set DESTINATION ${SALOME_GMSHPLUGIN_INSTALL_TESTS})
+ENDIF()
diff --git a/tests/CTestTestfileInstall.cmake b/tests/CTestTestfileInstall.cmake
deleted file mode 100644 (file)
index adbf212..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
-# Copyright (C) 2012-2015  ALNEOS
-# Copyright (C) 2016-2020  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.alneos.com/ or email : contact@alneos.fr
-# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-#
-
-INCLUDE(tests.set)
-INCLUDE(examples.set)
-
-SET(COMPONENT_NAME GMSHPLUGIN)
-SET(SALOME_TEST_DRIVER "$ENV{KERNEL_ROOT_DIR}/bin/salome/appliskel/salome_test_driver.py")
-SET(TIMEOUT        300)
-
-
-FOREACH(tfile ${TEST_NAMES} ${EXAMPLE_NAMES})
-  SET(TEST_NAME ${COMPONENT_NAME}_${tfile})
-  ADD_TEST(${TEST_NAME} python ${SALOME_TEST_DRIVER} ${TIMEOUT} ${tfile}.py)
-  SET_TESTS_PROPERTIES(${TEST_NAME} PROPERTIES LABELS "${COMPONENT_NAME}")
-ENDFOREACH()
index f089c712508286a966840c5659a679f65d28f58f..5f4d23cd560a8bc43621f79a6e3d8f609782ef96 100644 (file)
@@ -19,6 +19,6 @@
 # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 #
 
-SET(TEST_NAMES
-  basicGroup
+SET(TEST_SCRIPTS
+  basicGroup.py
 )