SquishTests: Improve log messages of exceptions

...and make them more similar to Squish's own "Error" messages.

Change-Id: If5df701d4fa01fc1c1aea94cc9778a6a5dccc44e
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
Robert Löhning
2023-05-03 23:49:59 +02:00
parent b083a4d55e
commit 8d03220017
8 changed files with 13 additions and 13 deletions
+1 -1
View File
@@ -21,7 +21,7 @@ def toggleIssuesFilter(filterName, checked):
except:
t,v = sys.exc_info()[:2]
test.log("Exception while toggling filter '%s'" % filterName,
"%s(%s)" % (str(t), str(v)))
"%s: %s" % (t.__name__, str(v)))
def getBuildIssues(ignoreCodeModel=True):
+1 -1
View File
@@ -16,7 +16,7 @@ def startCreatorVerifyingClang(useClang):
if strv == "startApplication() failed":
test.fatal("%s. Creator built without ClangCodeModel?" % strv)
else:
test.fatal("Exception caught", "%s(%s)" % (str(t), strv))
test.fatal("Exception caught", "%s: %s" % (t.__name__, strv))
return False
if platform.system() not in ('Microsoft', 'Windows'): # only Win uses dialogs for this
return startedWithoutPluginError()
+2 -2
View File
@@ -67,7 +67,7 @@ def menuVisibleAtEditor(editor, menuInList):
return success
except:
t, v = sys.exc_info()[:2]
test.log("Exception: %s" % str(t), str(v))
test.log("Exception: %s" % t.__name__, str(v))
return False
# this function checks whether the given global point (QPoint)
@@ -413,7 +413,7 @@ def openDocument(treeElement):
return False
except:
t,v = sys.exc_info()[:2]
test.log("An exception occurred in openDocument(): %s(%s)" % (str(t), str(v)))
test.log("An exception occurred in openDocument(): %s: %s" % (t.__name__, str(v)))
return False
def earlyExit(details="No additional information"):
+1 -1
View File
@@ -30,7 +30,7 @@ def changeFilePermissions(dirPath, readPerm, writePerm, excludeFileNames=None):
os.chmod(filePath, permission)
except:
t,v = sys.exc_info()[:2]
test.log("Error: %s(%s)" % (str(t), str(v)))
test.log("%s: %s" % (t.__name__, str(v)))
result = False
return result
+2 -2
View File
@@ -120,7 +120,7 @@ def __handleBuildSystem__(buildSystem):
selectFromCombo(combo, buildSystem)
except:
t, v = sys.exc_info()[:2]
test.warning("Exception while handling build system", "%s(%s)" % (str(t), str(v)))
test.warning("Exception while handling build system", "%s: %s" % (t.__name__, str(v)))
clickButton(waitForObject(":Next_QPushButton"))
return buildSystem
@@ -131,7 +131,7 @@ def __createProjectHandleQtQuickSelection__(minimumQtVersion):
selectFromCombo(comboBox, minimumQtVersion)
except:
t,v = sys.exc_info()[:2]
test.fatal("Exception while trying to select Qt version", "%s (%s)" % (str(t), str(v)))
test.fatal("Exception while trying to select Qt version", "%s :%s" % (t.__name__, str(v)))
clickButton(waitForObject(":Next_QPushButton"))
return minimumQtVersion
+2 -2
View File
@@ -436,8 +436,8 @@ def iterateKits(clickOkWhenDone, alreadyOnOptionsDialog,
t, v, _ = sys.exc_info()
currResult = None
test.fatal("Function to additionally execute on Options Dialog could not be "
"found or an exception occurred while executing it.", "%s(%s)" %
(str(t), str(v)))
"found or an exception occurred while executing it.", "%s: %s" %
(t.__name__, str(v)))
additionalResult.append(currResult)
if clickOkWhenDone:
clickButton(waitForObject(":Options.OK_QPushButton"))
+1 -1
View File
@@ -41,7 +41,7 @@ def checkQtCreatorHelpVersion(expectedVersion):
'Verifying whether manual uses expected version.')
except:
t, v = sys.exc_info()[:2]
test.log("Exception caught", "%s(%s)" % (str(t), str(v)))
test.log("Exception caught", "%s: %s" % (t.__name__, str(v)))
test.fail("Missing Qt Creator Manual.")
@@ -34,8 +34,8 @@ def closeHTTPStatusAndPasterDialog(protocol, pasterDialog):
test.log("Closed dialog without expected error.", text)
except:
t,v = sys.exc_info()[:2]
test.warning("An exception occurred in closeHTTPStatusAndPasterDialog(): %s(%s)"
% (str(t), str(v)))
test.warning("An exception occurred in closeHTTPStatusAndPasterDialog(): %s: %s"
% (t.__name__, str(v)))
return False
def pasteFile(sourceFile, protocol):
@@ -167,7 +167,7 @@ def checkForMovedUrl(): # protocol may be redirected (HTTP status 30x) - check
test.fail("URL has moved permanently.", match[0].group(0))
except:
t,v,tb = sys.exc_info()
test.log(str(t), str(v))
test.log("%s: %s" % (t.__name__, str(v)))
def main():
startQC()