]> SALOME platform Git repositories - modules/geom.git/commitdiff
Salome HOME
Rearrange tests vsr/clean_up
authorvsr <vsr@opencascade.com>
Thu, 21 May 2020 12:34:42 +0000 (15:34 +0300)
committervsr <vsr@opencascade.com>
Fri, 22 May 2020 15:38:24 +0000 (18:38 +0300)
22 files changed:
CMakeLists.txt
CTestTestfileInstall.cmake
SalomeGEOMConfig.cmake.in
doc/salome/CMakeLists.txt
doc/salome/examples/CMakeLists.txt
doc/salome/examples/CTestTestfileInstall.cmake
doc/salome/examples/GEOM_Field.py [deleted file]
doc/salome/examples/GEOM_box.py [deleted file]
doc/salome/examples/box.py [new file with mode: 0644]
doc/salome/examples/field.py [new file with mode: 0644]
doc/salome/examples/testme.py [deleted file]
doc/salome/examples/tests.set
doc/salome/gui/GEOM/input/geompy.doc
doc/salome/gui/GEOM/input/tui_geom_field.doc
src/GEOM_SWIG/CMakeLists.txt
src/GEOM_SWIG/GEOM_shared_modules.py [deleted file]
src/Tools/t_shape/CMakeLists.txt
src/Tools/t_shape/CTestTestfileInstall.cmake [new file with mode: 0644]
src/Tools/t_shape/t_shape_builder.py
src/Tools/t_shape/test_t_shape_builder.py [new file with mode: 0644]
src/XAO/tests/CMakeLists.txt
src/XAO/tests/data/CMakeLists.txt [deleted file]

index 0fd0bf212acef2e95167bff77dfc3fee023ebdba..aaf694e0a9c29afae560d69e99327885f557e7c6 100644 (file)
@@ -159,27 +159,25 @@ SALOME_PACKAGE_REPORT_AND_CHECK()
 # Directories
 # (default values taken from KERNEL)
 # ===========
-SET(SALOME_INSTALL_BINS "${SALOME_INSTALL_BINS}" CACHE PATH "Install path: SALOME binaries")
-SET(SALOME_INSTALL_LIBS "${SALOME_INSTALL_LIBS}" CACHE PATH "Install path: SALOME libs")
-SET(SALOME_INSTALL_IDLS "${SALOME_INSTALL_IDLS}" CACHE PATH "Install path: SALOME IDL files")
-SET(SALOME_INSTALL_HEADERS "${SALOME_INSTALL_HEADERS}" CACHE PATH "Install path: SALOME headers")
+SET(SALOME_INSTALL_BINS "${SALOME_INSTALL_BINS}" CACHE PATH "Install path: executables")
+SET(SALOME_INSTALL_LIBS "${SALOME_INSTALL_LIBS}" CACHE PATH "Install path: libraries")
+SET(SALOME_INSTALL_IDLS "${SALOME_INSTALL_IDLS}" CACHE PATH "Install path: IDL files")
+SET(SALOME_INSTALL_HEADERS "${SALOME_INSTALL_HEADERS}" CACHE PATH "Install path: headers")
 SET(SALOME_INSTALL_SCRIPT_SCRIPTS "${SALOME_INSTALL_SCRIPT_SCRIPTS}" CACHE PATH
-   "Install path: SALOME scripts")
+   "Install path: scripts")
 SET(SALOME_INSTALL_SCRIPT_DATA "${SALOME_INSTALL_SCRIPT_DATA}" CACHE PATH
-   "Install path: SALOME script data")
+   "Install path: script data")
 SET(SALOME_INSTALL_SCRIPT_PYTHON "${SALOME_INSTALL_SCRIPT_PYTHON}" CACHE PATH
-   "Install path: SALOME Python scripts")
-SET(SALOME_INSTALL_PYTHON "${SALOME_INSTALL_PYTHON}" CACHE PATH "Install path: SALOME Python stuff")
-SET(SALOME_INSTALL_PYTHON_SHARED "${SALOME_INSTALL_PYTHON_SHARED}" CACHE PATH
-   "Install path: SALOME Python shared modules")
-SET(SALOME_INSTALL_CMAKE "${SALOME_INSTALL_CMAKE}" CACHE PATH "Install path: SALOME CMake files")
+   "Install path: Python modules")
+SET(SALOME_INSTALL_PYTHON "${SALOME_INSTALL_PYTHON}" CACHE PATH "Install path: Python stuff")
+SET(SALOME_INSTALL_CMAKE "${SALOME_INSTALL_CMAKE}" CACHE PATH "Install path: CMake files")
 SET(SALOME_INSTALL_CMAKE_LOCAL "${SALOME_INSTALL_CMAKE_LOCAL}" CACHE PATH
-    "Install path: local SALOME CMake files")
+    "Install path: local CMake files")
 SET(SALOME_INSTALL_AMCONFIG_LOCAL "${SALOME_INSTALL_AMCONFIG_LOCAL}" CACHE PATH
-  "Install path: local SALOME config files (obsolete, to be removed)")
+  "Install config files (obsolete, to be removed)")
 
