Squish: Make presence of Qt4 optional

It is hard to build Qt4 nowadays. Any machine set up
today won't be able to build it without hazzle.
So, make it optional inside the Squish tests to avoid
fails and fatals. Use a different available Qt instead.

Change-Id: I151d809f4fada8047a30940a183f913af2a1a691
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Robert Löhning <robert.loehning@qt.io>
This commit is contained in:
Christian Stenger
2022-02-01 14:58:47 +01:00
parent f95636a820
commit 40caa8a4ba
8 changed files with 25 additions and 7 deletions

View File

@@ -5,6 +5,7 @@ Squish tests inside this folder have several prerequisites to get them running.
First - and most important - you have to own a valid Squish license. At least Squish 6.0 is required. First - and most important - you have to own a valid Squish license. At least Squish 6.0 is required.
Second - some of the test suites/test cases expect a build of Qt 4.8.7 to be available: Second - some of the test suites/test cases expect a build of Qt 4.8.7 to be available:
[ this is optional and if Qt4 is not available some Qt5 will be tried to use instead ]
1. Download the source code from: 1. Download the source code from:
* Windows: https://download.qt.io/archive/qt/4.8/4.8.7/qt-everywhere-opensource-src-4.8.7.zip * Windows: https://download.qt.io/archive/qt/4.8/4.8.7/qt-everywhere-opensource-src-4.8.7.zip
* Other: https://download.qt.io/archive/qt/4.8/4.8.7/qt-everywhere-opensource-src-4.8.7.tar.gz * Other: https://download.qt.io/archive/qt/4.8/4.8.7/qt-everywhere-opensource-src-4.8.7.tar.gz

View File

@@ -52,6 +52,8 @@ class Targets:
availableTargets.remove(Targets.EMBEDDED_LINUX) availableTargets.remove(Targets.EMBEDDED_LINUX)
elif platform.system() == 'Darwin': elif platform.system() == 'Darwin':
availableTargets.remove(Targets.DESKTOP_5_4_1_GCC) availableTargets.remove(Targets.DESKTOP_5_4_1_GCC)
if not qt4Available:
availableTargets.remove(Targets.DESKTOP_4_8_7_DEFAULT)
return availableTargets return availableTargets
@staticmethod @staticmethod

View File

@@ -69,7 +69,10 @@ def openCmakeProject(projectPath, buildDir):
invokeMenuItem("File", "Open File or Project...") invokeMenuItem("File", "Open File or Project...")
selectFromFileDialog(projectPath) selectFromFileDialog(projectPath)
__chooseTargets__([]) # uncheck all __chooseTargets__([]) # uncheck all
__chooseTargets__([Targets.DESKTOP_4_8_7_DEFAULT], additionalFunc=additionalFunction) targetToChoose = Targets.DESKTOP_4_8_7_DEFAULT # FIXME make the intended target a parameter
if not qt4Available:
targetToChoose = Targets.DESKTOP_5_14_1_DEFAULT
__chooseTargets__([targetToChoose], additionalFunc=additionalFunction)
clickButton(waitForObject(":Qt Creator.Configure Project_QPushButton")) clickButton(waitForObject(":Qt Creator.Configure Project_QPushButton"))
return True return True
@@ -511,7 +514,8 @@ def __getSupportedPlatforms__(text, templateName, getAsStrings=False):
result = set() result = set()
if 'Desktop' in supports: if 'Desktop' in supports:
if (version == None or version < "5.0") and not templateName.startswith("Qt Quick 2"): if (version == None or version < "5.0") and not templateName.startswith("Qt Quick 2"):
result.add(Targets.DESKTOP_4_8_7_DEFAULT) if qt4Available:
result.add(Targets.DESKTOP_4_8_7_DEFAULT)
if platform.system() in ("Linux", "Darwin"): if platform.system() in ("Linux", "Darwin"):
result.add(Targets.EMBEDDED_LINUX) result.add(Targets.EMBEDDED_LINUX)
result = result.union(set([Targets.DESKTOP_5_10_1_DEFAULT, Targets.DESKTOP_5_14_1_DEFAULT])) result = result.union(set([Targets.DESKTOP_5_10_1_DEFAULT, Targets.DESKTOP_5_14_1_DEFAULT]))

