From 40caa8a4ba97ce7677cb26a7e4d4176baad99db6 Mon Sep 17 00:00:00 2001 From: Christian Stenger Date: Tue, 1 Feb 2022 14:58:47 +0100 Subject: [PATCH] Squish: Make presence of Qt4 optional MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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: Reviewed-by: Robert Löhning --- tests/system/README | 1 + tests/system/shared/classes.py | 2 ++ tests/system/shared/project.py | 8 ++++++-- tests/system/shared/qtcreator.py | 2 ++ tests/system/suite_CSUP/tst_CSUP03/test.py | 6 ++++-- tests/system/suite_HELP/tst_HELP04/test.py | 3 ++- tests/system/suite_general/tst_build_speedcrunch/test.py | 5 ++++- tests/system/suite_general/tst_openqt_creator/test.py | 5 ++++- 8 files changed, 25 insertions(+), 7 deletions(-) diff --git a/tests/system/README b/tests/system/README index 05fe472d5ad..61847485fbf 100644 --- a/tests/system/README +++ b/tests/system/README @@ -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 diff --git a/tests/system/shared/classes.py b/tests/system/shared/classes.py index a96a7e2d6e0..fefee33b53a 100644 --- a/tests/system/shared/classes.py +++ b/tests/system/shared/classes.py @@ -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 diff --git a/tests/system/shared/project.py b/tests/system/shared/project.py index e8ee09bda9d..04ea8220acb 100644 --- a/tests/system/shared/project.py +++ b/tests/system/shared/project.py @@ -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,7 +514,8 @@ 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"): - result.add(Targets.DESKTOP_4_8_7_DEFAULT) + if qt4Available: + result.add(Targets.DESKTOP_4_8_7_DEFAULT) if platform.system() in ("Linux", "Darwin"): result.add(Targets.EMBEDDED_LINUX) result = result.union(set([Targets.DESKTOP_5_10_1_DEFAULT, Targets.DESKTOP_5_14_1_DEFAULT])) diff --git a/tests/system/shared/qtcreator.py b/tests/system/shared/qtcreator.py index 0618ce273da..f7ea2a2c609 100644 --- a/tests/system/shared/qtcreator.py +++ b/tests/system/shared/qtcreator.py @@ -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 diff --git a/tests/system/suite_CSUP/tst_CSUP03/test.py b/tests/system/suite_CSUP/tst_CSUP03/test.py index 53b532c05de..a20ac19ea4f 100644 --- a/tests/system/suite_CSUP/tst_CSUP03/test.py +++ b/tests/system/suite_CSUP/tst_CSUP03/test.py @@ -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") diff --git a/tests/system/suite_HELP/tst_HELP04/test.py b/tests/system/suite_HELP/tst_HELP04/test.py index 18e3ee45639..83941679b9f 100644 --- a/tests/system/suite_HELP/tst_HELP04/test.py +++ b/tests/system/suite_HELP/tst_HELP04/test.py @@ -69,7 +69,8 @@ def main(): startQC() if not startedWithoutPluginError(): 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 switchViewTo(ViewConstants.HELP) # verify that search widget is accessible diff --git a/tests/system/suite_general/tst_build_speedcrunch/test.py b/tests/system/suite_general/tst_build_speedcrunch/test.py index 8ba749b1680..e98a9b0e9a5 100644 --- a/tests/system/suite_general/tst_build_speedcrunch/test.py +++ b/tests/system/suite_general/tst_build_speedcrunch/test.py @@ -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") diff --git a/tests/system/suite_general/tst_openqt_creator/test.py b/tests/system/suite_general/tst_openqt_creator/test.py index ad1f4b52a25..6ff0bfb345e 100644 --- a/tests/system/suite_general/tst_openqt_creator/test.py +++ b/tests/system/suite_general/tst_openqt_creator/test.py @@ -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)