List all available test units, if none is selected.

From the command line (FreeCADCmd) only which not need the GUI.

A better description

Grammatically improvement

Use PrintMessage
This commit is contained in:
Benjamin Alterauge
2022-05-18 20:48:51 +02:00
committed by Uwe
parent a2623d0a29
commit 086547c490
2 changed files with 17 additions and 1 deletions

View File

@@ -63,6 +63,19 @@ def All():
return suite
def PrintAll():
# Registered tests
tests = FreeCAD.__unit_test__
suite = unittest.TestSuite()
FreeCAD.Console.PrintMessage("\nRegistered test units:\n\n")
for test in tests:
FreeCAD.Console.PrintMessage(("%s\n" % test))
FreeCAD.Console.PrintMessage("\nPlease choose one or use 0 for all\n")
return suite
def TestText(s):
s = unittest.defaultTestLoader.loadTestsFromName(s)