aboutsummaryrefslogtreecommitdiffstats
path: root/tests/system
diff options
context:
space:
mode:
authorRobert Loehning <robert.loehning@qt.io>2019-07-17 22:58:22 +0200
committerRobert Loehning <robert.loehning@qt.io>2019-07-24 11:58:32 +0000
commitc1a83b2a887a67bc3064dac916d4bc241b1cad64 (patch)
tree1f3f9d03b9a6ed352730e8996c24d06c0843733a /tests/system
parentb3d9647582cffe2c193ef5c808b6ef7c32893562 (diff)
Squish: Update lib creation
Fixes tst_APTW03 Change-Id: Ifa1bcf5334773b68b8b0027ca03a016d5ba92cb4 Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Diffstat (limited to 'tests/system')
-rw-r--r--tests/system/shared/project.py60
1 files changed, 22 insertions, 38 deletions
diff --git a/tests/system/shared/project.py b/tests/system/shared/project.py
index a0eea63b82..8250891b71 100644
--- a/tests/system/shared/project.py
+++ b/tests/system/shared/project.py
@@ -97,7 +97,7 @@ def __createProjectOrFileSelectType__(category, template, fromWelcome = False, i
clickButton(waitForObject("{text='Choose...' type='QPushButton' unnamed='1' visible='1'}"))
return __getSupportedPlatforms__(str(text), template)[0]
-def __createProjectSetNameAndPath__(path, projectName = None, checks = True, libType = None):
+def __createProjectSetNameAndPath__(path, projectName = None, checks = True):
directoryEdit = waitForObject("{type='Utils::FancyLineEdit' unnamed='1' visible='1' "
"toolTip?='Full path: *'}")
replaceEditorContent(directoryEdit, path)
@@ -113,10 +113,6 @@ def __createProjectSetNameAndPath__(path, projectName = None, checks = True, lib
test.verify(labelCheck, "Project name and base directory without warning or error")
# make sure this is not set as default location
ensureChecked("{type='QCheckBox' name='projectsDirectoryCheckBox' visible='1'}", False)
- if libType != None:
- selectFromCombo(waitForObject("{leftWidget={text='Type' type='QLabel' unnamed='1' "
- "visible='1'} type='QComboBox' unnamed='1' visible='1'}"),
- LibType.getStringForLib(libType))
clickButton(waitForObject(":Next_QPushButton"))
return str(projectName)
@@ -365,22 +361,28 @@ def createNewCPPLib(projectDir, projectName, className, target, isStatic):
libType = LibType.SHARED
if projectDir == None:
projectDir = tempDir()
- projectName = __createProjectSetNameAndPath__(projectDir, projectName, False, libType)
+ projectName = __createProjectSetNameAndPath__(projectDir, projectName, False)
+ __handleBuildSystem__(None)
+ selectFromCombo(waitForObject("{name='Type' type='QComboBox' visible='1' "
+ "window=':New_ProjectExplorer::JsonWizard'}"),
+ LibType.getStringForLib(libType))
+ __createProjectHandleModuleSelection__("Core")
+ className = __createProjectHandleClassInformation__(className)
__chooseTargets__(target, available)
- snooze(1)
clickButton(waitForObject(":Next_QPushButton"))
- __createProjectHandleModuleSelection__(["QtCore"])
- className = __createProjectHandleClassInformation__(className)
__createProjectHandleLastPage__()
return projectName, className
def createNewQtPlugin(projectDir, projectName, className, target, baseClass="QGenericPlugin"):
available = __createProjectOrFileSelectType__(" Library", "C++ Library", False, True)
- projectName = __createProjectSetNameAndPath__(projectDir, projectName, False, LibType.QT_PLUGIN)
+ projectName = __createProjectSetNameAndPath__(projectDir, projectName, False)
+ __handleBuildSystem__(None)
+ selectFromCombo(waitForObject("{name='Type' type='QComboBox' visible='1' "
+ "window=':New_ProjectExplorer::JsonWizard'}"),
+ LibType.getStringForLib(LibType.QT_PLUGIN))
+ className = __createProjectHandleClassInformation__(className, baseClass)
__chooseTargets__(target, available)
- snooze(1)
clickButton(waitForObject(":Next_QPushButton"))
- className = __createProjectHandleClassInformation__(className, baseClass)
__createProjectHandleLastPage__()
return projectName, className
@@ -422,36 +424,18 @@ def __chooseTargets__(targets, availableTargets=None, additionalFunc=None):
test.warning("Target '%s' is not set up correctly." % Targets.getStringForTarget(current))
return checkedTargets
-def __createProjectHandleModuleSelection__(modules):
- modulesPage = waitForObject("{type='QmakeProjectManager::Internal::ModulesPage' unnamed='1' "
- "visible='1'}")
- chckBoxes = filter(lambda x: className(x) == 'QCheckBox', object.children(modulesPage))
- chckBoxLabels = set([str(cb.text) for cb in chckBoxes])
- if not set(modules).issubset(chckBoxLabels):
- test.fatal("You want to check module(s) not available at 'Module Selection' page.",
- "Not available: %s" % str(set(modules).difference(chckBoxLabels)))
- for checkBox in chckBoxes:
- test.log("(Un)Checking module checkbox '%s'" % str(checkBox.text))
- ensureChecked(checkBox, str(checkBox.text) in modules, 3000)
- clickButton(waitForObject(":Next_QPushButton"))
+def __createProjectHandleModuleSelection__(module):
+ selectFromCombo(waitForObject("{name='LibraryQtModule' type='QComboBox' visible='1' "
+ "window=':New_ProjectExplorer::JsonWizard'}"), module)
def __createProjectHandleClassInformation__(className, baseClass=None):
if baseClass:
- selectFromCombo("{name='baseClassComboBox' type='QComboBox' visible='1'}", baseClass)
- classLineEd = waitForObject("{name='classLineEdit' type='Utils::ClassNameValidatingLineEdit' "
- "visible='1'}")
- result = str(classLineEd.text)
- if className:
- replaceEditorContent(classLineEd, className)
- try:
- waitForObject("{text='The class name contains invalid characters.' type='QLabel' "
- "unnamed='1' visible='1'}", 1000)
- test.fatal("Class name contains invalid characters - using default.")
- replaceEditorContent(classLineEd, result)
- except:
- result = className
+ selectFromCombo("{name='BaseClassInfo' type='QComboBox' visible='1' "
+ "window=':New_ProjectExplorer::JsonWizard'}", baseClass)
+ replaceEditorContent(waitForObject("{name='Class' type='Utils::FancyLineEdit' visible='1' "
+ "window=':New_ProjectExplorer::JsonWizard'}"), className)
clickButton(waitForObject(":Next_QPushButton"))
- return result
+ return className
def waitForProcessRunning(running=True):
outputButton = waitForObject(":Qt Creator_AppOutput_Core::Internal::OutputPaneToggleButton")