From 79c9b7de99f1732ccde29ecefbeb8218e40cc5f0 Mon Sep 17 00:00:00 2001 From: Anthony Geay Date: Wed, 10 Mar 2021 11:31:13 +0100 Subject: [PATCH] 100 tests of FiltersPlugin in salome test mechanism --- src/CTestTestfileInstall.cmake | 1 + src/FiltersPlugin/CMakeLists.txt | 122 +++---------------- src/FiltersPlugin/CTestTestfileInstall.cmake | 26 ++++ src/FiltersPlugin/tests.set | 121 ++++++++++++++++++ 4 files changed, 168 insertions(+), 102 deletions(-) create mode 100644 src/FiltersPlugin/CTestTestfileInstall.cmake create mode 100644 src/FiltersPlugin/tests.set diff --git a/src/CTestTestfileInstall.cmake b/src/CTestTestfileInstall.cmake index c09ba1ab9..b2620f5ce 100644 --- a/src/CTestTestfileInstall.cmake +++ b/src/CTestTestfileInstall.cmake @@ -29,4 +29,5 @@ SUBDIRS(ConnectorAPI ConstructionPlugin SketchPlugin ModelAPI + FiltersPlugin ) diff --git a/src/FiltersPlugin/CMakeLists.txt b/src/FiltersPlugin/CMakeLists.txt index 1c9bca592..7a847641f 100644 --- a/src/FiltersPlugin/CMakeLists.txt +++ b/src/FiltersPlugin/CMakeLists.txt @@ -107,106 +107,24 @@ INSTALL(FILES ${XML_RESOURCES} DESTINATION ${SHAPER_INSTALL_XML_RESOURCES}) INSTALL(FILES ${PROJECT_PYFILES} DESTINATION ${SHAPER_INSTALL_ADDONS}) INSTALL(FILES ${TEXT_RESOURCES} DESTINATION ${SHAPER_INSTALL_XML_RESOURCES}) +include(tests.set) + +ADD_UNIT_TESTS(${TEST_NAMES}) + +if(${HAVE_SALOME}) + enable_testing() + set(TEST_INSTALL_DIRECTORY "${SALOME_SHAPER_INSTALL_TESTS}/FiltersPlugin") + + install(FILES CTestTestfileInstall.cmake + DESTINATION ${TEST_INSTALL_DIRECTORY} + RENAME CTestTestfile.cmake) + install(FILES tests.set DESTINATION ${TEST_INSTALL_DIRECTORY}) + + set(TMP_TESTS_NAMES) + foreach(tfile ${TEST_NAMES}) + list(APPEND TMP_TESTS_NAMES "Test/${tfile}") + endforeach(tfile ${TEST_NAMES}) + + install(FILES ${TMP_TESTS_NAMES} DESTINATION ${TEST_INSTALL_DIRECTORY}) +endif(${HAVE_SALOME}) -ADD_UNIT_TESTS( - TestFilters.py - TestFilters_Mixed1.py - TestFilters_Mixed2.py - TestFilters_Supported.py - TestFilters_Validator.py - TestFilters_Xml.py - TestFilters_FilterName.py - TestFilters_IsReversed.py - TestFilters_Remove.py - TestFilter_BelongsTo.py - TestFilter_BelongsTo_Exclude.py - TestFilter_OnPlane.py - TestFilter_OnPlane_Exclude.py - TestFilter_OnPlane_Multi.py - TestFilter_OnLine.py - TestFilter_OnLine_Exclude.py - TestFilter_OnLine_Multi.py - TestFilter_OnGeometry_Edge1.py - TestFilter_OnGeometry_Edge2.py - TestFilter_OnGeometry_Face1.py - TestFilter_OnGeometry_Face2.py - TestFilter_OnGeometry_Face3.py - TestFilter_OnGeometry_Face4.py - TestFilter_OnGeometry_Exclude_Edge1.py - TestFilter_OnGeometry_Exclude_Edge2.py - TestFilter_OnGeometry_Exclude_Face1.py - TestFilter_OnGeometry_Exclude_Face2.py - TestFilter_OnGeometry_Exclude_Face3.py - TestFilter_OnGeometry_Exclude_Face4.py - TestFilter_OnPlaneSide_Face.py - TestFilter_OnPlaneSide_Plane.py - TestFilter_OnPlaneSide_Exclude_Face.py - TestFilter_OnPlaneSide_Exclude_Plane.py - TestFilter_OnPlaneSide_Multi.py - TestFilter_OppositeToEdge.py - TestFilter_OppositeToEdge_Exclude.py - TestFilter_RelativeToSolid_In.py - TestFilter_RelativeToSolid_Out.py - TestFilter_RelativeToSolid_On.py - TestFilter_RelativeToSolid_NotOn.py - TestFilter_RelativeToSolid_InAndOn.py - TestFilter_RelativeToSolid_OutAndOn.py - TestFilter_RelativeToSolid_Exclude_In.py - TestFilter_RelativeToSolid_Exclude_Out.py - TestFilter_RelativeToSolid_Exclude_On.py - TestFilter_RelativeToSolid_Exclude_NotOn.py - TestFilter_RelativeToSolid_Exclude_InAndOn.py - TestFilter_RelativeToSolid_Exclude_OutAndOn.py - TestFilter_RelativeToSolid_Multi.py - TestFilter_ExternalFaces1.py - TestFilter_ExternalFaces2.py - TestFilter_ExternalFaces_Exclude1.py - TestFilter_ExternalFaces_Exclude2.py - TestFilter_HorizontalFaces.py - TestFilter_HorizontalFaces_Exclude.py - TestFilter_VerticalFaces.py - TestFilter_VerticalFaces_Exclude.py - TestFilter_TopoConnectedFaces_Vertex1.py - TestFilter_TopoConnectedFaces_Vertex2.py - TestFilter_TopoConnectedFaces_Vertex3.py - TestFilter_TopoConnectedFaces_Prop_Vertex1.py - TestFilter_TopoConnectedFaces_Prop_Vertex2.py - TestFilter_TopoConnectedFaces_Prop_Vertex3.py - TestFilter_TopoConnectedFaces_Edge1.py - TestFilter_TopoConnectedFaces_Edge2.py - TestFilter_TopoConnectedFaces_Edge3.py - TestFilter_TopoConnectedFaces_Prop_Edge1.py - TestFilter_TopoConnectedFaces_Prop_Edge2.py - TestFilter_TopoConnectedFaces_Prop_Edge3.py - TestFilter_TopoConnectedFaces_Face1.py - TestFilter_TopoConnectedFaces_Face2.py - TestFilter_TopoConnectedFaces_Face3.py - TestFilter_TopoConnectedFaces_Prop_Face1.py - TestFilter_TopoConnectedFaces_Prop_Face2.py - TestFilter_TopoConnectedFaces_Prop_Face3.py - TestFilter_TopoConnectedFaces_Exclude_Vertex1.py - TestFilter_TopoConnectedFaces_Exclude_Vertex2.py - TestFilter_TopoConnectedFaces_Exclude_Vertex3.py - TestFilter_TopoConnectedFaces_Prop_Exclude_Vertex1.py - TestFilter_TopoConnectedFaces_Prop_Exclude_Vertex2.py - TestFilter_TopoConnectedFaces_Prop_Exclude_Vertex3.py - TestFilter_TopoConnectedFaces_Exclude_Edge1.py - TestFilter_TopoConnectedFaces_Exclude_Edge2.py - TestFilter_TopoConnectedFaces_Exclude_Edge3.py - TestFilter_TopoConnectedFaces_Prop_Exclude_Edge1.py - TestFilter_TopoConnectedFaces_Prop_Exclude_Edge2.py - TestFilter_TopoConnectedFaces_Prop_Exclude_Edge3.py - TestFilter_TopoConnectedFaces_Exclude_Face1.py - TestFilter_TopoConnectedFaces_Exclude_Face2.py - TestFilter_TopoConnectedFaces_Exclude_Face3.py - TestFilter_TopoConnectedFaces_Prop_Exclude_Face1.py - TestFilter_TopoConnectedFaces_Prop_Exclude_Face2.py - TestFilter_TopoConnectedFaces_Prop_Exclude_Face3.py - TestFilter_TopoConnectedFaces_Multi.py - Test2946.py - Test2951.py - Test3241.py - Test17924.py - Test17962.py - Test19190.py -) diff --git a/src/FiltersPlugin/CTestTestfileInstall.cmake b/src/FiltersPlugin/CTestTestfileInstall.cmake new file mode 100644 index 000000000..ceaee95f9 --- /dev/null +++ b/src/FiltersPlugin/CTestTestfileInstall.cmake @@ -0,0 +1,26 @@ +# Copyright (C) 2021 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 +# + +include(tests.set) + +foreach(tfile ${TEST_NAMES}) + set(TEST_NAME ${COMPONENT_NAME}_${tfile}) + add_test(${TEST_NAME} python ${tfile}) + set_tests_properties(${TEST_NAME} PROPERTIES LABELS "${SALOME_TEST_LABEL_ADV}") +endforeach() diff --git a/src/FiltersPlugin/tests.set b/src/FiltersPlugin/tests.set new file mode 100644 index 000000000..722601d08 --- /dev/null +++ b/src/FiltersPlugin/tests.set @@ -0,0 +1,121 @@ +# Copyright (C) 2021 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 + TestFilters.py + TestFilters_Mixed1.py + TestFilters_Mixed2.py + TestFilters_Supported.py + TestFilters_Validator.py + TestFilters_Xml.py + TestFilters_FilterName.py + TestFilters_IsReversed.py + TestFilters_Remove.py + TestFilter_BelongsTo.py + TestFilter_BelongsTo_Exclude.py + TestFilter_OnPlane.py + TestFilter_OnPlane_Exclude.py + TestFilter_OnPlane_Multi.py + TestFilter_OnLine.py + TestFilter_OnLine_Exclude.py + TestFilter_OnLine_Multi.py + TestFilter_OnGeometry_Edge1.py + TestFilter_OnGeometry_Edge2.py + TestFilter_OnGeometry_Face1.py + TestFilter_OnGeometry_Face2.py + TestFilter_OnGeometry_Face3.py + TestFilter_OnGeometry_Face4.py + TestFilter_OnGeometry_Exclude_Edge1.py + TestFilter_OnGeometry_Exclude_Edge2.py + TestFilter_OnGeometry_Exclude_Face1.py + TestFilter_OnGeometry_Exclude_Face2.py + TestFilter_OnGeometry_Exclude_Face3.py + TestFilter_OnGeometry_Exclude_Face4.py + TestFilter_OnPlaneSide_Face.py + TestFilter_OnPlaneSide_Plane.py + TestFilter_OnPlaneSide_Exclude_Face.py + TestFilter_OnPlaneSide_Exclude_Plane.py + TestFilter_OnPlaneSide_Multi.py + TestFilter_OppositeToEdge.py + TestFilter_OppositeToEdge_Exclude.py + TestFilter_RelativeToSolid_In.py + TestFilter_RelativeToSolid_Out.py + TestFilter_RelativeToSolid_On.py + TestFilter_RelativeToSolid_NotOn.py + TestFilter_RelativeToSolid_InAndOn.py + TestFilter_RelativeToSolid_OutAndOn.py + TestFilter_RelativeToSolid_Exclude_In.py + TestFilter_RelativeToSolid_Exclude_Out.py + TestFilter_RelativeToSolid_Exclude_On.py + TestFilter_RelativeToSolid_Exclude_NotOn.py + TestFilter_RelativeToSolid_Exclude_InAndOn.py + TestFilter_RelativeToSolid_Exclude_OutAndOn.py + TestFilter_RelativeToSolid_Multi.py + TestFilter_ExternalFaces1.py + TestFilter_ExternalFaces2.py + TestFilter_ExternalFaces_Exclude1.py + TestFilter_ExternalFaces_Exclude2.py + TestFilter_HorizontalFaces.py + TestFilter_HorizontalFaces_Exclude.py + TestFilter_VerticalFaces.py + TestFilter_VerticalFaces_Exclude.py + TestFilter_TopoConnectedFaces_Vertex1.py + TestFilter_TopoConnectedFaces_Vertex2.py + TestFilter_TopoConnectedFaces_Vertex3.py + TestFilter_TopoConnectedFaces_Prop_Vertex1.py + TestFilter_TopoConnectedFaces_Prop_Vertex2.py + TestFilter_TopoConnectedFaces_Prop_Vertex3.py + TestFilter_TopoConnectedFaces_Edge1.py + TestFilter_TopoConnectedFaces_Edge2.py + TestFilter_TopoConnectedFaces_Edge3.py + TestFilter_TopoConnectedFaces_Prop_Edge1.py + TestFilter_TopoConnectedFaces_Prop_Edge2.py + TestFilter_TopoConnectedFaces_Prop_Edge3.py + TestFilter_TopoConnectedFaces_Face1.py + TestFilter_TopoConnectedFaces_Face2.py + TestFilter_TopoConnectedFaces_Face3.py + TestFilter_TopoConnectedFaces_Prop_Face1.py + TestFilter_TopoConnectedFaces_Prop_Face2.py + TestFilter_TopoConnectedFaces_Prop_Face3.py + TestFilter_TopoConnectedFaces_Exclude_Vertex1.py + TestFilter_TopoConnectedFaces_Exclude_Vertex2.py + TestFilter_TopoConnectedFaces_Exclude_Vertex3.py + TestFilter_TopoConnectedFaces_Prop_Exclude_Vertex1.py + TestFilter_TopoConnectedFaces_Prop_Exclude_Vertex2.py + TestFilter_TopoConnectedFaces_Prop_Exclude_Vertex3.py + TestFilter_TopoConnectedFaces_Exclude_Edge1.py + TestFilter_TopoConnectedFaces_Exclude_Edge2.py + TestFilter_TopoConnectedFaces_Exclude_Edge3.py + TestFilter_TopoConnectedFaces_Prop_Exclude_Edge1.py + TestFilter_TopoConnectedFaces_Prop_Exclude_Edge2.py + TestFilter_TopoConnectedFaces_Prop_Exclude_Edge3.py + TestFilter_TopoConnectedFaces_Exclude_Face1.py + TestFilter_TopoConnectedFaces_Exclude_Face2.py + TestFilter_TopoConnectedFaces_Exclude_Face3.py + TestFilter_TopoConnectedFaces_Prop_Exclude_Face1.py + TestFilter_TopoConnectedFaces_Prop_Exclude_Face2.py + TestFilter_TopoConnectedFaces_Prop_Exclude_Face3.py + TestFilter_TopoConnectedFaces_Multi.py + Test2946.py + Test2951.py + Test3241.py + Test17924.py + Test17962.py + Test19190.py +) -- 2.39.2