View File

@@ -339,6 +339,8 @@ elif platform.system() == 'Darwin':
else: else:
origSettingsDir = os.path.join(origSettingsDir, "unix") origSettingsDir = os.path.join(origSettingsDir, "unix")
qt4Available = os.path.exists(qt4Path)
srcPath = os.getenv("SYSTEST_SRCPATH", os.path.expanduser(os.path.join("~", "squish-data"))) srcPath = os.getenv("SYSTEST_SRCPATH", os.path.expanduser(os.path.join("~", "squish-data")))
# the following only doesn't work if the test ends in an exception # the following only doesn't work if the test ends in an exception

View File

@@ -78,8 +78,10 @@ def main():
continue continue
if not startCreatorVerifyingClang(useClang): if not startCreatorVerifyingClang(useClang):
continue continue
projectName = createNewNonQtProject(tempDir(), "project-csup03", targetToChoose = Targets.DESKTOP_4_8_7_DEFAULT
[Targets.DESKTOP_4_8_7_DEFAULT]) if not qt4Available:
targetToChoose = Targets.DESKTOP_5_14_1_DEFAULT
projectName = createNewNonQtProject(tempDir(), "project-csup03", [targetToChoose])
checkCodeModelSettings(useClang) checkCodeModelSettings(useClang)
openDocument("%s.Sources.main\\.cpp" % projectName) openDocument("%s.Sources.main\\.cpp" % projectName)
editor = getEditorForFileSuffix("main.cpp") editor = getEditorForFileSuffix("main.cpp")

View File

@@ -69,7 +69,8 @@ def main():
startQC() startQC()
if not startedWithoutPluginError(): if not startedWithoutPluginError():
return return
addHelpDocumentation([os.path.join(qt4Path, "doc", "qch", "qt.qch")]) if qt4Available:
addHelpDocumentation([os.path.join(qt4Path, "doc", "qch", "qt.qch")])
# switch to help mode # switch to help mode
switchViewTo(ViewConstants.HELP) switchViewTo(ViewConstants.HELP)
# verify that search widget is accessible # verify that search widget is accessible

View File

@@ -41,7 +41,10 @@ def main():
startQC() startQC()
if not startedWithoutPluginError(): if not startedWithoutPluginError():
return return
openQmakeProject(SpeedCrunchPath, [Targets.DESKTOP_4_8_7_DEFAULT]) targetToChoose = Targets.DESKTOP_4_8_7_DEFAULT
if not qt4Available:
targetToChoose = Targets.DESKTOP_5_14_1_DEFAULT
openQmakeProject(SpeedCrunchPath, [targetToChoose])
waitForProjectParsing() waitForProjectParsing()
fancyToolButton = waitForObject(":*Qt Creator_Core::Internal::FancyToolButton") fancyToolButton = waitForObject(":*Qt Creator_Core::Internal::FancyToolButton")

View File

@@ -36,7 +36,10 @@ def main():
return return
runButton = findObject(':*Qt Creator.Run_Core::Internal::FancyToolButton') runButton = findObject(':*Qt Creator.Run_Core::Internal::FancyToolButton')
openQmakeProject(pathSpeedcrunch, [Targets.DESKTOP_4_8_7_DEFAULT]) targetToChoose = Targets.DESKTOP_4_8_7_DEFAULT
if not qt4Available:
targetToChoose = Targets.DESKTOP_5_14_1_DEFAULT
openQmakeProject(pathSpeedcrunch, [targetToChoose])
# Wait for parsing to complete # Wait for parsing to complete
waitFor("runButton.enabled", 30000) waitFor("runButton.enabled", 30000)
# Starting before opening, because this is where Creator froze (QTCREATORBUG-10733) # Starting before opening, because this is where Creator froze (QTCREATORBUG-10733)