diff --git a/src/Mod/Start/CMakeLists.txt b/src/Mod/Start/CMakeLists.txt index 4f4cb9939c..13088ebda2 100644 --- a/src/Mod/Start/CMakeLists.txt +++ b/src/Mod/Start/CMakeLists.txt @@ -2,6 +2,7 @@ add_subdirectory(App) set(Start_Scripts Init.py + TestStartGui.py ) if(BUILD_GUI) @@ -11,18 +12,40 @@ if(BUILD_GUI) add_subdirectory(StartPage) endif(BUILD_GUI) +set(Start_Tests + TestStart/__init__.py + TestStart/TestStartPage.py) + +set(Start_Test_Files + ${Start_Tests} + ${Start_Scripts}) + add_custom_target(StartScripts ALL SOURCES ${Start_Scripts} ) +add_custom_target(StartTests ALL + SOURCES ${Start_Test_Files} +) + fc_target_copy_resource(StartScripts ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_BINARY_DIR}/Mod/Start ${Start_Scripts}) +fc_copy_sources(StartTests "${CMAKE_BINARY_DIR}/Mod/Start" ${Start_Test_Files}) + + INSTALL( FILES ${Start_Scripts} DESTINATION Mod/Start ) + +INSTALL( + FILES + ${Start_Tests} + DESTINATION + Mod/Start/testStart +) diff --git a/src/Mod/Start/InitGui.py b/src/Mod/Start/InitGui.py index 359f2ea576..f324325b7b 100644 --- a/src/Mod/Start/InitGui.py +++ b/src/Mod/Start/InitGui.py @@ -47,3 +47,5 @@ class StartWorkbench ( Workbench ): return "StartGui::Workbench" Gui.addWorkbench(StartWorkbench()) + +FreeCAD.__unit_test__ += [ "TestStartGui" ] diff --git a/src/Mod/Start/TestStart/TestStartPage.py b/src/Mod/Start/TestStart/TestStartPage.py new file mode 100644 index 0000000000..2fc1968bb9 --- /dev/null +++ b/src/Mod/Start/TestStart/TestStartPage.py @@ -0,0 +1,36 @@ +# -*- coding: utf-8 -*- +# *************************************************************************** +# * Copyright (c) 2021 Chris Hennes * +# * * +# * 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. * +# * * +# * This program 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 this program; if not, write to the Free Software * +# * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 * +# * USA * +# * * +# *************************************************************************** + +import unittest +import FreeCAD +import Start +from StartPage import StartPage +from html.parser import HTMLParser + +class TestStartPage(unittest.TestCase): + """Basic validation of the generated Start page.""" + + MODULE = 'TestStartPage' # file name without extension + + + def setUp(self): + pass diff --git a/src/Mod/Start/TestStart/__init__.py b/src/Mod/Start/TestStart/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/src/Mod/Start/TestStartGui.py b/src/Mod/Start/TestStartGui.py new file mode 100644 index 0000000000..03d957b10c --- /dev/null +++ b/src/Mod/Start/TestStartGui.py @@ -0,0 +1,29 @@ +# -*- coding: utf-8 -*- +# *************************************************************************** +# * Copyright (c) 2021 Chris Hennes * +# * * +# * 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. * +# * * +# * This program 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 this program; if not, write to the Free Software * +# * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 * +# * USA * +# * * +# *************************************************************************** + +import TestApp + +from TestStart.TestStartPage import TestStartPage + +# dummy usage to get flake8 and lgtm quiet +False if TestApp.__name__ else True +False if TestStartPage.__name__ else True