From 82534fc979a7710e460815de87a7f21becd05f05 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20L=C3=B6hning?= Date: Mon, 14 Mar 2022 19:21:24 +0100 Subject: [PATCH] Squish: Explicitly use qmake-based projects in suite_APTW Creator's default build system is CMake now which broke the tests. Change-Id: I901b44dd4545a297d0100da5d92aa1bea79e41d3 Reviewed-by: Christian Stenger --- tests/system/shared/project.py | 21 ++++++++++++++------- tests/system/suite_APTW/tst_APTW01/test.py | 4 ++-- tests/system/suite_APTW/tst_APTW02/test.py | 4 ++-- tests/system/suite_APTW/tst_APTW03/test.py | 7 ++++--- 4 files changed, 22 insertions(+), 14 deletions(-) diff --git a/tests/system/shared/project.py b/tests/system/shared/project.py index e5f4c4bc6b6..a5b9cd2dedf 100644 --- a/tests/system/shared/project.py +++ b/tests/system/shared/project.py @@ -1,6 +1,6 @@ ############################################################################ # -# Copyright (C) 2016 The Qt Company Ltd. +# Copyright (C) 2022 The Qt Company Ltd. # Contact: https://www.qt.io/licensing/ # # This file is part of Qt Creator. @@ -224,15 +224,19 @@ def __modifyAvailableTargets__(available, requiredQt, asStrings=False): if Qt5Path.toVersionTuple(found.group(1)) < Qt5Path.toVersionTuple(requiredQt): available.discard(currentItem) + # Creates a Qt GUI project # param path specifies where to create the project # param projectName is the name for the new project # param checks turns tests in the function on if set to True -def createProject_Qt_GUI(path, projectName, checks = True, addToVersionControl = ""): +# param addToVersionControl selects the specified VCS from Creator's wizard +# param buildSystem selects the specified build system from Creator's wizard +def createProject_Qt_GUI(path, projectName, checks=True, addToVersionControl="", + buildSystem=None): template = "Qt Widgets Application" available = __createProjectOrFileSelectType__(" Application (Qt)", template) __createProjectSetNameAndPath__(path, projectName, checks) - buildSystem = __handleBuildSystem__(None) + buildSystem = __handleBuildSystem__(buildSystem) if checks: exp_filename = "mainwindow" @@ -375,7 +379,8 @@ def createNewNonQtProject(workingDir, projectName, target, plainC=False, buildSy __createProjectHandleLastPage__() return projectName -def createNewCPPLib(projectDir, projectName, className, target, isStatic): + +def createNewCPPLib(projectDir, projectName, className, target, isStatic, buildSystem=None): available = __createProjectOrFileSelectType__(" Library", "C++ Library", False, True) if isStatic: libType = LibType.STATIC @@ -384,7 +389,7 @@ def createNewCPPLib(projectDir, projectName, className, target, isStatic): if projectDir == None: projectDir = tempDir() projectName = __createProjectSetNameAndPath__(projectDir, projectName, False) - __handleBuildSystem__(None) + __handleBuildSystem__(buildSystem) selectFromCombo(waitForObject("{name='Type' type='QComboBox' visible='1' " "window=':New_ProjectExplorer::JsonWizard'}"), LibType.getStringForLib(libType)) @@ -396,10 +401,12 @@ def createNewCPPLib(projectDir, projectName, className, target, isStatic): __createProjectHandleLastPage__() return projectName, className -def createNewQtPlugin(projectDir, projectName, className, target, baseClass="QGenericPlugin"): + +def createNewQtPlugin(projectDir, projectName, className, target, baseClass="QGenericPlugin", + buildSystem=None): available = __createProjectOrFileSelectType__(" Library", "C++ Library", False, True) projectName = __createProjectSetNameAndPath__(projectDir, projectName, False) - __handleBuildSystem__(None) + __handleBuildSystem__(buildSystem) selectFromCombo(waitForObject("{name='Type' type='QComboBox' visible='1' " "window=':New_ProjectExplorer::JsonWizard'}"), LibType.getStringForLib(LibType.QT_PLUGIN)) diff --git a/tests/system/suite_APTW/tst_APTW01/test.py b/tests/system/suite_APTW/tst_APTW01/test.py index ac833cffc93..cb03f38e1b8 100644 --- a/tests/system/suite_APTW/tst_APTW01/test.py +++ b/tests/system/suite_APTW/tst_APTW01/test.py @@ -1,6 +1,6 @@ ############################################################################ # -# Copyright (C) 2016 The Qt Company Ltd. +# Copyright (C) 2022 The Qt Company Ltd. # Contact: https://www.qt.io/licensing/ # # This file is part of Qt Creator. @@ -31,7 +31,7 @@ def main(): # warnings from the clang code model in "issues" view if not startCreatorVerifyingClang(False): return - createProject_Qt_GUI(tempDir(), "SampleApp") + createProject_Qt_GUI(tempDir(), "SampleApp", buildSystem="qmake") # run project for debug and release and verify results runVerify() #close Qt Creator diff --git a/tests/system/suite_APTW/tst_APTW02/test.py b/tests/system/suite_APTW/tst_APTW02/test.py index bff30f84e4e..e4f9a6d6ea1 100644 --- a/tests/system/suite_APTW/tst_APTW02/test.py +++ b/tests/system/suite_APTW/tst_APTW02/test.py @@ -1,6 +1,6 @@ ############################################################################ # -# Copyright (C) 2016 The Qt Company Ltd. +# Copyright (C) 2022 The Qt Company Ltd. # Contact: https://www.qt.io/licensing/ # # This file is part of Qt Creator. @@ -30,7 +30,7 @@ def main(): startQC() if not startedWithoutPluginError(): return - createNewQtQuickApplication(tempDir(), "SampleApp") + createNewQtQuickApplication(tempDir(), "SampleApp", buildSystem="qmake") # run project for debug and release and verify results runVerify() #close Qt Creator diff --git a/tests/system/suite_APTW/tst_APTW03/test.py b/tests/system/suite_APTW/tst_APTW03/test.py index 2a7c78bdde1..735073f2152 100644 --- a/tests/system/suite_APTW/tst_APTW03/test.py +++ b/tests/system/suite_APTW/tst_APTW03/test.py @@ -1,6 +1,6 @@ ############################################################################ # -# Copyright (C) 2016 The Qt Company Ltd. +# Copyright (C) 2022 The Qt Company Ltd. # Contact: https://www.qt.io/licensing/ # # This file is part of Qt Creator. @@ -65,7 +65,7 @@ def handleInsertVirtualFunctions(expected, toAdd): def checkSimpleCppLib(projectName, static): projectName, className = createNewCPPLib(tempDir(), projectName, "MyClass", Targets.desktopTargetClasses(), - static) + static, buildSystem="qmake") for kit, config in iterateBuildConfigs("Release"): verifyBuildConfig(kit, config, False, True) invokeMenuItem('Build', 'Build Project "%s"' % projectName) @@ -87,7 +87,8 @@ def main(): checkSimpleCppLib("SampleApp2", True) pluginTargets = (Targets.DESKTOP_5_10_1_DEFAULT, Targets.DESKTOP_5_14_1_DEFAULT) - projectName, className = createNewQtPlugin(tempDir(), "SampleApp3", "MyPlugin", pluginTargets) + projectName, className = createNewQtPlugin(tempDir(), "SampleApp3", "MyPlugin", pluginTargets, + buildSystem="qmake") virtualFunctionsAdded = False for kit, config in iterateBuildConfigs("Debug"): verifyBuildConfig(kit, config, True, True)