-SET(SALOME_INSTALL_RES "${SALOME_INSTALL_RES}" CACHE PATH "Install path: SALOME resources")
-SET(SALOME_INSTALL_DOC "${SALOME_INSTALL_DOC}" CACHE PATH "Install path: SALOME documentation")
+SET(SALOME_INSTALL_RES "${SALOME_INSTALL_RES}" CACHE PATH "Install path: resources")
+SET(SALOME_INSTALL_DOC "${SALOME_INSTALL_DOC}" CACHE PATH "Install path: documentation")
 
 # Specific to GEOM:
 SET(SALOME_GEOM_INSTALL_RES_DATA "${SALOME_INSTALL_RES}/geom" CACHE PATH
@@ -191,15 +189,14 @@ SET(SALOME_GEOM_INSTALL_PLUGINS share/salome/plugins/geom CACHE PATH
 
 MARK_AS_ADVANCED(SALOME_INSTALL_BINS SALOME_INSTALL_LIBS SALOME_INSTALL_IDLS SALOME_INSTALL_HEADERS)
 MARK_AS_ADVANCED(SALOME_INSTALL_SCRIPT_SCRIPTS SALOME_INSTALL_SCRIPT_DATA SALOME_INSTALL_SCRIPT_PYTHON)
-MARK_AS_ADVANCED(SALOME_INSTALL_APPLISKEL_SCRIPTS  SALOME_INSTALL_APPLISKEL_PYTHON SALOME_INSTALL_CMAKE SALOME_INSTALL_CMAKE_LOCAL SALOME_INSTALL_RES)
-MARK_AS_ADVANCED(SALOME_INSTALL_PYTHON SALOME_INSTALL_PYTHON_SHARED)
+MARK_AS_ADVANCED(SALOME_INSTALL_CMAKE SALOME_INSTALL_CMAKE_LOCAL SALOME_INSTALL_RES)
+MARK_AS_ADVANCED(SALOME_INSTALL_PYTHON)
 MARK_AS_ADVANCED(SALOME_GEOM_INSTALL_RES_DATA SALOME_GEOM_INSTALL_RES_SCRIPTS SALOME_GEOM_INSTALL_PLUGINS)
 MARK_AS_ADVANCED(SALOME_INSTALL_AMCONFIG_LOCAL SALOME_INSTALL_DOC)
 
 # Accumulate environment variables for GEOM module
 SALOME_ACCUMULATE_ENVIRONMENT(PYTHONPATH NOCHECK ${CMAKE_INSTALL_PREFIX}/${SALOME_INSTALL_BINS}
-                                                 ${CMAKE_INSTALL_PREFIX}/${SALOME_INSTALL_PYTHON}
-                                                 ${CMAKE_INSTALL_PREFIX}/${SALOME_INSTALL_PYTHON_SHARED})
+                                                 ${CMAKE_INSTALL_PREFIX}/${SALOME_INSTALL_PYTHON})
 SALOME_ACCUMULATE_ENVIRONMENT(LD_LIBRARY_PATH NOCHECK ${CMAKE_INSTALL_PREFIX}/${SALOME_INSTALL_LIBS})
 
 # Sources
@@ -210,9 +207,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)
 
 # Header configuration
 # ====================
