From f07231565634249b36dd3b3dde4e6eb98e8ee29b Mon Sep 17 00:00:00 2001 From: wandererfan Date: Mon, 21 Nov 2022 16:35:10 -0500 Subject: [PATCH] [TD]Separate test scripts which require QApplication --- src/Mod/TechDraw/CMakeLists.txt | 1 + src/Mod/TechDraw/InitGui.py | 3 +++ src/Mod/TechDraw/TestTechDrawApp.py | 5 ++--- src/Mod/TechDraw/TestTechDrawGui.py | 27 +++++++++++++++++++++++++++ 4 files changed, 33 insertions(+), 3 deletions(-) create mode 100644 src/Mod/TechDraw/TestTechDrawGui.py diff --git a/src/Mod/TechDraw/CMakeLists.txt b/src/Mod/TechDraw/CMakeLists.txt index 5aee9760e5..c1309e731f 100644 --- a/src/Mod/TechDraw/CMakeLists.txt +++ b/src/Mod/TechDraw/CMakeLists.txt @@ -9,6 +9,7 @@ endif(BUILD_GUI) set(TechDraw_Scripts Init.py TestTechDrawApp.py + TestTechDrawGui.py ) if(BUILD_GUI) diff --git a/src/Mod/TechDraw/InitGui.py b/src/Mod/TechDraw/InitGui.py index 4065e70180..3a5621e3ad 100644 --- a/src/Mod/TechDraw/InitGui.py +++ b/src/Mod/TechDraw/InitGui.py @@ -61,3 +61,6 @@ Gui.addWorkbench(TechDrawWorkbench()) # Append the export handler FreeCAD.addExportType("Technical Drawing (*.svg *.dxf *.pdf)", "TechDrawGui") + +FreeCAD.__unit_test__ += ["TestTechDrawGui"] + diff --git a/src/Mod/TechDraw/TestTechDrawApp.py b/src/Mod/TechDraw/TestTechDrawApp.py index 6cd69db1c6..da99918af1 100644 --- a/src/Mod/TechDraw/TestTechDrawApp.py +++ b/src/Mod/TechDraw/TestTechDrawApp.py @@ -20,13 +20,12 @@ # USA * # ************************************************************************** +#tests that do not require Gui from TDTest.DrawHatchTest import DrawHatchTest # noqa: F401 from TDTest.DrawViewAnnotationTest import DrawViewAnnotationTest # noqa: F401 from TDTest.DrawViewBalloonTest import DrawViewBalloonTest # noqa: F401 from TDTest.DrawViewDimensionTest import DrawViewDimensionTest # noqa: F401 from TDTest.DrawViewImageTest import DrawViewImageTest # noqa: F401 -from TDTest.DrawViewSectionTest import DrawViewSectionTest # noqa: F401 from TDTest.DrawViewSymbolTest import DrawViewSymbolTest # noqa: F401 -from TDTest.DrawViewPartTest import DrawViewPartTest # noqa: F401 from TDTest.DrawProjectionGroupTest import DrawProjectionGroupTest # noqa: F401 -from TDTest.DrawViewDetailTest import DrawViewDetailTest # noqa: F401 + diff --git a/src/Mod/TechDraw/TestTechDrawGui.py b/src/Mod/TechDraw/TestTechDrawGui.py new file mode 100644 index 0000000000..46e729f91d --- /dev/null +++ b/src/Mod/TechDraw/TestTechDrawGui.py @@ -0,0 +1,27 @@ +# ************************************************************************** +# Copyright (c) 2022 WandererFan * +# * +# This file is part of the FreeCAD CAx development system. * +# * +# This program is free software; you can redistribute it and/or modify * +# it under the terms of the GNU Lesser General Public License (LGPL) * +# as published by the Free Software Foundation; either version 2 of * +# the License, or (at your option) any later version. * +# for detail see the LICENCE text file. * +# * +# FreeCAD 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 Library General Public License for more details. * +# * +# You should have received a copy of the GNU Library General Public * +# License along with FreeCAD; if not, write to the Free Software * +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 * +# USA * +# ************************************************************************** + +#these tests require QApplication in order to process events while waiting for +#threads to complete +from TDTest.DrawViewSectionTest import DrawViewSectionTest # noqa: F401 +from TDTest.DrawViewPartTest import DrawViewPartTest # noqa: F401 +from TDTest.DrawViewDetailTest import DrawViewDetailTest # noqa: F401