now each module registers its unit tests itself

This commit is contained in:
wmayer
2018-08-28 13:14:16 +02:00
parent b4a4154556
commit 1d11f742ca
18 changed files with 53 additions and 54 deletions

View File

@@ -2,7 +2,7 @@
# (c) 2001 Juergen Riegel
#***************************************************************************
#* (c) Juergen Riegel (juergen.riegel@web.de) 2002 *
#* (c) Juergen Riegel (juergen.riegel@web.de) 2002 *
#* *
#* This file is part of the FreeCAD CAx development system. *
#* *
@@ -13,14 +13,21 @@
#* 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 *
#* 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 Library General Public *
#* License along with FreeCAD; if not, write to the Free Software *
#* License along with FreeCAD; if not, write to the Free Software *
#* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 *
#* USA *
#* *
#* Juergen Riegel 2002 *
#***************************************************************************/
# Base system tests
FreeCAD.__unit_test__ += [ "BaseTests",
"UnitTests",
"Document",
"UnicodeTests",
"TestPythonSyntax" ]

View File

@@ -77,3 +77,9 @@ class TestWorkbench ( Workbench ):
self.appendMenu("Inventor View",list)
Gui.addWorkbench(TestWorkbench())
# Base system tests
FreeCAD.__unit_test__ += [ "Workbench",
"Menu",
"Menu.MenuDeleteCases",
"Menu.MenuCreateCases" ]

View File

@@ -54,35 +54,8 @@ def tryLoadingTest(testName):
return LoadFailed(testName)
def All():
# Base system tests
tests = [ "UnicodeTests",
"Document",
"UnitTests",
"BaseTests" ]
# Base system gui test
if (FreeCAD.GuiUp == 1):
tests += [ "Workbench",
"Menu" ]
# add the module tests
tests += [ "TestFem",
"MeshTestsApp",
"TestSketcherApp",
"TestPartApp",
"TestPartDesignApp",
"TestSpreadsheet",
"TestTechDrawApp",
"TestPathApp",
"TestPythonSyntax"]
# gui tests of modules
if (FreeCAD.GuiUp == 1):
tests += [ "TestSketcherGui",
"TestPartGui",
"TestPartDesignGui",
"TestDraft",
"TestArch" ]
# Registered tests
tests = FreeCAD.__unit_test__
suite = unittest.TestSuite()

View File

@@ -40,28 +40,12 @@ class TestCmd:
"""Opens a Qt dialog with all inserted unit tests"""
def Activated(self):
import QtUnitGui
tests = FreeCAD.__unit_test__
QtUnitGui.addTest("TestApp.All")
QtUnitGui.setTest("TestApp.All")
QtUnitGui.addTest("BaseTests")
QtUnitGui.addTest("UnitTests")
QtUnitGui.addTest("Document")
QtUnitGui.addTest("UnicodeTests")
QtUnitGui.addTest("MeshTestsApp")
QtUnitGui.addTest("TestFem")
QtUnitGui.addTest("TestSketcherApp")
QtUnitGui.addTest("TestPartApp")
QtUnitGui.addTest("TestPartDesignApp")
QtUnitGui.addTest("TestPartDesignGui")
QtUnitGui.addTest("TestPathApp")
QtUnitGui.addTest("TestSpreadsheet")
QtUnitGui.addTest("TestDraft")
QtUnitGui.addTest("TestArch")
QtUnitGui.addTest("TestTechDrawApp")
QtUnitGui.addTest("Workbench")
QtUnitGui.addTest("Menu")
QtUnitGui.addTest("Menu.MenuDeleteCases")
QtUnitGui.addTest("Menu.MenuCreateCases")
QtUnitGui.addTest("TestPythonSyntax")
for test in tests:
QtUnitGui.addTest(test)
def GetResources(self):
return {'MenuText': 'Self-test...', 'ToolTip': 'Runs a self-test to check if the application works properly'}