@@ -308,7 +303,9 @@ INSTALL(FILES
 INSTALL(EXPORT ${PROJECT_NAME}TargetGroup DESTINATION "${SALOME_INSTALL_CMAKE_LOCAL}"
         FILE ${PROJECT_NAME}Targets.cmake)
 
-# Application tests
-INSTALL(FILES CTestTestfileInstall.cmake
-  DESTINATION ${SALOME_INSTALL_SCRIPT_SCRIPTS}/test
-  RENAME CTestTestfile.cmake)
+IF(SALOME_BUILD_TESTS)
+  # Application tests
+  INSTALL(FILES CTestTestfileInstall.cmake
+          DESTINATION ${SALOME_INSTALL_SCRIPT_SCRIPTS}/test
+          RENAME CTestTestfile.cmake)
+ENDIF()
index c5f9b6f6b6d004790541d172e609659cde9b63cb..f878377e86185fad1019d99798bafe89e75c884e 100644 (file)
@@ -24,3 +24,4 @@ SET(TIMEOUT        300)
 
 SUBDIRS(examples)
 SUBDIRS(xao)
+SUBDIRS(t_shape)
\ No newline at end of file
index 0f61a30240b5b5aacf0e2faea2ccbd7f385d44fa..59d224086173c88cf55eca5b64bb56d170b5c746 100644 (file)
@@ -116,7 +116,6 @@ SET(SALOME_INSTALL_SCRIPT_PYTHON "@SALOME_INSTALL_SCRIPT_PYTHON@")
 SET(SALOME_INSTALL_CMAKE "@SALOME_INSTALL_CMAKE@")
 SET(SALOME_INSTALL_CMAKE_LOCAL "@SALOME_INSTALL_CMAKE_LOCAL@")
 SET(SALOME_INSTALL_PYTHON "@SALOME_INSTALL_PYTHON@")
-SET(SALOME_INSTALL_PYTHON_SHARED "@SALOME_INSTALL_PYTHON_SHARED@")
 SET(SALOME_INSTALL_RES "@SALOME_INSTALL_RES@")
 SET(SALOME_INSTALL_DOC "@SALOME_INSTALL_DOC@")
 SET(SALOME_INSTALL_AMCONFIG_LOCAL "@SALOME_INSTALL_AMCONFIG_LOCAL@")
index ccc73ba4384b37f64592ae007abef8d8d603d95a..95a1b4ed819112177290a68c1a6400772f319d0d 100644 (file)
@@ -20,6 +20,8 @@
 # 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()
index e84dd2c4bf019734e8720cd84e0c181ec6d586db..19857eb8b9ce37f97d8439d10336e863f8079eb5 100644 (file)
 
 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(GEOM_JOIN_TESTS)
-  ADD_TEST(NAME GEOM_examples COMMAND ${PYTHON_EXECUTABLE} -B ${CMAKE_SOURCE_DIR}/doc/salome/examples/testme.py tests.py)
-ELSE(GEOM_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(GEOM_JOIN_TESTS)
-
-# install Python scripts
+SET(EXAMPLES_TESTS ${BAD_TESTS} ${GOOD_TESTS})
 SALOME_INSTALL_SCRIPTS("${EXAMPLES_TESTS}" ${SALOME_INSTALL_DOC}/examples/GEOM)
 
-# 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(GEOM_JOIN_TESTS)
+    ADD_TEST(NAME all_examples COMMAND ${PYTHON_EXECUTABLE} -B ${TEST_HELPER} tests.py)
+  ELSE(GEOM_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(GEOM_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/examples)
-INSTALL(FILES ${GOOD_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)
index 47801265a9ca48ce28f21c5aeca651a6fc228f7a..dc60e4810963fc4b2532528d71239ffd5249c2a7 100644 (file)
 # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 #
 
+SET(TESTS_DIR "$ENV{GEOM_ROOT_DIR}/@SALOME_INSTALL_DOC@/examples/GEOM")
+
 INCLUDE(tests.set)
 
 FOREACH(tfile ${GOOD_TESTS})
   GET_FILENAME_COMPONENT(BASE_NAME ${tfile} NAME_WE)
   SET(TEST_NAME GEOM_${BASE_NAME})
-  ADD_TEST(${TEST_NAME} python ${SALOME_TEST_DRIVER} ${TIMEOUT} ${tfile})
+  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/GEOM_Field.py b/doc/salome/examples/GEOM_Field.py
deleted file mode 100644 (file)
index 537e21e..0000000
+++ /dev/null
@@ -1,56 +0,0 @@
-# Geom Field
-
-import salome
-salome.salome_init()
-import GEOM
-from salome.geom import geomBuilder
-geompy = geomBuilder.New()
-gg = salome.ImportComponentGUI("GEOM")
-
-# a box
-shape = geompy.MakeBoxDXDYDZ( 1, 1, 1, theName="box")
-
-# Create fields holding sub-shape IDs as strings,
-# which can be useful to see sub-shape IDs in the Viewer
-
-componentNames = ['ID']
-fieldDataType = GEOM.FDT_String
-stepID = 0
-stamp = 0
-
-dim = 0 # == vertices
-values = [str(i) for i in geompy.SubShapeAllIDs( shape, geompy.ShapeType["VERTEX"] )]
-f0 = geompy.CreateField( shape, "vertices", fieldDataType, dim, componentNames )
-s0 = f0.addStep( stepID, stamp, values )
-geompy.addToStudyInFather( shape, f0, f0.GetName() )
-s0id = geompy.addToStudyInFather( f0, s0, s0.GetName() )
-
-dim = 1 # == edges
-values = [str(i) for i in geompy.SubShapeAllIDs( shape, geompy.ShapeType["EDGE"] )]
-f1 = geompy.CreateField( shape, "edges", fieldDataType, dim, componentNames )
-s1 = f1.addStep( stepID, stamp, values )
-geompy.addToStudyInFather( shape, f1, f1.GetName() )
-geompy.addToStudyInFather( f1, s1, s1.GetName() )
-
-dim = 2 # == faces
-values = [str(i) for i in geompy.SubShapeAllIDs( shape, geompy.ShapeType["FACE"] )]
-f2 = geompy.CreateField( shape, "faces", fieldDataType, dim, componentNames )
-s2 = f2.addStep( stepID, stamp, values )
-geompy.addToStudyInFather( shape, f2, f2.GetName() )
-geompy.addToStudyInFather( f2, s2, s2.GetName() )
-
-dim = 3 # == solids
-values = [str(i) for i in geompy.SubShapeAllIDs( shape, geompy.ShapeType["SOLID"] )]
-f3 = geompy.CreateField( shape, "solids", fieldDataType, dim, componentNames )
-s3 = f3.addStep( stepID, stamp, values )
-geompy.addToStudyInFather( shape, f3, f3.GetName() )
-geompy.addToStudyInFather( f3, s3, s3.GetName() )
-
-dim = -1 # == whole shape
-f_1 = geompy.CreateField( shape, "whole shape", fieldDataType, dim, componentNames )
-s_1 = f_1.addStep(stepID, stamp, ["1"])
-geompy.addToStudyInFather( shape, f_1, f_1.GetName() )
-geompy.addToStudyInFather( f_1, s_1, s_1.GetName() )
-
-# display
-gg.createAndDisplayGO( s0id )
diff --git a/doc/salome/examples/GEOM_box.py b/doc/salome/examples/GEOM_box.py
deleted file mode 100644 (file)
index b697e6f..0000000
+++ /dev/null
@@ -1,16 +0,0 @@
-# --- salome initialization
-import salome
-salome.salome_init()
-
-# --- geom Python interface
-import GEOM
-from salome.geom import geomBuilder
-geompy = geomBuilder.New()
-
-# --- Create a box and publish it into the salome study
-Box_1 = geompy.MakeBoxDXDYDZ(200, 200, 200)
-geompy.addToStudy( Box_1, 'Box_1' )
-
-# --- update the study object browser
-if salome.sg.hasDesktop():
-  salome.sg.updateObjBrowser()
diff --git a/doc/salome/examples/box.py b/doc/salome/examples/box.py
new file mode 100644 (file)
index 0000000..b697e6f
--- /dev/null
@@ -0,0 +1,16 @@
+# --- salome initialization
+import salome
+salome.salome_init()
+
+# --- geom Python interface
+import GEOM
+from salome.geom import geomBuilder
+geompy = geomBuilder.New()
+
+# --- Create a box and publish it into the salome study
+Box_1 = geompy.MakeBoxDXDYDZ(200, 200, 200)
+geompy.addToStudy( Box_1, 'Box_1' )
+
+# --- update the study object browser
+if salome.sg.hasDesktop():
+  salome.sg.updateObjBrowser()
diff --git a/doc/salome/examples/field.py b/doc/salome/examples/field.py
new file mode 100644 (file)
index 0000000..537e21e
--- /dev/null
@@ -0,0 +1,56 @@
+# Geom Field
+
+import salome
+salome.salome_init()
+import GEOM
+from salome.geom import geomBuilder
+geompy = geomBuilder.New()
+gg = salome.ImportComponentGUI("GEOM")
+
+# a box
+shape = geompy.MakeBoxDXDYDZ( 1, 1, 1, theName="box")
+
+# Create fields holding sub-shape IDs as strings,
+# which can be useful to see sub-shape IDs in the Viewer
+
+componentNames = ['ID']
+fieldDataType = GEOM.FDT_String
+stepID = 0
+stamp = 0
+
+dim = 0 # == vertices
+values = [str(i) for i in geompy.SubShapeAllIDs( shape, geompy.ShapeType["VERTEX"] )]
+f0 = geompy.CreateField( shape, "vertices", fieldDataType, dim, componentNames )
+s0 = f0.addStep( stepID, stamp, values )
+geompy.addToStudyInFather( shape, f0, f0.GetName() )
+s0id = geompy.addToStudyInFather( f0, s0, s0.GetName() )
+
+dim = 1 # == edges
+values = [str(i) for i in geompy.SubShapeAllIDs( shape, geompy.ShapeType["EDGE"] )]
+f1 = geompy.CreateField( shape, "edges", fieldDataType, dim, componentNames )
+s1 = f1.addStep( stepID, stamp, values )
+geompy.addToStudyInFather( shape, f1, f1.GetName() )
+geompy.addToStudyInFather( f1, s1, s1.GetName() )
+
+dim = 2 # == faces
+values = [str(i) for i in geompy.SubShapeAllIDs( shape, geompy.ShapeType["FACE"] )]
+f2 = geompy.CreateField( shape, "faces", fieldDataType, dim, componentNames )
+s2 = f2.addStep( stepID, stamp, values )
+geompy.addToStudyInFather( shape, f2, f2.GetName() )
+geompy.addToStudyInFather( f2, s2, s2.GetName() )
+
+dim = 3 # == solids
+values = [str(i) for i in geompy.SubShapeAllIDs( shape, geompy.ShapeType["SOLID"] )]
+f3 = geompy.CreateField( shape, "solids", fieldDataType, dim, componentNames )
+s3 = f3.addStep( stepID, stamp, values )
+geompy.addToStudyInFather( shape, f3, f3.GetName() )
+geompy.addToStudyInFather( f3, s3, s3.GetName() )
+
+dim = -1 # == whole shape
+f_1 = geompy.CreateField( shape, "whole shape", fieldDataType, dim, componentNames )
+s_1 = f_1.addStep(stepID, stamp, ["1"])
+geompy.addToStudyInFather( shape, f_1, f_1.GetName() )
+geompy.addToStudyInFather( f_1, s_1, s_1.GetName() )
+
+# display
+gg.createAndDisplayGO( s0id )
diff --git a/doc/salome/examples/testme.py b/doc/salome/examples/testme.py
deleted file mode 100755 (executable)
index e5f71fb..0000000
+++ /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"]
-        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])
index a43ed7a6a77477fce296a3db26e6545684c55778..4a0add9c044196471cc5e0c9e8fd2075c951f3b0 100644 (file)
@@ -26,6 +26,7 @@ SET(GOOD_TESTS
   advanced_geom_objs_ex01.py
   advanced_geom_objs_ex02.py
   advanced_geom_objs_ex03.py
+  advanced_geom_objs_smoothingsurface.py
   angle.py
   arranging_study_objects.py
   basic_geom_objs_ex01.py
@@ -51,11 +52,13 @@ SET(GOOD_TESTS
   boolean_operations_ex03.py
   boolean_operations_ex04.py
   bounding_box.py
+  box.py
   building_by_blocks_ex01.py
   building_by_blocks_ex02.py
   center_of_mass.py
   check_compound_of_blocks.py
   check_self_intersections.py
+  check_self_intersections_fast.py
   check_shape.py
   complex_objs_ex01.py
   complex_objs_ex02.py
@@ -69,17 +72,17 @@ SET(GOOD_TESTS
   complex_objs_ex10.py
   complex_objs_ex11.py
   fast_intersection.py
+  field.py
   free_boundaries.py
   free_faces.py
-  GEOM_box.py
   get_non_blocks.py
   import_export.py
   inertia.py
   min_distance.py
   normal_face.py
   notebook_geom.py
-  polyline.py
   point_coordinates.py
+  polyline.py
   primitives_ex01.py
   primitives_ex02.py
   primitives_ex03.py
@@ -106,6 +109,7 @@ SET(GOOD_TESTS
   topological_geom_objs_ex04.py
   topological_geom_objs_ex05.py
   topological_geom_objs_ex06.py
+  topological_geom_objs_ex07.py
   transformation_operations_ex01.py
   transformation_operations_ex02.py
   transformation_operations_ex03.py
@@ -131,8 +135,4 @@ SET(GOOD_TESTS
   working_with_groups_ex04.py
   working_with_groups_ex05.py
   working_with_groups_ex06.py
-  GEOM_Field.py
-  check_self_intersections_fast.py # OCC > 6.9.0
 )
-
-SET(EXAMPLES_TESTS ${BAD_TESTS} ${GOOD_TESTS} testme.py)
index e6af9a43a5b74128cdac4b8a80427994b0e8b45d..58e031801f47ef7f2793c89ace4ef948981107a8 100644 (file)
@@ -16,7 +16,7 @@ linear documentation for geomBuilder.py</a>
 \n
 \anchor tui_sample_geom_script
 <br><h2>GEOM Python script example</h2>
-\tui_script{GEOM_box.py}
+\tui_script{box.py}
 
 \n By the links below you can find sample scripts for all operations
 provided by Geometry module.
index 79598bfabf5183651f74c43c6c5f65af1925ca8e..d8f4d3116a5378cb69f92552ea22b92845f846e3 100644 (file)
@@ -1,6 +1,6 @@
 /*!
 
 \page tui_geom_field_page Geometrical Fields
-\tui_script{GEOM_Field.py}
+\tui_script{field.py}
 
 */
index 4eaec40275ec9e8e0717db7f2ff26873b055b0ff..14bdf2c0b64a2921a88d0c68923fdbffeb7f7178 100644 (file)
@@ -114,14 +114,9 @@ SET(_python_VTK_SCRIPTS
 
 # scripts / shared
 
-SET(_shared_SCRIPTS
-  GEOM_shared_modules.py
-  )
-
 # --- rules ---
 
 SALOME_INSTALL_SCRIPTS("${_other_SCRIPTS}" ${SALOME_INSTALL_SCRIPT_DATA} DEF_PERMS)
-SALOME_INSTALL_SCRIPTS("${_shared_SCRIPTS}" ${SALOME_INSTALL_PYTHON_SHARED} DEF_PERMS)
 SALOME_INSTALL_SCRIPTS("${_python_SCRIPTS}" ${SALOME_INSTALL_PYTHON}/salome/geom DEF_PERMS)
 
 # Install plugin scripts
diff --git a/src/GEOM_SWIG/GEOM_shared_modules.py b/src/GEOM_SWIG/GEOM_shared_modules.py
deleted file mode 100644 (file)
index e2ccd8c..0000000
+++ /dev/null
@@ -1,44 +0,0 @@
-#  -*- coding: iso-8859-1 -*-
-# Copyright (C) 2007-2020  CEA/DEN, EDF R&D, OPEN CASCADE
-#
-# Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-#
-# 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
-#
-
-"""
-
-"""
-
-# force GEOM importation at interpretor initialization
-# see salome_shared_modules.py
-# (avoids incomplete import at run time)
-
-from launchConfigureParser import verbose
-
-if verbose(): print("============== import GEOM =======================")
-
-import GEOM
-
-# this function is required
-
-def init_shared_modules():
-   """
-      This function initializes shared modules that need to be
-   """
-   pass
index 9a81deab2250b45bf16b2e5ea6179fa3be732359..23df8088e663ae5254d30a445df62e681f35388d 100644 (file)
@@ -57,3 +57,17 @@ IF(SALOME_BUILD_GUI)
   # to avoid races problems when compiling in parallel
   ADD_DEPENDENCIES(${_target_name_pyuic_py} ${_target_name_pyuic})
 ENDIF()
+
+IF(SALOME_BUILD_TESTS)
+  SET(TEST_HELPER ${KERNEL_ROOT_DIR}/bin/salome/test_helper.py)
+  SALOME_GENERATE_TESTS_ENVIRONMENT(tests_env)
+  ADD_TEST(NAME t_shape_builder
+           COMMAND ${PYTHON_EXECUTABLE} -B ${TEST_HELPER} ${CMAKE_CURRENT_SOURCE_DIR}/test_t_shape_builder.py)
+
+  SET(TEST_INSTALL_DIRECTORY ${SALOME_INSTALL_SCRIPT_SCRIPTS}/test/t_shape)
+  INSTALL(FILES test_t_shape_builder.py DESTINATION ${TEST_INSTALL_DIRECTORY})
+
+  INSTALL(FILES CTestTestfileInstall.cmake
+          DESTINATION ${TEST_INSTALL_DIRECTORY}
+          RENAME CTestTestfile.cmake)
+ENDIF()
diff --git a/src/Tools/t_shape/CTestTestfileInstall.cmake b/src/Tools/t_shape/CTestTestfileInstall.cmake
new file mode 100644 (file)
index 0000000..40dbf68
--- /dev/null
@@ -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
+#
+
+SET(TESTS test_t_shape_builder.py)
+
+FOREACH(tfile ${TESTS})
+  GET_FILENAME_COMPONENT(BASE_NAME ${tfile} NAME_WE)
+  SET(TEST_NAME GEOM_${BASE_NAME})
+  ADD_TEST(${TEST_NAME} python ${SALOME_TEST_DRIVER} 1000 ${tfile})
+  SET_TESTS_PROPERTIES(${TEST_NAME} PROPERTIES LABELS "${COMPONENT_NAME}")
+ENDFOREACH()
index cd6c611669441d5ff393c16b927393a106e5ba11..b44ffb74c35e1a221981369010633de53cdb0787 100644 (file)
@@ -381,23 +381,3 @@ def jonction(r1, r2, h1, h2, a1):
   faci.append(geompy.MakeFaceWires([ed90[3], ed90[7],  ed90[4], lord90[2]], 0))
  
   return faci, sect45, arc1, l1, lord90, lord45, edges, arcextru
-
-def test_t_shape_builder():
-  """For testing purpose"""
-  salome.salome_init()
-  geompy = geomBuilder.New()
-  for r1 in [1., 100.]:
-    for r2 in [0.9*r1, 0.5*r1, 0.1*r1, 0.05*r1]:
-      for thickness in [r1/100., r1/10., r1/2.]:
-        print(r1, r2, thickness)
-        h1 = r1 * 2.0
-        h2 = h1
-        try:
-          res = build_shape(r1, r2, h1, h2, thickness)
-          geompy.addToStudy(res, "res_%f_%f_%f"%(r1,r2, thickness))
-        except:
-          print("problem with res_%f_%f_%f"%(r1,r2, thickness))
-  
-if __name__=="__main__":
-  """For testing purpose"""
-  test_t_shape_builder()
diff --git a/src/Tools/t_shape/test_t_shape_builder.py b/src/Tools/t_shape/test_t_shape_builder.py
new file mode 100644 (file)
index 0000000..1ce36c1
--- /dev/null
@@ -0,0 +1,23 @@
+import salome
+salome.salome_init()
+
+from salome.geom import geomBuilder
+geompy = geomBuilder.New()
+
+from salome.geom.t_shape.t_shape_builder import build_shape
+num_errors = 0
+
+for r1 in [1., 100.]:
+    for r2 in [0.9*r1, 0.5*r1, 0.1*r1, 0.05*r1]:
+        for thickness in [r1/100., r1/10., r1/2.]:
+            print(r1, r2, thickness)
+            h1 = r1 * 2.0
+            h2 = h1
+            try:
+                res = build_shape(r1, r2, h1, h2, thickness)
+                geompy.addToStudy(res, "res_%f_%f_%f"%(r1, r2, thickness))
+            except:
+                print("problem with res_%f_%f_%f"%(r1, r2, thickness))
+                num_errors += 1
+if num_errors > 0:
+    raise RuntimeError("Error: 1 or more test cases failed!")
index d6c14f782ddc75082eb14941c2d60e8ff6344189..4ce6ec83d830df3ee2a93dab715dd93f1a93abc1 100644 (file)
@@ -17,8 +17,6 @@
 # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 #
 
-ADD_SUBDIRECTORY(data)
-
 # additional include directories
 INCLUDE_DIRECTORIES(
   ${PTHREAD_INCLUDE_DIR}
@@ -53,20 +51,19 @@ SET(TestXAO_SOURCES
 
 # --- rules ---
 
+SET(TEST_INSTALL_DIRECTORY ${SALOME_INSTALL_SCRIPT_SCRIPTS}/test/xao)
+
 ADD_EXECUTABLE(TestXAO ${TestXAO_SOURCES})
 TARGET_LINK_LIBRARIES(TestXAO ${_link_LIBRARIES})
 
 SALOME_GENERATE_TESTS_ENVIRONMENT(tests_env)
-SET(TEST_INSTALL_DIRECTORY ${SALOME_INSTALL_SCRIPT_SCRIPTS}/test/xao)
-
 ADD_TEST(TestXAO TestXAO)
 SET_TESTS_PROPERTIES(TestXAO PROPERTIES ENVIRONMENT "XAO_DATA_DIR=${CMAKE_CURRENT_SOURCE_DIR}/data;${tests_env}")
 
-INSTALL(TARGETS TestXAO DESTINATION ${SALOME_INSTALL_BINS})
-
 # Application tests
 
 INSTALL(TARGETS TestXAO RUNTIME DESTINATION ${TEST_INSTALL_DIRECTORY})
+INSTALL(DIRECTORY data DESTINATION ${TEST_INSTALL_DIRECTORY})
 
 INSTALL(FILES CTestTestfileInstall.cmake
         DESTINATION ${TEST_INSTALL_DIRECTORY}
diff --git a/src/XAO/tests/data/CMakeLists.txt b/src/XAO/tests/data/CMakeLists.txt
deleted file mode 100644 (file)
index d4d9e9f..0000000
+++ /dev/null
@@ -1,29 +0,0 @@
-# Copyright (C) 2012-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(XAO_DATA_FILES
-    Box_1.brep
-    Box_2.brep
-    Cut_2.brep
-    test.xao
-  )
-
-# --- rules ---
-SET(XAO_DATA_DIR ${SALOME_INSTALL_SCRIPT_SCRIPTS}/test/xao/data)
-INSTALL(FILES ${XAO_DATA_FILES} DESTINATION ${XAO_DATA_DIR})