From 3a7ab3ce8e4a3270de557ea377370a0342f33a9f Mon Sep 17 00:00:00 2001 From: Christian Stenger Date: Wed, 22 Feb 2023 13:49:54 +0100 Subject: [PATCH] SquishTests: Rename helper class Change-Id: I39890cbd98b7e6ebcc0fdf4722d0311eb6650397 Reviewed-by: David Schulz --- tests/system/shared/classes.py | 22 +++++++++---------- tests/system/shared/project.py | 2 +- tests/system/suite_CCOM/tst_CCOM01/test.py | 2 +- tests/system/suite_CCOM/tst_CCOM02/test.py | 2 +- tests/system/suite_CSUP/tst_CSUP04/test.py | 2 +- tests/system/suite_CSUP/tst_CSUP05/test.py | 2 +- tests/system/suite_HELP/tst_HELP04/test.py | 2 +- tests/system/suite_HELP/tst_HELP05/test.py | 2 +- tests/system/suite_QMLS/tst_QMLS03/test.py | 2 +- tests/system/suite_WELP/tst_WELP02/test.py | 2 +- tests/system/suite_WELP/tst_WELP03/test.py | 6 ++--- .../suite_editors/tst_qml_editor/test.py | 4 ++-- .../suite_general/tst_rename_file/test.py | 2 +- .../tst_session_handling/test.py | 4 ++-- .../suite_qtquick/tst_qml_outline/test.py | 2 +- 15 files changed, 29 insertions(+), 29 deletions(-) diff --git a/tests/system/shared/classes.py b/tests/system/shared/classes.py index 37a3b812fa1..49026fa425d 100644 --- a/tests/system/shared/classes.py +++ b/tests/system/shared/classes.py @@ -75,7 +75,7 @@ class LibType: return "Qt Plugin" return None -class Qt5Path: +class QtPath: DOCS = 0 EXAMPLES = 1 @@ -84,10 +84,10 @@ class Qt5Path: qt5targets = [Targets.DESKTOP_5_10_1_DEFAULT, Targets.DESKTOP_5_14_1_DEFAULT] if platform.system() != 'Darwin': qt5targets.append(Targets.DESKTOP_5_4_1_GCC) - if pathSpec == Qt5Path.DOCS: - return map(lambda target: Qt5Path.docsPath(target), qt5targets) - elif pathSpec == Qt5Path.EXAMPLES: - return map(lambda target: Qt5Path.examplesPath(target), qt5targets) + if pathSpec == QtPath.DOCS: + return map(lambda target: QtPath.docsPath(target), qt5targets) + elif pathSpec == QtPath.EXAMPLES: + return map(lambda target: QtPath.examplesPath(target), qt5targets) else: test.fatal("Unknown pathSpec given: %s" % str(pathSpec)) return [] @@ -116,29 +116,29 @@ class Qt5Path: @staticmethod def getQtMinorAndPatchVersion(target): - qtVersionStr = Qt5Path.__preCheckAndExtractQtVersionStr__(target) - versionTuple = Qt5Path.toVersionTuple(qtVersionStr) + qtVersionStr = QtPath.__preCheckAndExtractQtVersionStr__(target) + versionTuple = QtPath.toVersionTuple(qtVersionStr) return versionTuple[1], versionTuple[2] @staticmethod def examplesPath(target): - qtMinorVersion, qtPatchVersion = Qt5Path.getQtMinorAndPatchVersion(target) + qtMinorVersion, qtPatchVersion = QtPath.getQtMinorAndPatchVersion(target) if qtMinorVersion < 10: path = "Examples/Qt-5.%d" % qtMinorVersion else: path = "Examples/Qt-5.%d.%d" % (qtMinorVersion, qtPatchVersion) - return os.path.join(Qt5Path.__createPlatformQtPath__(qtMinorVersion), path) + return os.path.join(QtPath.__createPlatformQtPath__(qtMinorVersion), path) @staticmethod def docsPath(target): - qtMinorVersion, qtPatchVersion = Qt5Path.getQtMinorAndPatchVersion(target) + qtMinorVersion, qtPatchVersion = QtPath.getQtMinorAndPatchVersion(target) if qtMinorVersion < 10: path = "Docs/Qt-5.%d" % qtMinorVersion else: path = "Docs/Qt-5.%d.%d" % (qtMinorVersion, qtPatchVersion) - return os.path.join(Qt5Path.__createPlatformQtPath__(qtMinorVersion), path) + return os.path.join(QtPath.__createPlatformQtPath__(qtMinorVersion), path) class TestSection: def __init__(self, description): diff --git a/tests/system/shared/project.py b/tests/system/shared/project.py index 2e12ac9c627..0ee2db614d6 100644 --- a/tests/system/shared/project.py +++ b/tests/system/shared/project.py @@ -188,7 +188,7 @@ def __modifyAvailableTargets__(available, requiredQt, asStrings=False): item = Targets.getStringForTarget(currentItem) found = versionFinder.search(item) if found: - if Qt5Path.toVersionTuple(found.group(1)) < Qt5Path.toVersionTuple(requiredQt): + if QtPath.toVersionTuple(found.group(1)) < QtPath.toVersionTuple(requiredQt): available.discard(currentItem) elif currentItem.endswith(" (invalid)"): available.discard(currentItem) diff --git a/tests/system/suite_CCOM/tst_CCOM01/test.py b/tests/system/suite_CCOM/tst_CCOM01/test.py index 5fe2647a852..1168ca94a50 100644 --- a/tests/system/suite_CCOM/tst_CCOM01/test.py +++ b/tests/system/suite_CCOM/tst_CCOM01/test.py @@ -6,7 +6,7 @@ source("../../shared/qtcreator.py") # entry of test def main(): # prepare example project - sourceExample = os.path.join(Qt5Path.examplesPath(Targets.DESKTOP_5_14_1_DEFAULT), + sourceExample = os.path.join(QtPath.examplesPath(Targets.DESKTOP_5_14_1_DEFAULT), "quick", "animation") proFile = "animation.pro" if not neededFilePresent(os.path.join(sourceExample, proFile)): diff --git a/tests/system/suite_CCOM/tst_CCOM02/test.py b/tests/system/suite_CCOM/tst_CCOM02/test.py index 011d576a599..491f8770d03 100644 --- a/tests/system/suite_CCOM/tst_CCOM02/test.py +++ b/tests/system/suite_CCOM/tst_CCOM02/test.py @@ -7,7 +7,7 @@ source("../../shared/qtcreator.py") # entry of test def main(): # prepare example project - sourceExample = os.path.join(Qt5Path.examplesPath(Targets.DESKTOP_5_14_1_DEFAULT), + sourceExample = os.path.join(QtPath.examplesPath(Targets.DESKTOP_5_14_1_DEFAULT), "quick", "animation") proFile = "animation.pro" if not neededFilePresent(os.path.join(sourceExample, proFile)): diff --git a/tests/system/suite_CSUP/tst_CSUP04/test.py b/tests/system/suite_CSUP/tst_CSUP04/test.py index cf96aaf9a36..efede6848bb 100644 --- a/tests/system/suite_CSUP/tst_CSUP04/test.py +++ b/tests/system/suite_CSUP/tst_CSUP04/test.py @@ -6,7 +6,7 @@ source("../../shared/qtcreator.py") # entry of test def main(): # prepare example project - sourceExample = os.path.join(Qt5Path.examplesPath(Targets.DESKTOP_5_14_1_DEFAULT), + sourceExample = os.path.join(QtPath.examplesPath(Targets.DESKTOP_5_14_1_DEFAULT), "gui", "openglwindow") proFile = "openglwindow.pro" diff --git a/tests/system/suite_CSUP/tst_CSUP05/test.py b/tests/system/suite_CSUP/tst_CSUP05/test.py index 33b804503fb..e67d563b44c 100644 --- a/tests/system/suite_CSUP/tst_CSUP05/test.py +++ b/tests/system/suite_CSUP/tst_CSUP05/test.py @@ -6,7 +6,7 @@ source("../../shared/qtcreator.py") # entry of test def main(): # prepare example project - sourceExample = os.path.join(Qt5Path.examplesPath(Targets.DESKTOP_5_14_1_DEFAULT), + sourceExample = os.path.join(QtPath.examplesPath(Targets.DESKTOP_5_14_1_DEFAULT), "gui", "openglwindow") proFile = "openglwindow.pro" if not neededFilePresent(os.path.join(sourceExample, proFile)): diff --git a/tests/system/suite_HELP/tst_HELP04/test.py b/tests/system/suite_HELP/tst_HELP04/test.py index 40370622149..e4c0500d234 100644 --- a/tests/system/suite_HELP/tst_HELP04/test.py +++ b/tests/system/suite_HELP/tst_HELP04/test.py @@ -48,7 +48,7 @@ def main(): if not startedWithoutPluginError(): return docFiles = ["qtdoc.qch", "qtsql.qch"] - docFiles = [os.path.join(Qt5Path.docsPath(Targets.DESKTOP_5_14_1_DEFAULT), file) for file in docFiles] + docFiles = [os.path.join(QtPath.docsPath(Targets.DESKTOP_5_14_1_DEFAULT), file) for file in docFiles] addHelpDocumentation(docFiles) # switch to help mode switchViewTo(ViewConstants.HELP) diff --git a/tests/system/suite_HELP/tst_HELP05/test.py b/tests/system/suite_HELP/tst_HELP05/test.py index d8232b5d6e2..7facd9635af 100644 --- a/tests/system/suite_HELP/tst_HELP05/test.py +++ b/tests/system/suite_HELP/tst_HELP05/test.py @@ -25,7 +25,7 @@ def main(): if not startedWithoutPluginError(): return qchs = [] - for p in Qt5Path.getPaths(Qt5Path.DOCS): + for p in QtPath.getPaths(QtPath.DOCS): qchs.append(os.path.join(p, "qtquick.qch")) addHelpDocumentation(qchs) setFixedHelpViewer(HelpViewer.SIDEBYSIDE) diff --git a/tests/system/suite_QMLS/tst_QMLS03/test.py b/tests/system/suite_QMLS/tst_QMLS03/test.py index 5273984a84b..be01c125dec 100644 --- a/tests/system/suite_QMLS/tst_QMLS03/test.py +++ b/tests/system/suite_QMLS/tst_QMLS03/test.py @@ -45,7 +45,7 @@ def checkUsages(resultsView, expectedResults, directory): def main(): # prepare example project - sourceExample = os.path.join(Qt5Path.examplesPath(Targets.DESKTOP_5_14_1_DEFAULT), + sourceExample = os.path.join(QtPath.examplesPath(Targets.DESKTOP_5_14_1_DEFAULT), "quick", "animation") proFile = "animation.pro" if not neededFilePresent(os.path.join(sourceExample, proFile)): diff --git a/tests/system/suite_WELP/tst_WELP02/test.py b/tests/system/suite_WELP/tst_WELP02/test.py index 25b1f725ef7..d79391d1213 100644 --- a/tests/system/suite_WELP/tst_WELP02/test.py +++ b/tests/system/suite_WELP/tst_WELP02/test.py @@ -43,7 +43,7 @@ def checkTypeAndProperties(typePropertiesDetails): def main(): # prepare example project - sourceExample = os.path.join(Qt5Path.examplesPath(Targets.DESKTOP_5_14_1_DEFAULT), + sourceExample = os.path.join(QtPath.examplesPath(Targets.DESKTOP_5_14_1_DEFAULT), "quick", "animation") if not neededFilePresent(sourceExample): return diff --git a/tests/system/suite_WELP/tst_WELP03/test.py b/tests/system/suite_WELP/tst_WELP03/test.py index bb96a8be45d..3b60d15a2e2 100644 --- a/tests/system/suite_WELP/tst_WELP03/test.py +++ b/tests/system/suite_WELP/tst_WELP03/test.py @@ -41,7 +41,7 @@ def main(): if not startedWithoutPluginError(): return qchs = [] - for p in Qt5Path.getPaths(Qt5Path.DOCS): + for p in QtPath.getPaths(QtPath.DOCS): qchs.extend([os.path.join(p, "qtopengl.qch"), os.path.join(p, "qtwidgets.qch")]) addHelpDocumentation(qchs) setFixedHelpViewer(HelpViewer.HELPMODE) @@ -72,7 +72,7 @@ def main(): test.verify(example is None, "Verifying: No example is shown.") proFiles = [os.path.join(p, "opengl", "2dpainting", "2dpainting.pro") - for p in Qt5Path.getPaths(Qt5Path.EXAMPLES)] + for p in QtPath.getPaths(QtPath.EXAMPLES)] cleanUpUserFiles(proFiles) for p in proFiles: removePackagingDirectory(os.path.dirname(p)) @@ -94,7 +94,7 @@ def main(): # go to "Welcome" page and choose another example switchViewTo(ViewConstants.WELCOME) proFiles = [os.path.join(p, "widgets", "itemviews", "addressbook", "addressbook.pro") - for p in Qt5Path.getPaths(Qt5Path.EXAMPLES)] + for p in QtPath.getPaths(QtPath.EXAMPLES)] cleanUpUserFiles(proFiles) for p in proFiles: removePackagingDirectory(os.path.dirname(p)) diff --git a/tests/system/suite_editors/tst_qml_editor/test.py b/tests/system/suite_editors/tst_qml_editor/test.py index ca634d0f4b9..1cfa67e066d 100644 --- a/tests/system/suite_editors/tst_qml_editor/test.py +++ b/tests/system/suite_editors/tst_qml_editor/test.py @@ -7,7 +7,7 @@ focusDocumentPath = "keyinteraction.Resources.keyinteraction\.qrc./keyinteractio def main(): target = Targets.DESKTOP_5_14_1_DEFAULT - sourceExample = os.path.join(Qt5Path.examplesPath(target), "quick/keyinteraction") + sourceExample = os.path.join(QtPath.examplesPath(target), "quick/keyinteraction") proFile = "keyinteraction.pro" if not neededFilePresent(os.path.join(sourceExample, proFile)): return @@ -15,7 +15,7 @@ def main(): if not startedWithoutPluginError(): return # add docs to have the correct tool tips - addHelpDocumentation([os.path.join(Qt5Path.docsPath(target), "qtquick.qch")]) + addHelpDocumentation([os.path.join(QtPath.docsPath(target), "qtquick.qch")]) templateDir = prepareTemplate(sourceExample) openQmakeProject(os.path.join(templateDir, proFile), [target]) openDocument(focusDocumentPath % "focus\\.qml") diff --git a/tests/system/suite_general/tst_rename_file/test.py b/tests/system/suite_general/tst_rename_file/test.py index 5fa8c416c28..693303553a6 100644 --- a/tests/system/suite_general/tst_rename_file/test.py +++ b/tests/system/suite_general/tst_rename_file/test.py @@ -6,7 +6,7 @@ source("../../shared/qtcreator.py") def main(): # prepare example project projectName = "adding" - sourceExample = os.path.join(Qt5Path.examplesPath(Targets.DESKTOP_5_14_1_DEFAULT), + sourceExample = os.path.join(QtPath.examplesPath(Targets.DESKTOP_5_14_1_DEFAULT), "qml", "referenceexamples", "adding") proFile = projectName + ".pro" if not neededFilePresent(os.path.join(sourceExample, proFile)): diff --git a/tests/system/suite_general/tst_session_handling/test.py b/tests/system/suite_general/tst_session_handling/test.py index d1782c69cea..1e4b9af0fac 100644 --- a/tests/system/suite_general/tst_session_handling/test.py +++ b/tests/system/suite_general/tst_session_handling/test.py @@ -45,9 +45,9 @@ def main(): invokeMenuItem("File", "Exit") def prepareTestExamples(): - examples = [os.path.join(Qt5Path.examplesPath(Targets.DESKTOP_5_14_1_DEFAULT), + examples = [os.path.join(QtPath.examplesPath(Targets.DESKTOP_5_14_1_DEFAULT), "quick", "animation", "animation.pro"), - os.path.join(Qt5Path.examplesPath(Targets.DESKTOP_5_14_1_DEFAULT), + os.path.join(QtPath.examplesPath(Targets.DESKTOP_5_14_1_DEFAULT), "quick", "keyinteraction", "keyinteraction.pro") ] projects = [] diff --git a/tests/system/suite_qtquick/tst_qml_outline/test.py b/tests/system/suite_qtquick/tst_qml_outline/test.py index f495c786591..1508dc9aaa8 100644 --- a/tests/system/suite_qtquick/tst_qml_outline/test.py +++ b/tests/system/suite_qtquick/tst_qml_outline/test.py @@ -8,7 +8,7 @@ outline = ":Qt Creator_QmlJSEditor::Internal::QmlJSOutlineTreeView" treebase = "keyinteraction.Resources.keyinteraction\\.qrc./keyinteraction.focus." def main(): - sourceExample = os.path.join(Qt5Path.examplesPath(Targets.DESKTOP_5_14_1_DEFAULT), + sourceExample = os.path.join(QtPath.examplesPath(Targets.DESKTOP_5_14_1_DEFAULT), "quick", "keyinteraction") proFile = "keyinteraction.pro" if not neededFilePresent(os.path.join(sourceExample, proFile)):