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.
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:
* 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

View File

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

View File

@@ -69,7 +69,10 @@ def openCmakeProject(projectPath, buildDir):
invokeMenuItem("File", "Open File or Project...")
selectFromFileDialog(projectPath)
__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"))
return True
@@ -511,6 +514,7 @@ def __getSupportedPlatforms__(text, templateName, getAsStrings=False):
result = set()
if 'Desktop' in supports:
if (version == None or version < "5.0") and not templateName.startswith("Qt Quick 2"):
if qt4Available:
result.add(Targets.DESKTOP_4_8_7_DEFAULT)
if platform.system() in ("Linux", "Darwin"):
result.add(Targets.EMBEDDED_LINUX)

View File

@@ -339,6 +339,8 @@ elif platform.system() == 'Darwin':
else:
origSettingsDir = os.path.join(origSettingsDir, "unix")
qt4Available = os.path.exists(qt4Path)
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

View File

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

View File

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

View File

@@ -41,7 +41,10 @@ def main():
startQC()
if not startedWithoutPluginError():
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()
fancyToolButton = waitForObject(":*Qt Creator_Core::Internal::FancyToolButton")

View File

@@ -36,7 +36,10 @@ def main():
return
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
waitFor("runButton.enabled", 30000)
# Starting before opening, because this is where Creator froze (QTCREATORBUG-10733)