forked from qt-creator/qt-creator
Squish: Add helper functions to Target class
Change-Id: Iba67cc28d29346689ca8443ce0b594056feaa0cf Reviewed-by: Robert Loehning <robert.loehning@digia.com>
This commit is contained in:
@@ -1,3 +1,5 @@
|
|||||||
|
import operator
|
||||||
|
|
||||||
# for easier re-usage (because Python hasn't an enum type)
|
# for easier re-usage (because Python hasn't an enum type)
|
||||||
class Targets:
|
class Targets:
|
||||||
DESKTOP_474_GCC = 1
|
DESKTOP_474_GCC = 1
|
||||||
@@ -44,6 +46,17 @@ class Targets:
|
|||||||
test.fatal("You've passed at least one unknown target!")
|
test.fatal("You've passed at least one unknown target!")
|
||||||
return result
|
return result
|
||||||
|
|
||||||
|
@staticmethod
|
||||||
|
def intToArray(targets):
|
||||||
|
available = [Targets.DESKTOP_474_GCC, Targets.SIMULATOR, Targets.MAEMO5, Targets.HARMATTAN,
|
||||||
|
Targets.EMBEDDED_LINUX, Targets.DESKTOP_474_MSVC2008,
|
||||||
|
Targets.DESKTOP_501_DEFAULT]
|
||||||
|
return filter(lambda x: x & targets == x, available)
|
||||||
|
|
||||||
|
@staticmethod
|
||||||
|
def arrayToInt(targetArr):
|
||||||
|
return reduce(operator.or_, targetArr, 0)
|
||||||
|
|
||||||
# this class holds some constants for easier usage inside the Projects view
|
# this class holds some constants for easier usage inside the Projects view
|
||||||
class ProjectSettings:
|
class ProjectSettings:
|
||||||
BUILD = 1
|
BUILD = 1
|
||||||
|
@@ -7,19 +7,14 @@ def main():
|
|||||||
startApplication("qtcreator" + SettingsPath)
|
startApplication("qtcreator" + SettingsPath)
|
||||||
if not startedWithoutPluginError():
|
if not startedWithoutPluginError():
|
||||||
return
|
return
|
||||||
targets = [Targets.DESKTOP_474_GCC]
|
targets = Targets.desktopTargetClasses()
|
||||||
if platform.system() in ('Windows', 'Microsoft'):
|
if not checkDebuggingLibrary(Targets.intToArray(targets)):
|
||||||
targets.append(Targets.DESKTOP_474_MSVC2008)
|
|
||||||
if not checkDebuggingLibrary(targets):
|
|
||||||
test.fatal("Error while checking debugging libraries - leaving this test.")
|
test.fatal("Error while checking debugging libraries - leaving this test.")
|
||||||
invokeMenuItem("File", "Exit")
|
invokeMenuItem("File", "Exit")
|
||||||
return
|
return
|
||||||
# using a temporary directory won't mess up a potentially existing
|
# using a temporary directory won't mess up a potentially existing
|
||||||
workingDir = tempDir()
|
workingDir = tempDir()
|
||||||
targetsVal = 0
|
checkedTargets, projectName = createNewQtQuickApplication(workingDir, targets=targets)
|
||||||
for t in targets:
|
|
||||||
targetsVal |= t
|
|
||||||
checkedTargets, projectName = createNewQtQuickApplication(workingDir, targets=targetsVal)
|
|
||||||
editor = waitForObject(":Qt Creator_QmlJSEditor::QmlJSTextEditorWidget")
|
editor = waitForObject(":Qt Creator_QmlJSEditor::QmlJSTextEditorWidget")
|
||||||
if placeCursorToLine(editor, "MouseArea.*", True):
|
if placeCursorToLine(editor, "MouseArea.*", True):
|
||||||
type(editor, '<Up>')
|
type(editor, '<Up>')
|
||||||
|
Reference in New Issue
Block a user