Squish: Remove old default target parameters

Change-Id: I72153c535ae0670cb4bfa061f34659bc7faee001
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
Robert Loehning
2018-08-08 17:44:27 +02:00
parent 2b877246ca
commit 94fb8efab1
3 changed files with 12 additions and 28 deletions

View File

@@ -342,26 +342,15 @@ def createEmptyQtProject(workingDir=None, projectName=None, targets=Targets.desk
__createProjectHandleLastPage__() __createProjectHandleLastPage__()
return projectName return projectName
def createNewNonQtProject(workingDir=None, projectName=None, target=[Targets.DESKTOP_4_8_7_DEFAULT], def createNewNonQtProject(workingDir, projectName, target, plainC=False, buildSystem="qmake"):
plainC=False, cmake=False, qbs=False):
if plainC: if plainC:
template = "Plain C Application" template = "Plain C Application"
else: else:
template = "Plain C++ Application" template = "Plain C++ Application"
available = __createProjectOrFileSelectType__(" Non-Qt Project", template) available = __createProjectOrFileSelectType__(" Non-Qt Project", template)
if workingDir == None:
workingDir = tempDir()
projectName = __createProjectSetNameAndPath__(workingDir, projectName) projectName = __createProjectSetNameAndPath__(workingDir, projectName)
buildSystem = "qmake"
if qbs:
buildSystem = "Qbs"
if cmake:
test.warning("Unsupported combination, at least one of parameters cmake and qbs must "
"be False, ignoring the value of cmake")
elif cmake:
buildSystem = "CMake"
selectFromCombo("{name='BuildSystem' type='QComboBox' visible='1'}", buildSystem) selectFromCombo("{name='BuildSystem' type='QComboBox' visible='1'}", buildSystem)
clickButton(waitForObject(":Next_QPushButton")) clickButton(waitForObject(":Next_QPushButton"))
@@ -370,9 +359,8 @@ def createNewNonQtProject(workingDir=None, projectName=None, target=[Targets.DES
__createProjectHandleLastPage__() __createProjectHandleLastPage__()
return projectName return projectName
def createNewCPPLib(projectDir = None, projectName = None, className = None, fromWelcome = False, def createNewCPPLib(projectDir, projectName, className, target, isStatic):
target = [Targets.DESKTOP_4_8_7_DEFAULT], isStatic = False, modules = ["QtCore"]): available = __createProjectOrFileSelectType__(" Library", "C++ Library", False, True)
available = __createProjectOrFileSelectType__(" Library", "C++ Library", fromWelcome, True)
if isStatic: if isStatic:
libType = LibType.STATIC libType = LibType.STATIC
else: else:
@@ -383,16 +371,13 @@ def createNewCPPLib(projectDir = None, projectName = None, className = None, fro
__chooseTargets__(target, available) __chooseTargets__(target, available)
snooze(1) snooze(1)
clickButton(waitForObject(":Next_QPushButton")) clickButton(waitForObject(":Next_QPushButton"))
__createProjectHandleModuleSelection__(modules) __createProjectHandleModuleSelection__(["QtCore"])
className = __createProjectHandleClassInformation__(className) className = __createProjectHandleClassInformation__(className)
__createProjectHandleLastPage__() __createProjectHandleLastPage__()
return projectName, className return projectName, className
def createNewQtPlugin(projectDir=None, projectName=None, className=None, fromWelcome=False, def createNewQtPlugin(projectDir, projectName, className, target, baseClass="QGenericPlugin"):
target=[Targets.DESKTOP_4_8_7_DEFAULT], baseClass="QGenericPlugin"): available = __createProjectOrFileSelectType__(" Library", "C++ Library", False, True)
available = __createProjectOrFileSelectType__(" Library", "C++ Library", fromWelcome, True)
if projectDir == None:
projectDir = tempDir()
projectName = __createProjectSetNameAndPath__(projectDir, projectName, False, LibType.QT_PLUGIN) projectName = __createProjectSetNameAndPath__(projectDir, projectName, False, LibType.QT_PLUGIN)
__chooseTargets__(target, available) __chooseTargets__(target, available)
snooze(1) snooze(1)
@@ -407,7 +392,7 @@ def createNewQtPlugin(projectDir=None, projectName=None, className=None, fromWel
# parameter additionalFunc function to be executed inside the detailed view of each chosen kit # parameter additionalFunc function to be executed inside the detailed view of each chosen kit
# if present, 'Details' button will be clicked, function will be executed, # if present, 'Details' button will be clicked, function will be executed,
# 'Details' button will be clicked again # 'Details' button will be clicked again
def __chooseTargets__(targets=[Targets.DESKTOP_4_8_7_DEFAULT], availableTargets=None, additionalFunc=None): def __chooseTargets__(targets, availableTargets=None, additionalFunc=None):
if availableTargets != None: if availableTargets != None:
available = availableTargets available = availableTargets
else: else:

View File

@@ -57,8 +57,8 @@ def handleInsertVirtualFunctions(expected):
def checkSimpleCppLib(projectName, static): def checkSimpleCppLib(projectName, static):
projectName, className = createNewCPPLib(tempDir(), projectName, "MyClass", projectName, className = createNewCPPLib(tempDir(), projectName, "MyClass",
target=Targets.desktopTargetClasses(), Targets.desktopTargetClasses(),
isStatic=static) static)
for kit, config in iterateBuildConfigs("Release"): for kit, config in iterateBuildConfigs("Release"):
verifyBuildConfig(kit, config, False, True) verifyBuildConfig(kit, config, False, True)
invokeMenuItem('Build', 'Build Project "%s"' % projectName) invokeMenuItem('Build', 'Build Project "%s"' % projectName)
@@ -79,10 +79,8 @@ def main():
checkSimpleCppLib("SampleApp1", False) checkSimpleCppLib("SampleApp1", False)
checkSimpleCppLib("SampleApp2", True) checkSimpleCppLib("SampleApp2", True)
# Qt Plugin needs Qt4.8 for QGenericPlugin which is tested by default
targets = Targets.desktopTargetClasses()
projectName, className = createNewQtPlugin(tempDir(), "SampleApp3", "MyPlugin", projectName, className = createNewQtPlugin(tempDir(), "SampleApp3", "MyPlugin",
target=targets) Targets.desktopTargetClasses())
virtualFunctionsAdded = False virtualFunctionsAdded = False
for kit, config in iterateBuildConfigs("Debug"): for kit, config in iterateBuildConfigs("Debug"):
is487Kit = kit in (Targets.DESKTOP_4_8_7_DEFAULT, Targets.EMBEDDED_LINUX) is487Kit = kit in (Targets.DESKTOP_4_8_7_DEFAULT, Targets.EMBEDDED_LINUX)

View File

@@ -83,7 +83,8 @@ def main():
continue continue
if not startCreator(useClang): if not startCreator(useClang):
continue continue
projectName = createNewNonQtProject() projectName = createNewNonQtProject(tempDir(), "project_csup03",
[Targets.DESKTOP_4_8_7_DEFAULT])
checkCodeModelSettings(useClang) checkCodeModelSettings(useClang)
openDocument("%s.Sources.main\\.cpp" % projectName) openDocument("%s.Sources.main\\.cpp" % projectName)
editor = getEditorForFileSuffix("main.cpp") editor = getEditorForFileSuffix("main.cpp")