diff options
author | Robert Löhning <robert.loehning@qt.io> | 2023-05-03 23:49:59 +0200 |
---|---|---|
committer | Robert Löhning <robert.loehning@qt.io> | 2023-05-05 09:33:01 +0000 |
commit | 8d03220017bf7e5c7be51fc36acb56fbde9e3e13 (patch) | |
tree | 4d24bb315e30a8247091e1e2c7d949b6be109d46 /tests | |
parent | b083a4d55efbf9f6558034c0ce4efe31062e0e5b (diff) | |
download | qt-creator-8d03220017bf7e5c7be51fc36acb56fbde9e3e13.tar.gz |
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>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/system/shared/build_utils.py | 2 | ||||
-rw-r--r-- | tests/system/shared/clang.py | 2 | ||||
-rw-r--r-- | tests/system/shared/editor_utils.py | 4 | ||||
-rw-r--r-- | tests/system/shared/fs_utils.py | 2 | ||||
-rw-r--r-- | tests/system/shared/project.py | 4 | ||||
-rw-r--r-- | tests/system/shared/utils.py | 4 | ||||
-rw-r--r-- | tests/system/suite_HELP/tst_HELP02/test.py | 2 | ||||
-rw-r--r-- | tests/system/suite_tools/tst_codepasting/test.py | 6 |
8 files changed, 13 insertions, 13 deletions
diff --git a/tests/system/shared/build_utils.py b/tests/system/shared/build_utils.py index 74063c72f9..9f9608a0c0 100644 --- a/tests/system/shared/build_utils.py +++ b/tests/system/shared/build_utils.py @@ -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): diff --git a/tests/system/shared/clang.py b/tests/system/shared/clang.py index 1753d8e724..812ead3e6a 100644 --- a/tests/system/shared/clang.py +++ b/tests/system/shared/clang.py @@ -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() diff --git a/tests/system/shared/editor_utils.py b/tests/system/shared/editor_utils.py index c1df47ac3e..de5619472e 100644 --- a/tests/system/shared/editor_utils.py +++ b/tests/system/shared/editor_utils.py @@ -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"): diff --git a/tests/system/shared/fs_utils.py b/tests/system/shared/fs_utils.py index 1bcc3c8185..af76c7c812 100644 --- a/tests/system/shared/fs_utils.py +++ b/tests/system/shared/fs_utils.py @@ -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 diff --git a/tests/system/shared/project.py b/tests/system/shared/project.py index babbf0eb6e..7b58b95c9f 100644 --- a/tests/system/shared/project.py +++ b/tests/system/shared/project.py @@ -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 diff --git a/tests/system/shared/utils.py b/tests/system/shared/utils.py index 96e63f29f0..aa70220407 100644 --- a/tests/system/shared/utils.py +++ b/tests/system/shared/utils.py @@ -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")) diff --git a/tests/system/suite_HELP/tst_HELP02/test.py b/tests/system/suite_HELP/tst_HELP02/test.py index 0f8ff6767b..3601c81a37 100644 --- a/tests/system/suite_HELP/tst_HELP02/test.py +++ b/tests/system/suite_HELP/tst_HELP02/test.py @@ -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.") diff --git a/tests/system/suite_tools/tst_codepasting/test.py b/tests/system/suite_tools/tst_codepasting/test.py index 5db5a28c90..3d4507095f 100644 --- a/tests/system/suite_tools/tst_codepasting/test.py +++ b/tests/system/suite_tools/tst_codepasting/test.py @@ -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() |