SquishTests: Rename helper class

Change-Id: I39890cbd98b7e6ebcc0fdf4722d0311eb6650397
Reviewed-by: David Schulz <david.schulz@qt.io>
This commit is contained in:
Christian Stenger
2023-02-22 13:49:54 +01:00
parent ef731faa47
commit 3a7ab3ce8e
15 changed files with 29 additions and 29 deletions

View File

@@ -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):

View File

@@ -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)

View File

@@ -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)):

View File

@@ -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)):

View File

@@ -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"

View File

@@ -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)):

View File

@@ -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)

View File

@@ -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)

View File

@@ -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)):

View File

@@ -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

View File

@@ -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))

View File

@@ -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")

View File

@@ -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)):

View File

@@ -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 = []

View File

@@ -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)):